Revision: 12295
          http://sourceforge.net/p/skim-app/code/12295
Author:   hofman
Date:     2021-04-14 09:08:26 +0000 (Wed, 14 Apr 2021)
Log Message:
-----------
bring back history highlights in toc outline view on Big Sur

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

Modified: trunk/SKMainWindowController_UI.m
===================================================================
--- trunk/SKMainWindowController_UI.m   2021-04-13 22:12:06 UTC (rev 12294)
+++ trunk/SKMainWindowController_UI.m   2021-04-14 09:08:26 UTC (rev 12295)
@@ -357,6 +357,14 @@
     }
 }
 
+- (void)updateTocHighlights {
+    if (RUNNING_AFTER(10_15)) {
+        [leftSideController.tocOutlineView 
enumerateAvailableRowViewsUsingBlock:^(SKHighlightingTableRowView *rowView, 
NSInteger row){
+            [rowView setHighlightLevel:[self tocHighlightLevelForRow:row]];
+        }];
+    }
+}
+
 #pragma mark NSTableView datasource protocol
 
 // AppKit bug: need a dummy NSTableDataSource implementation, otherwise some 
NSTableView delegate methods are ignored
@@ -716,7 +724,11 @@
 }
 
 - (NSTableRowView *)outlineView:(NSOutlineView *)ov rowViewForItem:(id)item {
-    if ([ov isEqual:rightSideController.noteOutlineView]) {
+    if ([ov isEqual:leftSideController.tocOutlineView]) {
+        SKHighlightingTableRowView *rowView = [ov 
makeViewWithIdentifier:ROWVIEW_IDENTIFIER owner:self];
+        [rowView setHighlightLevel:[self tocHighlightLevelForRow:[ov 
rowForItem:item]]];
+        return rowView;
+    } else if ([ov isEqual:rightSideController.noteOutlineView]) {
         return [ov makeViewWithIdentifier:ROWVIEW_IDENTIFIER owner:self];
     }
     return nil;
@@ -806,6 +818,7 @@
 
 - (void)outlineViewItemDidExpand:(NSNotification *)notification{
     if ([[notification object] isEqual:leftSideController.tocOutlineView]) {
+        [self updateTocHighlights];
         [self updateOutlineSelection];
     }
 }
@@ -812,6 +825,7 @@
 
 - (void)outlineViewItemDidCollapse:(NSNotification *)notification{
     if ([[notification object] isEqual:leftSideController.tocOutlineView]) {
+        [self updateTocHighlights];
         [self updateOutlineSelection];
     }
 }
@@ -1820,7 +1834,8 @@
             [lastViewedPages setCount:MAX_HIGHLIGHTS];
     }
     [self updateThumbnailHighlights];
-    
+    [self updateTocHighlights];
+
     [self updatePageNumber];
     [self updatePageLabel];
     

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