summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorculler <culler>2024-06-23 21:55:38 (GMT)
committerculler <culler>2024-06-23 21:55:38 (GMT)
commit134d97fa9a856b82572d2eace06f84e69b04ef81 (patch)
tree44e6fdf58b1bbfa9a884b9fa42dc04518589b5e1
parentc6c6608c7820a8d76be8769ea476ad29f2eb1760 (diff)
downloadtk-134d97fa9a856b82572d2eace06f84e69b04ef81.zip
tk-134d97fa9a856b82572d2eace06f84e69b04ef81.tar.gz
tk-134d97fa9a856b82572d2eace06f84e69b04ef81.tar.bz2
Revert tkMacOSXColor.c. We'll live with the warnings for now.
-rw-r--r--macosx/tkMacOSXColor.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/macosx/tkMacOSXColor.c b/macosx/tkMacOSXColor.c
index 540d01b..cd42be8 100644
--- a/macosx/tkMacOSXColor.c
+++ b/macosx/tkMacOSXColor.c
@@ -655,13 +655,13 @@ TkpGetColor(
CGFloat rgba[4];
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 101400
if (@available(macOS 10.14, *)) {
- NSAppearance *appearance;
+ NSAppearance *windowAppearance;
if (view) {
- appearance = [view effectiveAppearance];
+ windowAppearance = [view effectiveAppearance];
} else {
- appearance = [NSApp effectiveAppearance];
+ windowAppearance = [NSApp effectiveAppearance];
}
- if ([appearance name] == NSAppearanceNameDarkAqua) {
+ if ([windowAppearance name] == NSAppearanceNameDarkAqua) {
colormap = darkColormap;
} else {
colormap = lightColormap;
@@ -669,17 +669,13 @@ TkpGetColor(
if (@available(macOS 11.0, *)) {
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 110000
CGFloat *rgbaPtr = rgba;
- [appearance performAsCurrentDrawingAppearance:^{
+ [windowAppearance performAsCurrentDrawingAppearance:^{
GetRGBA(entry, p.ulong, rgbaPtr);
}];
#endif
} else {
#if MAC_OS_X_VERSION_MIN_REQUIRED < 110000
- if (@available(macOS 11.0, *)) {
- NSAppearance *savedAppearance = [NSAppearance currentDrawingAppearance];
- } else {
- NSAppearance *savedAppearance = [NSAppearance currentAppearance];
- }
+ NSAppearance *savedAppearance = [NSAppearance currentAppearance];
[NSAppearance setCurrentAppearance:windowAppearance];
GetRGBA(entry, p.ulong, rgba);
[NSAppearance setCurrentAppearance:savedAppearance];