mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-27 00:09:19 +02:00
gtk2: implement TGtk2ThemeServices.GetOption
git-svn-id: trunk@20190 -
This commit is contained in:
parent
69dc8a2328
commit
ba4df81b22
@ -7790,8 +7790,11 @@ begin
|
||||
lgs:=lgsMenuitem;
|
||||
{$IFDEF Gtk1}
|
||||
AddToStyleWindow:=false;
|
||||
{$ENDIF}
|
||||
StyleObject^.Widget := gtk_menu_item_new;
|
||||
{$ELSE}
|
||||
// image menu item is needed to correctly return theme options
|
||||
StyleObject^.Widget := gtk_image_menu_item_new;
|
||||
{$ENDIF}
|
||||
end
|
||||
else
|
||||
If CompareText(WName,LazGtkStyleNames[lgsStatusBar])=0 then begin
|
||||
|
@ -23,6 +23,7 @@ type
|
||||
public
|
||||
function GetDetailSize(Details: TThemedElementDetails): Integer; override;
|
||||
function GetStockImage(StockID: LongInt; out Image, Mask: HBitmap): Boolean; override;
|
||||
function GetOption(AOption: TThemeOption): Integer; override;
|
||||
end;
|
||||
|
||||
implementation
|
||||
@ -212,5 +213,23 @@ begin
|
||||
Result := True;
|
||||
end;
|
||||
|
||||
function TGtk2ThemeServices.GetOption(AOption: TThemeOption): Integer;
|
||||
var
|
||||
ASettings: PGtkSettings;
|
||||
BoolSetting: gboolean;
|
||||
begin
|
||||
case AOPtion of
|
||||
toShowMenuImages:
|
||||
begin
|
||||
ASettings := gtk_widget_get_settings(GetStyleWidget(lgsMenuitem));
|
||||
BoolSetting := False; // default
|
||||
g_object_get(ASettings, 'gtk-menu-images', @BoolSetting, nil);
|
||||
Result := Ord(BoolSetting = True);
|
||||
end;
|
||||
else
|
||||
Result := inherited GetOption(AOption);
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user