Cocoa: Dark mode slightly improved

This commit is contained in:
rich2014 2023-07-19 19:20:16 +08:00
parent 1574149093
commit e069388a0e
2 changed files with 7 additions and 6 deletions

View File

@ -77,6 +77,7 @@ type
{$endif}
function appearance: NSAppearance; message 'appearance'; // 10.14 (10.13)
procedure setAppearance(newValue:NSAppearance); message 'setAppearance:'; // 10.14 (10.13)
function effectiveAppearance: NSAppearance; message 'effectiveAppearance'; // 10.14 (10.13)
end;

View File

@ -146,12 +146,6 @@ function NSEventRawKeyChar(ev: NSEvent): System.WideChar;
function AllocImageRotatedByDegrees(src: NSImage; degrees: double): NSImage;
function AllocCursorFromCursorByDegrees(src: NSCursor; degrees: double): NSCursor;
implementation
const
DarkName = 'NSAppearanceNameDarkAqua'; // used in 10.14
DarkNameVibrant = 'NSAppearanceNameVibrantDark'; // used in 10.13
var
NSSTR_DARK_NAME: NSString;
NSSTR_DARK_NAME_VIBRANT: NSString;
@ -160,6 +154,12 @@ var
NSSTR_LINE_SEPARATOR: NSString;
NSSTR_PARAGRAPH_SEPARATOR: NSString;
implementation
const
DarkName = 'NSAppearanceNameDarkAqua'; // used in 10.14
DarkNameVibrant = 'NSAppearanceNameVibrantDark'; // used in 10.13
procedure ApplicationWillShowModal;
begin
// Any place that would attempt to use Cocoa-native modality.