File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -58,6 +58,25 @@ - (NSArray *)outlineView:(NSOutlineView *)outlineView namesOfPromisedFilesDroppe
58
58
return fileNames;
59
59
}
60
60
61
+ - (NSMenu *)menuForEvent : (NSEvent *)theEvent
62
+ {
63
+ if ([theEvent type ] == NSRightMouseDown )
64
+ {
65
+ // get the current selections for the outline view.
66
+ NSIndexSet *selectedRowIndexes = [self selectedRowIndexes ];
67
+
68
+ // select the row that was clicked before showing the menu for the event
69
+ NSPoint mousePoint = [self convertPoint: [theEvent locationInWindow ] fromView: nil ];
70
+ int row = [self rowAtPoint: mousePoint];
71
+
72
+ // figure out if the row that was just clicked on is currently selected
73
+ if ([selectedRowIndexes containsIndex: row] == NO )
74
+ [self selectRow: row byExtendingSelection: NO ];
75
+ }
76
+
77
+ return [super menuForEvent: theEvent];
78
+ }
79
+
61
80
/* Implemented to satisfy datasourcee protocol */
62
81
- (BOOL ) outlineView : (NSOutlineView *)ov
63
82
isItemExpandable : (id )item { return NO ; }
You can’t perform that action at this time.
0 commit comments