FIX: Wrong background with gtk2 theme Gnome OSX-IV-1.3 (fixes #32)

This commit is contained in:
Alexander Koblov 2023-09-08 21:08:42 +03:00
commit 8d04bf014d

View file

@ -17,10 +17,7 @@ implementation
uses
Classes, SysUtils, Gtk2WSStdCtrls, Gtk2, Gtk2Def, Gtk2WSSpin, Gtk2Proc,
WSLCLClasses, StdCtrls, Glib2, Gtk2Globals, Spin, LMessages, LazUTF8, Gdk2,
Controls, ExtCtrls
{$if lcl_fullversion < 1090000}
, Gtk2WSExtCtrls, Graphics
{$endif}
Controls, ExtCtrls, WSExtCtrls, Gtk2WSExtCtrls, Graphics
;
type
@ -39,8 +36,6 @@ type
class procedure SetCallbacks(const AGtkWidget: PGtkWidget; const AWidgetInfo: PWidgetInfo); override;
end;
{$if lcl_fullversion < 1090000}
{ TGtk2WSCustomPanelEx }
TGtk2WSCustomPanelEx = class(TGtk2WSCustomPanel)
@ -48,8 +43,6 @@ type
class function GetDefaultColor(const AControl: TControl; const ADefaultColorType: TDefaultColorType): TColor; override;
end;
{$endif}
procedure gtkcuttoclip_ex(widget: PGtkWidget; {%H-}data: gPointer); cdecl;
var
Info: PWidgetInfo;
@ -177,23 +170,19 @@ begin
end;
end;
{$if lcl_fullversion < 1090000}
{ TGtk2WSCustomPanelEx }
class function TGtk2WSCustomPanelEx.GetDefaultColor(const AControl: TControl;
const ADefaultColorType: TDefaultColorType): TColor;
const
DefColors: array[TDefaultColorType] of TColor = (
{ dctBrush } clBackground,
{ dctBrush } clForm,
{ dctFont } clBtnText
);
begin
Result := DefColors[ADefaultColorType];
end;
{$endif}
{ TGtk2WSCustomEditEx }
class procedure TGtk2WSCustomEditEx.SetCallbacks(const AGtkWidget: PGtkWidget;
@ -245,11 +234,9 @@ begin
// Replace TCustomFloatSpinEdit widgetset class
with TCustomFloatSpinEdit.Create(nil) do Free;
RegisterWSComponent(TCustomFloatSpinEdit, TGtk2WSCustomFloatSpinEditEx);
{$if lcl_fullversion < 1090000}
// Replace TCustomPanel widgetset class
with TCustomPanel.Create(nil) do Free;
WSExtCtrls.RegisterCustomPanel;
RegisterWSComponent(TCustomPanel, TGtk2WSCustomPanelEx);
{$endif}
end;
initialization