Revision: 13998
          http://sourceforge.net/p/skim-app/code/13998
Author:   hofman
Date:     2023-12-27 09:43:00 +0000 (Wed, 27 Dec 2023)
Log Message:
-----------
use modern NSBackgroundStyle enum values

Modified Paths:
--------------
    trunk/SKCompatibility.h
    trunk/SKLevelIndicatorCell.m
    trunk/SKMainWindowController.m
    trunk/SKNavigationWindow.m
    trunk/SKThumbnailView.m

Modified: trunk/SKCompatibility.h
===================================================================
--- trunk/SKCompatibility.h     2023-12-27 00:08:22 UTC (rev 13997)
+++ trunk/SKCompatibility.h     2023-12-27 09:43:00 UTC (rev 13998)
@@ -65,6 +65,9 @@
 
 #define NSAppearanceNameDarkAqua @"NSAppearanceNameDarkAqua"
 
+#define NSBackgroundStyleNormal NSBackgroundStyleLight
+#define NSBackgroundStyleEmphasized NSBackgroundStyleDark
+
 #endif
 
 #if SDK_BEFORE_11_0

Modified: trunk/SKLevelIndicatorCell.m
===================================================================
--- trunk/SKLevelIndicatorCell.m        2023-12-27 00:08:22 UTC (rev 13997)
+++ trunk/SKLevelIndicatorCell.m        2023-12-27 09:43:00 UTC (rev 13998)
@@ -96,7 +96,7 @@
 - (void)setBackgroundStyle:(NSBackgroundStyle)backgroundStyle {
     if (@available(macOS 10.14, *)) {
         if ([self levelIndicatorStyle] == NSLevelIndicatorStyleRelevancy && 
[[self controlView] isKindOfClass:[NSLevelIndicator class]]) {
-            if (backgroundStyle == NSBackgroundStyleDark)
+            if (backgroundStyle == NSBackgroundStyleEmphasized)
                 [[self controlView] setAppearance:[NSAppearance 
appearanceNamed:NSAppearanceNameDarkAqua]];
             else
                 [[self controlView] setAppearance:nil];

Modified: trunk/SKMainWindowController.m
===================================================================
--- trunk/SKMainWindowController.m      2023-12-27 00:08:22 UTC (rev 13997)
+++ trunk/SKMainWindowController.m      2023-12-27 09:43:00 UTC (rev 13998)
@@ -1567,7 +1567,7 @@
         }
     } else {
         [(NSVisualEffectView *)[overviewView backgroundView] 
setMaterial:isPresentation ? NSVisualEffectMaterialDark : 
NSVisualEffectMaterialSidebar];
-        [[overviewView visibleItems] setValue:[NSNumber 
numberWithInteger:isPresentation ? NSBackgroundStyleDark : 
NSBackgroundStyleLight] forKey:@"backgroundStyle"];
+        [[overviewView visibleItems] setValue:[NSNumber 
numberWithInteger:isPresentation ? NSBackgroundStyleEmphasized : 
NSBackgroundStyleLight] forKey:@"backgroundStyle"];
     }
     [overviewView setSingleClickAction:isPresentation ? 
@selector(hideOverview:) : NULL];
     
@@ -1667,7 +1667,7 @@
     if (markedPageIndex == i)
         [item setMarked:YES];
     if (@available(macOS 10.14, *)) {} else
-        [item setBackgroundStyle:[self interactionMode] == SKPresentationMode 
? NSBackgroundStyleDark : NSBackgroundStyleLight];
+        [item setBackgroundStyle:[self interactionMode] == SKPresentationMode 
? NSBackgroundStyleEmphasized : NSBackgroundStyleLight];
     return item;
 }
 

Modified: trunk/SKNavigationWindow.m
===================================================================
--- trunk/SKNavigationWindow.m  2023-12-27 00:08:22 UTC (rev 13997)
+++ trunk/SKNavigationWindow.m  2023-12-27 09:43:00 UTC (rev 13998)
@@ -274,7 +274,7 @@
         [styleButton setTarget:pdfView];
         [styleButton setAction:@selector(changeCursorStyle:)];
         if (@available(macOS 10.14, *))
