Revision: 14770
          http://sourceforge.net/p/skim-app/code/14770
Author:   hofman
Date:     2024-11-30 17:17:51 +0000 (Sat, 30 Nov 2024)
Log Message:
-----------
don't bother updating progress indicator when the status bar is not visible

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

Modified: trunk/SKMainWindowController.m
===================================================================
--- trunk/SKMainWindowController.m      2024-11-30 16:03:09 UTC (rev 14769)
+++ trunk/SKMainWindowController.m      2024-11-30 17:17:51 UTC (rev 14770)
@@ -1968,10 +1968,12 @@
     [leftSideController 
applySearchTableHeader:[NSLocalizedString(@"Searching", @"Message in search 
table header") stringByAppendingEllipsis]];
     [self setSearchResults:@[]];
     [self setGroupedSearchResults:@[]];
-    [statusBar setProgressIndicatorStyle:SKProgressIndicatorStyleDeterminate];
-    [[statusBar progressIndicator] setMaxValue:[[note object] pageCount]];
-    [[statusBar progressIndicator] setDoubleValue:0.0];
-    [[statusBar progressIndicator] startAnimation:self];
+    if ([statusBar isVisible]) {
+        [statusBar 
setProgressIndicatorStyle:SKProgressIndicatorStyleDeterminate];
+        [[statusBar progressIndicator] setMaxValue:[[note object] pageCount]];
+        [[statusBar progressIndicator] setDoubleValue:0.0];
+        [[statusBar progressIndicator] startAnimation:self];
+    }
     [self willChangeValueForKey:SEARCHRESULTS_KEY];
     [self willChangeValueForKey:GROUPEDSEARCHRESULTS_KEY];
 }
@@ -1987,13 +1989,16 @@
     [self didChangeValueForKey:GROUPEDSEARCHRESULTS_KEY];
     [self didChangeValueForKey:SEARCHRESULTS_KEY];
     mwcFlags.updatingFindResults = 0;
-    [[statusBar progressIndicator] stopAnimation:self];
-    [statusBar setProgressIndicatorStyle:SKProgressIndicatorStyleNone];
+    if ([statusBar progressIndicatorStyle] == 
SKProgressIndicatorStyleDeterminate) {
+        [[statusBar progressIndicator] stopAnimation:self];
+        [statusBar setProgressIndicatorStyle:SKProgressIndicatorStyleNone];
+    }
 }
 
 - (void)documentDidEndPageFind:(NSNotification *)note {
     NSNumber *pageIndex = [[note userInfo] 
objectForKey:@"PDFDocumentPageIndex"];
-    [[statusBar progressIndicator] setDoubleValue:[pageIndex doubleValue] + 
1.0];
+    if ([statusBar progressIndicatorStyle] == 
SKProgressIndicatorStyleDeterminate)
+        [[statusBar progressIndicator] setDoubleValue:[pageIndex doubleValue] 
+ 1.0];
     if ([pageIndex unsignedIntegerValue] % 50 == 0) {
         mwcFlags.updatingFindResults = 1;
         [self didChangeValueForKey:GROUPEDSEARCHRESULTS_KEY];

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