Revision: 14309
          http://sourceforge.net/p/skim-app/code/14309
Author:   hofman
Date:     2024-06-06 16:22:13 +0000 (Thu, 06 Jun 2024)
Log Message:
-----------
don't add stamp to placeholder thumbnail if not locked, it will hardly be 
visible

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

Modified: trunk/SKMainWindowController.m
===================================================================
--- trunk/SKMainWindowController.m      2024-06-06 15:55:50 UTC (rev 14308)
+++ trunk/SKMainWindowController.m      2024-06-06 16:22:13 UTC (rev 14309)
@@ -2865,25 +2865,27 @@
         size = NSMakeSize(size.height, size.width);
     CGFloat width = ceil(0.8 * fmin(size.width, size.height));
     NSRect rect = NSMakeRect(0.5 * (size.width - width), 0.5 * (size.height - 
width), width, width);
-    NSMutableArray *stamps = [NSMutableArray array];
-    NSString *type = [[self document] fileType];
-    if ([type isEqualToString:SKPostScriptDocumentType])
-        type = @"PS";
-    else if ([type isEqualToString:SKEncapsulatedPostScriptDocumentType])
-        type = @"EPS";
-    else if ([type isEqualToString:SKDVIDocumentType])
-        type = @"DVI";
-    else if ([type isEqualToString:SKXDVDocumentType])
-        type = @"XDV";
-    else
-        type = @"PDF";
-
+    NSArray *stamps = nil;
+    
     page = [[PDFPage alloc] init];
     [page setBounds:(NSRect){NSZeroPoint, size} forBox:kPDFDisplayBoxMediaBox];
     
-    [stamps addObject:[[SKThumbnailStamp alloc] initWithImage:[NSImage 
stampForType:type] rect:rect fraction:1.0]];
-    if ([[pdfView document] isLocked])
-        [stamps addObject:[[SKThumbnailStamp alloc] 
initWithImage:[[NSWorkspace sharedWorkspace] 
iconForFileType:NSFileTypeForHFSTypeCode(kLockedBadgeIcon)] rect:rect 
fraction:0.5]];
+    if ([[pdfView document] isLocked]) {
+        NSString *type = [[self document] fileType];
+        if ([type isEqualToString:SKPostScriptDocumentType])
+            type = @"PS";
+        else if ([type isEqualToString:SKEncapsulatedPostScriptDocumentType])
+            type = @"EPS";
+        else if ([type isEqualToString:SKDVIDocumentType])
+            type = @"DVI";
+        else if ([type isEqualToString:SKXDVDocumentType])
+            type = @"XDV";
+        else
+            type = @"PDF";
+
+        stamps = @[[[SKThumbnailStamp alloc] initWithImage:[NSImage 
stampForType:type] rect:rect fraction:1.0],
+            [[SKThumbnailStamp alloc] initWithImage:[[NSWorkspace 
sharedWorkspace] iconForFileType:NSFileTypeForHFSTypeCode(kLockedBadgeIcon)] 
rect:rect fraction:0.5]];
+    }
     
     return [page thumbnailWithSize:thumbnailCacheSize scale:[[self window] 
backingScaleFactor] forBox:kPDFDisplayBoxMediaBox hasShadow:YES 
highlights:stamps];
 }

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