Revision: 16070
          http://sourceforge.net/p/skim-app/code/16070
Author:   hofman
Date:     2026-03-16 17:53:50 +0000 (Mon, 16 Mar 2026)
Log Message:
-----------
do not auto expand items for drops on a note outline view

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

Modified: trunk/SKMainWindowController_UI.m
===================================================================
--- trunk/SKMainWindowController_UI.m   2026-03-16 16:28:50 UTC (rev 16069)
+++ trunk/SKMainWindowController_UI.m   2026-03-16 17:53:50 UTC (rev 16070)
@@ -868,6 +868,13 @@
     }
 }
 
+- (BOOL)outlineView:(NSOutlineView *)ov shouldExpandItem:(id)item{
+    if ([ov isEqual:rightSideController.noteOutlineView]) {
+        return [rightSideController.noteOutlineView isDropping] == NO;
+    }
+    return YES;
+}
+
 - (void)outlineViewItemDidExpand:(NSNotification *)notification{
     if ([[notification object] isEqual:leftSideController.tocOutlineView]) {
         [self updateTocHighlights];

Modified: trunk/SKNoteOutlineView.h
===================================================================
--- trunk/SKNoteOutlineView.h   2026-03-16 16:28:50 UTC (rev 16069)
+++ trunk/SKNoteOutlineView.h   2026-03-16 17:53:50 UTC (rev 16070)
@@ -43,6 +43,7 @@
 
 @interface SKNoteOutlineView : SKOutlineView {
     NSMapTable *rowHeights;
+    BOOL dropping;
 }
 
 - (void)toggleTableColumn:(nullable id)sender;
@@ -50,6 +51,8 @@
 @property (nonatomic, readonly) CGFloat fullWidthCellWidth;
 @property (nonatomic, readonly) CGFloat outlineIndentation;
 
+@property (nonatomic, readonly, getter=isDropping) BOOL dropping;
+
 - (CGFloat)rowHeightForItem:(id)item;
 - (void)setRowHeight:(CGFloat)rowHeight forItem:(id)item;
 - (void)resetRowHeights;

Modified: trunk/SKNoteOutlineView.m
===================================================================
--- trunk/SKNoteOutlineView.m   2026-03-16 16:28:50 UTC (rev 16069)
+++ trunk/SKNoteOutlineView.m   2026-03-16 17:53:50 UTC (rev 16070)
@@ -60,6 +60,7 @@
 
 @implementation SKNoteOutlineView
 
+@synthesize dropping;
 @dynamic fullWidthCellWidth, outlineIndentation, delegate;
 
 static inline NSString *titleForTableColumnIdentifier(NSString *identifier) {
@@ -227,4 +228,19 @@
     }
 }
 
+- (NSDragOperation)draggingEntered:(id<NSDraggingInfo>)sender {
+    dropping = YES;
+    return [super draggingEntered:sender];
+}
+
+- (void)draggingExited:(id<NSDraggingInfo>)sender {
+    dropping = NO;
+    [super draggingExited:sender];
+}
+
+- (BOOL)performDragOperation:(id<NSDraggingInfo>)sender {
+    dropping = NO;
+    return [super performDragOperation:sender];
+}
+
 @end

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