Gtk2: Gtk2Themes: return correct size value for checkbox and radiobutton

git-svn-id: trunk@43174 -
This commit is contained in:
zeljko 2013-10-08 13:03:12 +00:00
parent 3019dd8e23
commit 0a07967377

View File

@ -560,14 +560,23 @@ function TGtk2ThemeServices.GetDetailSize(Details: TThemedElementDetails): TSize
var
AValue: TGValue;
begin
if (Details.Element = teTreeView) and (Details.Part in [TVP_GLYPH, TVP_HOTGLYPH]) then
if (Details.Element = teTreeView) and (Byte(Details.Part) in [TVP_GLYPH, TVP_HOTGLYPH]) then
begin
FillChar(AValue{%H-}, SizeOf(AValue), 0);
g_value_init(@AValue, G_TYPE_INT);
gtk_widget_style_get_property(GetStyleWidget(lgsTreeView), 'expander-size', @AValue);
Result := Size(AValue.data[0].v_int, AValue.data[0].v_int);
end
else
end else
if (Details.Element = teButton) and (Byte(Details.Part) in [BP_CHECKBOX, BP_RADIOBUTTON]) then
begin
FillChar(AValue{%H-}, SizeOf(AValue), 0);
g_value_init(@AValue, G_TYPE_INT);
if Details.Part = BP_CHECKBOX then
gtk_widget_style_get_property(GetStyleWidget(lgsCheckbox),'indicator-size', @AValue)
else
gtk_widget_style_get_property(GetStyleWidget(lgsRadioButton),'indicator-size', @AValue);
Result := Size(AValue.data[0].v_int, AValue.data[0].v_int);
end else
Result := GetBaseDetailsSize(Details);
end;