Revision: 16446
          http://sourceforge.net/p/skim-app/code/16446
Author:   hofman
Date:     2026-09-10 16:54:22 +0000 (Thu, 10 Sep 2026)
Log Message:
-----------
convenience method to set the pdfview background color

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

Modified: trunk/SKMainWindowController.m
===================================================================
--- trunk/SKMainWindowController.m      2026-09-10 16:45:37 UTC (rev 16445)
+++ trunk/SKMainWindowController.m      2026-09-10 16:54:22 UTC (rev 16446)
@@ -933,6 +933,18 @@
     [self updatePageColumnWidthForTableViews:[[leftSideController tableViews] 
arrayByAddingObjectsFromArray:[rightSideController tableViews]]];
 }
 
+- (void)updatebackgroundColor {
+    NSColor *backgroundColor = nil;
+    if (interactionMode == SKNormalMode)
+        backgroundColor = [PDFView defaultBackgroundColor];
+    else if (interactionMode == SKFullScreenMode)
+        backgroundColor = [PDFView defaultFullScreenBackgroundColor];
+    if (backgroundColor) {
+        [pdfView setBackgroundColor:backgroundColor];
+        [secondaryPdfView setBackgroundColor:backgroundColor];
+    }
+}
+
 #pragma mark Notes and Widgets
 
 - (void)registerWidgets:(NSArray *)array {
@@ -2656,23 +2668,10 @@
         
         // A default value that we are observing has changed
         if ([keyPath isEqualToString:SKBackgroundColorKey] || [keyPath 
isEqualToString:SKDarkBackgroundColorKey]) {
-            NSColor *backgroundColor = nil;
-            if (interactionMode == SKNormalMode)
-                backgroundColor = [PDFView defaultBackgroundColor];
-            else if (interactionMode == SKFullScreenMode)
-                backgroundColor = [PDFView defaultFullScreenBackgroundColor];
-            if (backgroundColor) {
-                [pdfView setBackgroundColor:backgroundColor];
-                [secondaryPdfView setBackgroundColor:backgroundColor];
-            }
+            [self updatebackgroundColor];
         } else if ([keyPath isEqualToString:SKFullScreenBackgroundColorKey] || 
[keyPath isEqualToString:SKDarkFullScreenBackgroundColorKey]) {
-            if ([self interactionMode] == SKFullScreenMode) {
-                NSColor *backgroundColor = [PDFView 
defaultFullScreenBackgroundColor];
-                if (backgroundColor) {
-                    [pdfView setBackgroundColor:backgroundColor];
-                    [secondaryPdfView setBackgroundColor:backgroundColor];
-                }
-            }
+            if ([self interactionMode] == SKFullScreenMode)
+                [self updatebackgroundColor];
         } else if ([keyPath isEqualToString:SKThumbnailSizeKey]) {
             [self resetThumbnailSizeIfNeeded];
             [leftSideController.thumbnailTableView noteHeightOfRowsChanged];
@@ -2694,15 +2693,7 @@
         
     } else if (context == &SKMainWindowAppObservationContext) {
         
-        NSColor *backgroundColor = nil;
-        if (interactionMode == SKNormalMode)
-            backgroundColor = [PDFView defaultBackgroundColor];
-        else if (interactionMode == SKFullScreenMode)
-            backgroundColor = [PDFView defaultFullScreenBackgroundColor];
-        if (backgroundColor) {
-            [pdfView setBackgroundColor:backgroundColor];
-            [secondaryPdfView setBackgroundColor:backgroundColor];
-        }
+        [self updatebackgroundColor];
         
     } else if (context == &SKMainWindowContentLayoutObservationContext) {
         

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