summaryrefslogtreecommitdiffstats
path: root/pkg/gui/types/context.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2024-01-14 13:51:20 +1100
committerJesse Duffield <jessedduffield@gmail.com>2024-01-19 10:50:49 +1100
commit51fb82d6bf26153f294477883a1b2abd592441f9 (patch)
tree1be91ee6e52592f6d1eec311e26b22725237a200 /pkg/gui/types/context.go
parent280b4d60f893a0e20897091ab02617c32180b45d (diff)
Enforce single-item selection in various actions
We want to show an error when the user tries to invoke an action that expects only a single item to be selected. We're using the GetDisabledReason field to enforce this (as well as DisabledReason on menu items). I've created a ListControllerTrait to store some shared convenience functions for this.
Diffstat (limited to 'pkg/gui/types/context.go')
-rw-r--r--pkg/gui/types/context.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/pkg/gui/types/context.go b/pkg/gui/types/context.go
index 3557cf5aa..a3f0ad24a 100644
--- a/pkg/gui/types/context.go
+++ b/pkg/gui/types/context.go
@@ -231,6 +231,7 @@ type IListCursor interface {
GetRangeStartIdx() (int, bool)
GetSelectionRange() (int, int)
IsSelectingRange() bool
+ AreMultipleItemsSelected() bool
ToggleStickyRange()
ExpandNonStickyRange(int)
}