mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-08 04:35:57 +02:00
Gtk2: Gtk2Themes: return correct size value for checkbox and radiobutton
git-svn-id: trunk@43174 -
This commit is contained in:
parent
3019dd8e23
commit
0a07967377
@ -560,14 +560,23 @@ function TGtk2ThemeServices.GetDetailSize(Details: TThemedElementDetails): TSize
|
|||||||
var
|
var
|
||||||
AValue: TGValue;
|
AValue: TGValue;
|
||||||
begin
|
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
|
begin
|
||||||
FillChar(AValue{%H-}, SizeOf(AValue), 0);
|
FillChar(AValue{%H-}, SizeOf(AValue), 0);
|
||||||
g_value_init(@AValue, G_TYPE_INT);
|
g_value_init(@AValue, G_TYPE_INT);
|
||||||
gtk_widget_style_get_property(GetStyleWidget(lgsTreeView), 'expander-size', @AValue);
|
gtk_widget_style_get_property(GetStyleWidget(lgsTreeView), 'expander-size', @AValue);
|
||||||
Result := Size(AValue.data[0].v_int, AValue.data[0].v_int);
|
Result := Size(AValue.data[0].v_int, AValue.data[0].v_int);
|
||||||
end
|
end else
|
||||||
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);
|
Result := GetBaseDetailsSize(Details);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user