Revision: 15150
          http://sourceforge.net/p/skim-app/code/15150
Author:   hofman
Date:     2025-05-04 14:10:32 +0000 (Sun, 04 May 2025)
Log Message:
-----------
don't delay generating prerview image for grouped search result, they should 
never be visible in the UI before they are fully formed

Modified Paths:
--------------
    trunk/SKGroupedSearchResult.h
    trunk/SKGroupedSearchResult.m
    trunk/SKImageToolTipContext.h
    trunk/SKImageToolTipWindow.m
    trunk/SKMainWindowController.m

Modified: trunk/SKGroupedSearchResult.h
===================================================================
--- trunk/SKGroupedSearchResult.h       2025-05-04 09:38:18 UTC (rev 15149)
+++ trunk/SKGroupedSearchResult.h       2025-05-04 14:10:32 UTC (rev 15150)
@@ -47,7 +47,6 @@
     PDFPage *page;
     NSUInteger maxCount;
     NSMutableArray<PDFSelection *> *matches;
-    BOOL readyForToolTip;
 }
 
 @property (nonatomic, readonly) PDFPage *page;
@@ -56,7 +55,6 @@
 @property (nonatomic) NSUInteger maxCount;
 @property (weak, nonatomic, readonly) NSString *label;
 @property (nonatomic, readonly) NSArray<PDFSelection *> *matches;
-@property (nonatomic, getter=isReadyForToolTip) BOOL readyForToolTip;
 
 - (instancetype)initWithPage:(PDFPage *)aPage maxCount:(NSUInteger)aMaxCount;
 

Modified: trunk/SKGroupedSearchResult.m
===================================================================
--- trunk/SKGroupedSearchResult.m       2025-05-04 09:38:18 UTC (rev 15149)
+++ trunk/SKGroupedSearchResult.m       2025-05-04 14:10:32 UTC (rev 15150)
@@ -45,7 +45,7 @@
 
 @implementation SKGroupedSearchResult
 
-@synthesize page, maxCount, matches, readyForToolTip;
+@synthesize page, maxCount, matches;
 @dynamic pageIndex, count, label;
 
 + (NSSet *)keyPathsForValuesAffectingValueForKey:(NSString *)key {

Modified: trunk/SKImageToolTipContext.h
===================================================================
--- trunk/SKImageToolTipContext.h       2025-05-04 09:38:18 UTC (rev 15149)
+++ trunk/SKImageToolTipContext.h       2025-05-04 14:10:32 UTC (rev 15150)
@@ -44,8 +44,6 @@
 
 @protocol SKImageToolTipContext <NSObject>
 - (nullable NSImage *)toolTipImageWithScale:(CGFloat)scale;
-@optional
-@property (nonatomic, readonly, getter=isReadyForToolTip) BOOL readyForToolTip;
 @end
 
 

Modified: trunk/SKImageToolTipWindow.m
===================================================================
--- trunk/SKImageToolTipWindow.m        2025-05-04 09:38:18 UTC (rev 15149)
+++ trunk/SKImageToolTipWindow.m        2025-05-04 14:10:32 UTC (rev 15150)
@@ -174,11 +174,7 @@
         image = nil;
         shouldShow = NO;
         
-        dispatch_time_t delay = 0;
-        if ([aContext respondsToSelector:@selector(isReadyForToolTip)] && 
[aContext isReadyForToolTip] == NO)
-            delay = NSEC_PER_SEC / 10;
-        
-        dispatch_after(dispatch_time(DISPATCH_TIME_NOW, delay), [[self class] 
imageQueue], ^{
+        dispatch_async([[self class] imageQueue], ^{
             
             NSNumber *usedScaleNumber = [[NSUserDefaults standardUserDefaults] 
objectForKey:SKToolTipScaleKey];
             CGFloat usedScale = [usedScaleNumber 
respondsToSelector:@selector(doubleValue)] ? [usedScaleNumber doubleValue] : 
DEFAULT_SCALE;

Modified: trunk/SKMainWindowController.m
===================================================================
--- trunk/SKMainWindowController.m      2025-05-04 09:38:18 UTC (rev 15149)
+++ trunk/SKMainWindowController.m      2025-05-04 14:10:32 UTC (rev 15150)
@@ -2038,17 +2038,6 @@
 - (void)documentDidEndPageFind:(NSNotification *)note {
     NSUInteger pageIndex = [[[note userInfo] 
objectForKey:@"PDFDocumentPageIndex"] unsignedIntValue];
     
-    NSUInteger i = [groupedSearchResults count];
-    while (i-- > 0) {
-        SKGroupedSearchResult *result = [groupedSearchResults objectAtIndex:i];
-        NSUInteger aPageIndex = [result pageIndex];
-        if (pageIndex >= aPageIndex) {
-            if (pageIndex == aPageIndex)
-                [result setReadyForToolTip:YES];
-            break;
-        }
-    }
-    
     if ([statusBar progressIndicatorStyle] == 
SKProgressIndicatorStyleDeterminate)
         [[statusBar progressIndicator] setDoubleValue:pageIndex + 1.0];
     if (pageIndex > 0 && pageIndex % 50 == 0) {

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