Revision: 14384
          http://sourceforge.net/p/skim-app/code/14384
Author:   hofman
Date:     2024-07-17 16:19:45 +0000 (Wed, 17 Jul 2024)
Log Message:
-----------
check for appearance customization once

Modified Paths:
--------------
    trunk/NSGraphics_SKExtensions.m

Modified: trunk/NSGraphics_SKExtensions.m
===================================================================
--- trunk/NSGraphics_SKExtensions.m     2024-07-17 16:14:20 UTC (rev 14383)
+++ trunk/NSGraphics_SKExtensions.m     2024-07-17 16:19:45 UTC (rev 14384)
@@ -62,20 +62,15 @@
 }
 
 void SKRunWithAppearance(id object, void (^code)(void)) {
-    if (@available(macOS 11.0, *)) {
-        if ([object respondsToSelector:@selector(effectiveAppearance)])
-            [[(id<NSAppearanceCustomization>)object effectiveAppearance] 
performAsCurrentDrawingAppearance:code];
-        else
-            code();
+    if ([object respondsToSelector:@selector(effectiveAppearance)] == NO) {
+        code();
+    } else if (@available(macOS 11.0, *)) {
+        [[(id<NSAppearanceCustomization>)object effectiveAppearance] 
performAsCurrentDrawingAppearance:code];
     } else if (@available(macOS 10.14, *)) {
-        NSAppearance *appearance = nil;
-        if ([object respondsToSelector:@selector(effectiveAppearance)]) {
-            appearance = [NSAppearance currentAppearance];
-            [NSAppearance 
setCurrentAppearance:[(id<NSAppearanceCustomization>)object 
effectiveAppearance]];
-        }
+        NSAppearance *appearance = [NSAppearance currentAppearance];
+        [NSAppearance 
setCurrentAppearance:[(id<NSAppearanceCustomization>)object 
effectiveAppearance]];
         code();
-        if ([object respondsToSelector:@selector(effectiveAppearance)])
-            [NSAppearance setCurrentAppearance:appearance];
+        [NSAppearance setCurrentAppearance:appearance];
     } else {
         code();
     }

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.



_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to