Revision: 14358
          http://sourceforge.net/p/skim-app/code/14358
Author:   hofman
Date:     2024-07-01 14:39:39 +0000 (Mon, 01 Jul 2024)
Log Message:
-----------
Don't set maxScaleFactor to 20 always, instead update min and max scale in the 
toolbar item

Modified Paths:
--------------
    trunk/SKBasePDFView.m
    trunk/SKMainToolbarController.h
    trunk/SKMainToolbarController.m
    trunk/SKMainWindowController.m

Modified: trunk/SKBasePDFView.m
===================================================================
--- trunk/SKBasePDFView.m       2024-07-01 09:17:46 UTC (rev 14357)
+++ trunk/SKBasePDFView.m       2024-07-01 14:39:39 UTC (rev 14358)
@@ -157,12 +157,6 @@
 
 #pragma mark Bug fixes
 
-// at least on macOS 122 setDocument: sets the maxScaleFactor to 100, so we 
reset it back
-- (void)setDocument:(PDFDocument *)document {
-    [super setDocument:document];
-    [self setMaxScaleFactor:20.0];
-}
-
 - (void)goToRect:(NSRect)rect onPage:(PDFPage *)page {
     if (@available(macOS 10.14, *)) {
         [super goToRect:rect onPage:page];

Modified: trunk/SKMainToolbarController.h
===================================================================
--- trunk/SKMainToolbarController.h     2024-07-01 09:17:46 UTC (rev 14357)
+++ trunk/SKMainToolbarController.h     2024-07-01 14:39:39 UTC (rev 14358)
@@ -107,6 +107,8 @@
 - (void)handleChangedHistoryNotification:(nullable NSNotification 
*)notification;
 - (void)handlePageChangedNotification:(nullable NSNotification *)notification;
 
+- (void)updateMinMaxScale;
+
 #pragma mark Actions
 
 - (IBAction)goToPreviousNextFirstLastPage:(nullable id)sender;

Modified: trunk/SKMainToolbarController.m
===================================================================
--- trunk/SKMainToolbarController.m     2024-07-01 09:17:46 UTC (rev 14357)
+++ trunk/SKMainToolbarController.m     2024-07-01 14:39:39 UTC (rev 14358)
@@ -289,8 +289,7 @@
             [item setView:scaleField];
             [item setMenuFormRepresentation:menuItem];
             
-            [(NSNumberFormatter *)[scaleField formatter] setMinimum:[NSNumber 
numberWithDouble:[mainController.pdfView minScaleFactor]]];
-            [(NSNumberFormatter *)[scaleField formatter] setMaximum:[NSNumber 
numberWithDouble:[mainController.pdfView maxScaleFactor]]];
+            [self updateMinMaxScale];
             
         } else if ([identifier 
isEqualToString:SKDocumentToolbarZoomActualItemIdentifier]) {
             
@@ -1065,6 +1064,11 @@
     }
 }
 
+- (void)updateMinMaxScale {
+    [(NSNumberFormatter *)[scaleField formatter] setMinimum:[NSNumber 
numberWithDouble:[mainController.pdfView minScaleFactor]]];
+    [(NSNumberFormatter *)[scaleField formatter] setMaximum:[NSNumber 
numberWithDouble:[mainController.pdfView maxScaleFactor]]];
+}
+
 - (IBAction)goToPreviousNextFirstLastPage:(id)sender {
     NSInteger tag = [sender selectedTag];
     if (tag == -1)

Modified: trunk/SKMainWindowController.m
===================================================================
--- trunk/SKMainWindowController.m      2024-07-01 09:17:46 UTC (rev 14357)
+++ trunk/SKMainWindowController.m      2024-07-01 14:39:39 UTC (rev 14358)
@@ -1120,6 +1120,8 @@
 
     [self registerForDocumentNotifications];
     
+    [toolbarController updateMinMaxScale];
+    
     if ([pdfDocument isLocked]) {
         placeholderWidgetProperties = [widgetProperties count] ? 
[widgetProperties copy] : nil;
     } else {

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