Revision: 12734
          http://sourceforge.net/p/skim-app/code/12734
Author:   hofman
Date:     2022-01-21 16:03:18 +0000 (Fri, 21 Jan 2022)
Log Message:
-----------
update note text frames when the first column ismoved

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

Modified: trunk/SKMainWindowController_UI.m
===================================================================
--- trunk/SKMainWindowController_UI.m   2022-01-21 15:09:57 UTC (rev 12733)
+++ trunk/SKMainWindowController_UI.m   2022-01-21 16:03:18 UTC (rev 12734)
@@ -876,6 +876,29 @@
     }
 }
 
+- (void)outlineViewColumnDidMove:(NSNotification *)notification {
+    if ([[notification object] isEqual:rightSideController.noteOutlineView]) {
+        NSInteger oldColumn = [[[notification userInfo] 
objectForKey:@"NSOldColumn"] integerValue];
+        NSInteger newColumn = [[[notification userInfo] 
objectForKey:@"NSNewColumn"] integerValue];
+        if (oldColumn == 0 || newColumn == 0) {
+            SKNoteOutlineView *ov = [notification object];
+            BOOL noteColumnIsFirst = [[[ov firstVisibleTableColumn] 
identifier] isEqualToString:NOTE_COLUMNID];
+            [ov enumerateAvailableRowViewsUsingBlock:^(SKNoteTableRowView 
*rowView, NSInteger row){
+                NSTableCellView *rowCellView = [rowView rowCellView];
+                if (rowCellView) {
+                    NSRect frame = [ov convertRect:[ov frameOfCellAtColumn:-1 
row:row] toView:rowView];
+                    if (noteColumnIsFirst)
+                        frame = SKShrinkRect(frame, -[ov indentationPerLevel], 
NSMinXEdge);
+                    [rowCellView setFrame:frame];
+                }
+            }];
+            if (mwcFlags.autoResizeNoteRows)
+                [self performSelectorOnce:@selector(autoResizeNoteRows) 
afterDelay:0.0];
+        }
+    }
+    
+}
+
 - (CGFloat)outlineView:(NSOutlineView *)ov heightOfRowByItem:(id)item {
     if ([ov isEqual:rightSideController.noteOutlineView]) {
         CGFloat rowHeight = [rowHeights floatForKey:item];

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