-            [[styleButton cell] setBackgroundStyle:NSBackgroundStyleDark];
+            [[styleButton cell] 
setBackgroundStyle:NSBackgroundStyleEmphasized];
         NSArray *segments = [NSAccessibilityUnignoredDescendant(styleButton) 
accessibilityChildren];
         [[segments objectAtIndex:0] 
setAccessibilityLabel:NSLocalizedString(@"arrow", @"Accessibility 
description")];
         [[segments objectAtIndex:1] 
setAccessibilityLabel:NSLocalizedString(@"red", @"Accessibility description")];
@@ -296,7 +296,7 @@
         [removeShadowButton setTarget:pdfView];
         [removeShadowButton setAction:@selector(toggleRemoveCursorShadow:)];
         if (@available(macOS 10.14, *))
-            [[removeShadowButton cell] 
setBackgroundStyle:NSBackgroundStyleDark];
+            [[removeShadowButton cell] 
setBackgroundStyle:NSBackgroundStyleEmphasized];
         [removeShadowButton setWidth:ceil([[removeShadowButton 
labelForSegment:0] sizeWithAttributes:@{NSFontAttributeName:[removeShadowButton 
font]}].width) + 8.0 forSegment:0];
         [removeShadowButton sizeToFit];
         rect.size.width = NSWidth([removeShadowButton frame]);
@@ -317,7 +317,7 @@
         [drawButton setTarget:pdfView];
         [drawButton setAction:@selector(toggleDrawInPresentation:)];
         if (@available(macOS 10.14, *))
-            [[drawButton cell] setBackgroundStyle:NSBackgroundStyleDark];
+            [[drawButton cell] setBackgroundStyle:NSBackgroundStyleEmphasized];
         [[[NSAccessibilityUnignoredDescendant(drawButton) 
accessibilityChildren] firstObject] setAccessibilityLabel:[SKNInkString 
typeName]];
         [drawButton sizeToFit];
         rect.size.width = NSWidth([drawButton frame]);
@@ -341,7 +341,7 @@
         [closeButton setTarget:pdfView];
         [closeButton setAction:@selector(closeCursorStyleWindow:)];
         if (@available(macOS 10.14, *))
-            [[closeButton cell] setBackgroundStyle:NSBackgroundStyleDark];
+            [[closeButton cell] 
setBackgroundStyle:NSBackgroundStyleEmphasized];
         [[[NSAccessibilityUnignoredDescendant(closeButton) 
accessibilityChildren] firstObject] 
setAccessibilityLabel:NSLocalizedString(@"close", @"Accessibility 
description")];
         [closeButton sizeToFit];
         [[self contentView] addSubview:closeButton];

Modified: trunk/SKThumbnailView.m
===================================================================
--- trunk/SKThumbnailView.m     2023-12-27 00:08:22 UTC (rev 13997)
+++ trunk/SKThumbnailView.m     2023-12-27 09:43:00 UTC (rev 13998)
@@ -136,7 +136,7 @@
 - (void)updateBackgroundStyle {
     NSBackgroundStyle style = [self backgroundStyle];
     if ([self isSelected] && [[self window] isKeyWindow])
-        style = NSBackgroundStyleDark;
+        style = NSBackgroundStyleEmphasized;
     if ([[labelView cell] backgroundStyle] != style) {
         [[labelView cell] setBackgroundStyle:style];
         [labelView setNeedsDisplay:YES];
@@ -322,7 +322,7 @@
             [NSGraphicsContext saveGraphicsState];
             if ([self isMenuHighlighted])
                 [[NSColor alternateSelectedControlColor] setFill];
-            else if ([self backgroundStyle] == NSBackgroundStyleDark)
+            else if ([self backgroundStyle] == NSBackgroundStyleEmphasized)
                 [[NSColor darkGrayColor] setFill];
             else
                 [[NSColor secondarySelectedControlColor] setFill];
@@ -339,7 +339,7 @@
             NSColor *color;
             if ([[self window] isKeyWindow])
                 color = [NSColor alternateSelectedControlColor];
-            else if ([self backgroundStyle] == NSBackgroundStyleDark)
+            else if ([self backgroundStyle] == NSBackgroundStyleEmphasized)
                 color = [NSColor darkGrayColor];
             else
                 color = [NSColor secondarySelectedControlColor];

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