Revision: 13475
          http://sourceforge.net/p/skim-app/code/13475
Author:   hofman
Date:     2023-06-14 16:46:25 +0000 (Wed, 14 Jun 2023)
Log Message:
-----------
Move some margin to interline spacing in overview when possible

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

Modified: trunk/SKMainWindowController.m
===================================================================
--- trunk/SKMainWindowController.m      2023-06-14 16:29:46 UTC (rev 13474)
+++ trunk/SKMainWindowController.m      2023-06-14 16:46:25 UTC (rev 13475)
@@ -1716,7 +1716,7 @@
         } else {
             [overviewView setAllowsEmptySelection:NO];
             NSCollectionViewFlowLayout *layout = [[[NSCollectionViewFlowLayout 
alloc] init] autorelease];
-            [layout setMinimumLineSpacing:0.0];
+            [layout setMinimumLineSpacing:8.0];
             [layout setMinimumInteritemSpacing:0.0];
             [overviewView setCollectionViewLayout:layout];
             [self updateOverviewItemSize];

Modified: trunk/SKThumbnailView.m
===================================================================
--- trunk/SKThumbnailView.m     2023-06-14 16:29:46 UTC (rev 13474)
+++ trunk/SKThumbnailView.m     2023-06-14 16:46:25 UTC (rev 13475)
@@ -52,7 +52,8 @@
 
 #define MARGIN 8.0
 #define TEXT_MARGIN 4.0
-#define TEXT_SPACE 32.0
+#define TEXT_SPACE_OLD 32.0
+#define TEXT_SPACE 24.0
 #define SELECTION_MARGIN 6.0
 #define IMAGE_SEL_RADIUS 8.0
 #define TEXT_SEL_RADIUS 4.0
@@ -73,7 +74,8 @@
 
 - (void)commonInit {
     NSRect bounds = [self bounds];
-    NSRect rect = NSOffsetRect(NSInsetRect(bounds, MARGIN, MARGIN + 0.5 * 
TEXT_SPACE), 0.0, 0.5 * TEXT_SPACE);
+    CGFloat textSpace = RUNNING_BEFORE(10_11) ? TEXT_SPACE_OLD : TEXT_SPACE;
+    NSRect rect = NSOffsetRect(NSInsetRect(bounds, MARGIN, MARGIN + 0.5 * 
textSpace), 0.0, 0.5 * textSpace);
     imageView = [[SKThumbnailImageView alloc] initWithFrame:rect];
     [imageView setImageScaling:NSImageScaleProportionallyUpOrDown];
     [imageView setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
@@ -87,7 +89,7 @@
     [labelView setSelectable:NO];
     [labelView setAlignment:NSTextAlignmentCenter];
     [labelView setAutoresizingMask:NSViewWidthSizable | NSViewMaxYMargin];
-    rect = NSInsetRect(bounds, TEXT_MARGIN, TEXT_SPACE);
+    rect = NSInsetRect(bounds, TEXT_MARGIN, textSpace);
     rect.size.height = [[labelView cell] cellSize].height;
     rect.origin.y -= NSHeight(rect);
     [labelView setFrame:rect];
@@ -129,7 +131,7 @@
 }
 
 + (NSSize)sizeForImageSize:(NSSize)size {
-    return NSMakeSize(size.width + 2.0 * MARGIN, size.height + 2.0 * MARGIN + 
TEXT_SPACE);
+    return NSMakeSize(size.width + 2.0 * MARGIN, size.height + 2.0 * MARGIN + 
(RUNNING_BEFORE(10_11) ? TEXT_SPACE_OLD : TEXT_SPACE));
 }
 
 #pragma mark Updating

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