Show the contextual menu for all selected items in the sidebar when the clicked row is part of the selection.

This commit is contained in:
Brent Simmons 2018-02-07 21:23:18 -08:00
parent 4491c5f443
commit a3a9d467dc
1 changed files with 5 additions and 2 deletions

View File

@ -202,13 +202,16 @@ import RSCore
func contextualMenuForClickedRows() -> NSMenu? {
// TODO: If the clickedRow is part of the selected rows, then do a contextual menu for all the selected rows.
let row = outlineView.clickedRow
guard row != -1, let node = nodeForRow(row) else {
return nil
}
if outlineView.selectedRowIndexes.contains(row) {
// If the clickedRow is part of the selected rows, then do a contextual menu for all the selected rows.
return contextualMenuForSelectedObjects()
}
let object = node.representedObject
return menu(for: [object])
}