From a3a9d467dc137d3433a1ca6f7456f05996a31af4 Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Wed, 7 Feb 2018 21:23:18 -0800 Subject: [PATCH] Show the contextual menu for all selected items in the sidebar when the clicked row is part of the selection. --- Evergreen/MainWindow/Sidebar/SidebarViewController.swift | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Evergreen/MainWindow/Sidebar/SidebarViewController.swift b/Evergreen/MainWindow/Sidebar/SidebarViewController.swift index 9ca5fb51d..3afc39974 100644 --- a/Evergreen/MainWindow/Sidebar/SidebarViewController.swift +++ b/Evergreen/MainWindow/Sidebar/SidebarViewController.swift @@ -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]) }