diff options
Diffstat (limited to 'macosx')
-rw-r--r-- | macosx/tkMacOSXColor.c | 23 | ||||
-rw-r--r-- | macosx/tkMacOSXPrivate.h | 5 |
2 files changed, 3 insertions, 25 deletions
diff --git a/macosx/tkMacOSXColor.c b/macosx/tkMacOSXColor.c index 7fbcff2..39e443e 100644 --- a/macosx/tkMacOSXColor.c +++ b/macosx/tkMacOSXColor.c @@ -30,25 +30,8 @@ static SystemColorDatum **systemColorIndex; #if MAC_OS_X_VERSION_MAX_ALLOWED >= 101400 static NSAppearance *lightAqua = nil; static NSAppearance *darkAqua = nil; - -#pragma mark TKApplication(TKColor) -@implementation TKApplication(TKColor) -- (NSAppearance *) currentAppearance -{ - if(@available(macOS 11.0, *)) { - return [NSAppearance currentDrawingAppearance]; - } else { -#if MAC_OS_X_VERSION_MIN_REQUIRED < 110000 - return [NSAppearance currentAppearance]; -#else - return nil; /* never reached */ #endif - } -} -@end -#pragma mark - -#endif static NSColorSpace* sRGB = NULL; static const CGFloat WINDOWBACKGROUND[4] = {236.0 / 255, 236.0 / 255, 236.0 / 255, 1.0}; @@ -475,7 +458,7 @@ TkMacOSXInDarkMode(Tk_Window tkwin) if (view) { name = [[view effectiveAppearance] name]; } else { - name = [[NSApp currentAppearance] name]; + name = [[NSApp effectiveAppearance] name]; } return (name == NSAppearanceNameDarkAqua); } @@ -683,7 +666,7 @@ TkpGetColor( if (view) { windowAppearance = [view effectiveAppearance]; } else { - windowAppearance = [NSApp currentAppearance]; + windowAppearance = [NSApp effectiveAppearance]; } if ([windowAppearance name] == NSAppearanceNameDarkAqua) { colormap = darkColormap; @@ -697,7 +680,7 @@ TkpGetColor( }]; } else { #if MAC_OS_X_VERSION_MIN_REQUIRED < 110000 - NSAppearance *savedAppearance = [NSApp currentAppearance]; + NSAppearance *savedAppearance = [NSAppearance currentAppearance]; [NSAppearance setCurrentAppearance:windowAppearance]; GetRGBA(entry, p.ulong, rgba); [NSAppearance setCurrentAppearance:savedAppearance]; diff --git a/macosx/tkMacOSXPrivate.h b/macosx/tkMacOSXPrivate.h index 67947c8..62523b8 100644 --- a/macosx/tkMacOSXPrivate.h +++ b/macosx/tkMacOSXPrivate.h @@ -368,11 +368,6 @@ VISIBILITY_HIDDEN - (void)_lockAutoreleasePool; - (void)_unlockAutoreleasePool; @end -#if MAC_OS_X_VERSION_MAX_ALLOWED >= 101400 -@interface TKApplication(TKColor) -- (NSAppearance *) currentAppearance; -@end -#endif @interface TKApplication(TKKeyboard) - (void) keyboardChanged: (NSNotification *) notification; @end |