summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXColor.c
diff options
context:
space:
mode:
authorculler <culler>2020-08-15 10:22:15 (GMT)
committerculler <culler>2020-08-15 10:22:15 (GMT)
commit8b6c8e84302179205f43165ff8e1ce15d2c8860a (patch)
tree6d81361052d6f4aa86a2c6bfd3d0163c68121b95 /macosx/tkMacOSXColor.c
parent8ac846412241e0914a4bb279bf586c53835e34ab (diff)
downloadtk-8b6c8e84302179205f43165ff8e1ce15d2c8860a.zip
tk-8b6c8e84302179205f43165ff8e1ce15d2c8860a.tar.gz
tk-8b6c8e84302179205f43165ff8e1ce15d2c8860a.tar.bz2
sync with bug-315104a5c10
Diffstat (limited to 'macosx/tkMacOSXColor.c')
-rw-r--r--macosx/tkMacOSXColor.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/macosx/tkMacOSXColor.c b/macosx/tkMacOSXColor.c
index fe0cc2a..974978f 100644
--- a/macosx/tkMacOSXColor.c
+++ b/macosx/tkMacOSXColor.c
@@ -378,23 +378,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;
}
/*