summaryrefslogtreecommitdiffstats
path: root/macosx
diff options
context:
space:
mode:
authormarc_culler <marc.culler@gmail.com>2022-09-17 00:18:22 (GMT)
committermarc_culler <marc.culler@gmail.com>2022-09-17 00:18:22 (GMT)
commit49626ddf736caf1e892c3cfb9204b97b542b0500 (patch)
tree46f1415a7c5d59acba5de0db000611b27d12b4ce /macosx
parentf0641c960f92d80fd6f2c991fa923ce0a8857213 (diff)
downloadtk-49626ddf736caf1e892c3cfb9204b97b542b0500.zip
tk-49626ddf736caf1e892c3cfb9204b97b542b0500.tar.gz
tk-49626ddf736caf1e892c3cfb9204b97b542b0500.tar.bz2
Replace [NSApp currentAppearance] by [NSApp effectiveAppearance], now that I know it exists.
Diffstat (limited to 'macosx')
-rw-r--r--macosx/tkMacOSXColor.c23
-rw-r--r--macosx/tkMacOSXPrivate.h5
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