summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorculler <culler>2020-08-13 16:36:47 (GMT)
committerculler <culler>2020-08-13 16:36:47 (GMT)
commitacf3c7b15812de591a890158d17e497bcd1a16a4 (patch)
tree46e31450522825959cba8be26f2478cbf088069c
parent34874a19507ce2fbd97192eec38717cddb43cbd5 (diff)
downloadtk-acf3c7b15812de591a890158d17e497bcd1a16a4.zip
tk-acf3c7b15812de591a890158d17e497bcd1a16a4.tar.gz
tk-acf3c7b15812de591a890158d17e497bcd1a16a4.tar.bz2
Use the TkMacOSXInDarkMode from bug-315104a5c10
-rw-r--r--macosx/tkMacOSXColor.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/macosx/tkMacOSXColor.c b/macosx/tkMacOSXColor.c
index 7b517e7..b5ca43f 100644
--- a/macosx/tkMacOSXColor.c
+++ b/macosx/tkMacOSXColor.c
@@ -418,23 +418,24 @@ SetCGColorComponents(
MODULE_SCOPE Bool
TkMacOSXInDarkMode(Tk_Window tkwin)
{
- int result = false;
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 101400
if (@available(macOS 10.14, *)) {
TkWindow *winPtr = (TkWindow*) tkwin;
+ NSAppearanceName name;
NSView *view = nil;
if (winPtr && winPtr->privatePtr) {
view = TkMacOSXDrawableView(winPtr->privatePtr);
}
if (view) {
- result = (view.effectiveAppearance == darkAqua);
+ name = [[view effectiveAppearance] name];
} else {
- result = ([NSAppearance currentAppearance] == darkAqua);
+ name = [[NSAppearance currentAppearance] name];
}
+ return (name == NSAppearanceNameDarkAqua);
}
#endif
- return result;
+ return false;
}
/*