mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-18 03:19:17 +02:00
cocoa: proper detection of the dark theme. patch by Zoë Peterson. bug #37617
git-svn-id: trunk@63818 -
This commit is contained in:
parent
f89f1c10b4
commit
f0b7aadfd8
@ -147,12 +147,12 @@ begin
|
|||||||
Result := false;
|
Result := false;
|
||||||
Exit;
|
Exit;
|
||||||
end;
|
end;
|
||||||
if (not NSApplication(NSApp).respondsToSelector(ObjCSelector('appearance'))) then begin
|
if (not NSApplication(NSApp).respondsToSelector(ObjCSelector('effectiveAppearance'))) then begin
|
||||||
Result := false;
|
Result := false;
|
||||||
Exit;
|
Exit;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Result := IsAppearDark(NSApplication(NSApp).appearance);
|
Result := IsAppearDark(NSApplication(NSApp).effectiveAppearance);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function IsWinDark(win: NSWindow): Boolean;
|
function IsWinDark(win: NSWindow): Boolean;
|
||||||
@ -162,12 +162,12 @@ begin
|
|||||||
Result := false;
|
Result := false;
|
||||||
Exit;
|
Exit;
|
||||||
end;
|
end;
|
||||||
if (not NSApplication(win).respondsToSelector(ObjCSelector('appearance'))) then begin
|
if (not NSApplication(win).respondsToSelector(ObjCSelector('effectiveAppearance'))) then begin
|
||||||
Result := false;
|
Result := false;
|
||||||
Exit;
|
Exit;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Result := IsAppearDark(win.appearance);
|
Result := IsAppearDark(win.effectiveAppearance);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function IsPaintDark: Boolean;
|
function IsPaintDark: Boolean;
|
||||||
|
Loading…
Reference in New Issue
Block a user