Revision: 11092
          http://sourceforge.net/p/skim-app/code/11092
Author:   hofman
Date:     2019-12-03 10:03:00 +0000 (Tue, 03 Dec 2019)
Log Message:
-----------
No need to set appearance matching other object's

Modified Paths:
--------------
    trunk/NSGraphics_SKExtensions.h
    trunk/NSGraphics_SKExtensions.m
    trunk/SKPDFView.m
    trunk/SKSecondaryPDFView.m
    trunk/SKSnapshotPDFView.m

Modified: trunk/NSGraphics_SKExtensions.h
===================================================================
--- trunk/NSGraphics_SKExtensions.h     2019-12-02 22:08:52 UTC (rev 11091)
+++ trunk/NSGraphics_SKExtensions.h     2019-12-03 10:03:00 UTC (rev 11092)
@@ -41,7 +41,7 @@
 extern BOOL SKHasDarkAppearance(id object);
 extern void SKSetHasDarkAppearance(id object);
 extern void SKSetHasLightAppearance(id object);
-extern void SKSetMatchingAppearance(id object, id fromObject);
+extern void SKSetHasDefaultAppearance(id object);
 
 extern void SKRunWithAppearance(id object, void (^code)(void));
 void SKRunWithLightAppearance(void (^code)(void));

Modified: trunk/NSGraphics_SKExtensions.m
===================================================================
--- trunk/NSGraphics_SKExtensions.m     2019-12-02 22:08:52 UTC (rev 11091)
+++ trunk/NSGraphics_SKExtensions.m     2019-12-03 10:03:00 UTC (rev 11092)
@@ -94,9 +94,9 @@
         [(id<NSAppearanceCustomization>)object setAppearance:[NSAppearance 
appearanceNamed:@"NSAppearanceNameAqua"]];
 }
 
-void SKSetMatchingAppearance(id object, id fromObject) {
-    if (RUNNING_AFTER(10_13) && [object 
respondsToSelector:@selector(setAppearance:)] && (object == nil || [object 
respondsToSelector:@selector(appearance)]))
-        [(id<NSAppearanceCustomization>)object 
setAppearance:[(id<NSAppearanceCustomization>)fromObject appearance]];
+void SKSetHasDefaultAppearance(id object) {
+    if (RUNNING_AFTER(10_13) && [object 
respondsToSelector:@selector(setAppearance:)])
+        [(id<NSAppearanceCustomization>)object setAppearance:nil];
 }
 
 void SKRunWithAppearance(id object, void (^code)(void)) {

Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m   2019-12-02 22:08:52 UTC (rev 11091)
+++ trunk/SKPDFView.m   2019-12-03 10:03:00 UTC (rev 11092)
@@ -2580,7 +2580,7 @@
 
 - (void)handleScrollerStyleChangedNotification:(NSNotification *)notification {
     if ([NSScroller preferredScrollerStyle] == NSScrollerStyleLegacy)
-        SKSetMatchingAppearance(self, nil);
+        SKSetHasDefaultAppearance(self);
     else
         SKSetHasLightAppearance(self);
 }

Modified: trunk/SKSecondaryPDFView.m
===================================================================
--- trunk/SKSecondaryPDFView.m  2019-12-02 22:08:52 UTC (rev 11091)
+++ trunk/SKSecondaryPDFView.m  2019-12-03 10:03:00 UTC (rev 11092)
@@ -100,7 +100,7 @@
     synchronizeZoom = NO;
     selectsText = [[NSUserDefaults standardUserDefaults] 
boolForKey:SKLastSecondarySelectsTextKey];
     
-    SKSetMatchingAppearance(self, nil);
+    SKSetHasDefaultAppearance(self);
     [self handleScrollerStyleChangedNotification:nil];
     
     [[NSNotificationCenter defaultCenter] addObserver:self 
selector:@selector(handleScrollerStyleChangedNotification:)
@@ -780,7 +780,7 @@
 
 - (void)handleScrollerStyleChangedNotification:(NSNotification *)notification {
     if ([NSScroller preferredScrollerStyle] == NSScrollerStyleLegacy)
-        SKSetMatchingAppearance([self scrollView], nil);
+        SKSetHasDefaultAppearance([self scrollView]);
     else
         SKSetHasLightAppearance([self scrollView]);
 }

Modified: trunk/SKSnapshotPDFView.m
===================================================================
--- trunk/SKSnapshotPDFView.m   2019-12-02 22:08:52 UTC (rev 11091)
+++ trunk/SKSnapshotPDFView.m   2019-12-03 10:03:00 UTC (rev 11092)
@@ -99,7 +99,7 @@
     autoFitRect = NSZeroRect;
     minHistoryIndex = 0;
     
-    SKSetMatchingAppearance(self, nil);
+    SKSetHasDefaultAppearance(self);
     [self handleScrollerStyleChangedNotification:nil];
     
     [[NSNotificationCenter defaultCenter] addObserver:self 
selector:@selector(handleScrollerStyleChangedNotification:)
@@ -288,7 +288,7 @@
 
 - (void)handleScrollerStyleChangedNotification:(NSNotification *)notification {
     if ([NSScroller preferredScrollerStyle] == NSScrollerStyleLegacy)
-        SKSetMatchingAppearance([self scrollView], nil);
+        SKSetHasDefaultAppearance([self scrollView]);
     else
         SKSetHasLightAppearance([self scrollView]);
 }

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



_______________________________________________
Skim-app-commit mailing list
Skim-app-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to