Revision: 12348
          http://sourceforge.net/p/skim-app/code/12348
Author:   hofman
Date:     2021-06-19 17:49:50 +0000 (Sat, 19 Jun 2021)
Log Message:
-----------
Inset bookmark separator on Big Sur

Modified Paths:
--------------
    trunk/SKBookmarkController.m
    trunk/SKSeparatorView.m

Modified: trunk/SKBookmarkController.m
===================================================================
--- trunk/SKBookmarkController.m        2021-06-14 19:47:50 UTC (rev 12347)
+++ trunk/SKBookmarkController.m        2021-06-19 17:49:50 UTC (rev 12348)
@@ -83,6 +83,8 @@
 #define CHILDREN_KEY @"children"
 #define LABEL_KEY    @"label"
 
+#define INDENT (RUNNING_AFTER(10_15) ? 9.0 : 16.0)
+
 #define SAVE_DELAY 10.0
 
 static char SKBookmarkPropertiesObservationContext;
@@ -858,7 +860,7 @@
         NSTableColumn *tableColumn = [ov outlineTableColumn];
         NSTableCellView *view = [ov makeViewWithIdentifier:[tableColumn 
identifier] owner:self];
         __block NSInteger validCount = 0;
-        NSRect frame = NSMakeRect(0.0, 0.0, [tableColumn width] - 16.0, [ov 
rowHeight]);
+        NSRect frame = NSMakeRect(0.0, 0.0, [tableColumn width] - INDENT, [ov 
rowHeight]);
         [view setFrame:frame];
         frame.origin = [draggingInfo draggingLocation];
         
@@ -968,7 +970,7 @@
 - (NSTableRowView *)outlineView:(NSOutlineView *)ov rowViewForItem:(id)item {
     if ([item bookmarkType] == SKBookmarkTypeSeparator) {
         SKSeparatorView *view = [ov makeViewWithIdentifier:@"separator" 
owner:self];
-        [view setIndentation:16.0 + [ov levelForItem:item] * [ov 
indentationPerLevel]];
+        [view setIndentation:INDENT + [ov levelForItem:item] * [ov 
indentationPerLevel]];
         return view;
     }
     return nil;

Modified: trunk/SKSeparatorView.m
===================================================================
--- trunk/SKSeparatorView.m     2021-06-14 19:47:50 UTC (rev 12347)
+++ trunk/SKSeparatorView.m     2021-06-19 17:49:50 UTC (rev 12348)
@@ -41,6 +41,7 @@
 
 #define SEPARATOR_LEFT_INDENT 4.0
 #define SEPARATOR_RIGHT_INDENT 2.0
+#define EXTRA_INDENT 10.0
 
 
 @implementation SKSeparatorView
@@ -60,7 +61,10 @@
 
 - (void)drawRect:(NSRect)dirtyRect {
     [super drawRect:dirtyRect];
-    [[self class] drawSeparatorInRect:SKShrinkRect([self bounds], [self 
indentation], NSMinXEdge)];
+    NSRect rect = SKShrinkRect([self bounds], [self indentation], NSMinXEdge);
+    if (RUNNING_AFTER(10_15))
+        rect = NSInsetRect(rect, EXTRA_INDENT, 0.0);
+    [[self class] drawSeparatorInRect:rect];
 }
 
 @end

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