summaryrefslogtreecommitdiffstats
path: root/pkg/gui/context
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2024-01-15 20:12:53 +1100
committerJesse Duffield <jessedduffield@gmail.com>2024-01-19 10:50:49 +1100
commit1ea0c270df13f30d2e74cea7ec78ea3a62df1d82 (patch)
tree59a6fd0ae0af5228c556ac876316b9a7923ab03d /pkg/gui/context
parent51fb82d6bf26153f294477883a1b2abd592441f9 (diff)
Disable range-select in menu and suggestions view
We don't need it there so no need to enable it. I'm leaving the disabled reason checks there, even though they're now redundant, because they're only one-liners and they communicate intent.
Diffstat (limited to 'pkg/gui/context')
-rw-r--r--pkg/gui/context/list_context_trait.go5
-rw-r--r--pkg/gui/context/menu_context.go5
-rw-r--r--pkg/gui/context/suggestions_context.go5
3 files changed, 15 insertions, 0 deletions
diff --git a/pkg/gui/context/list_context_trait.go b/pkg/gui/context/list_context_trait.go
index d7315c9ec..eb738e332 100644
--- a/pkg/gui/context/list_context_trait.go
+++ b/pkg/gui/context/list_context_trait.go
@@ -118,3 +118,8 @@ func (self *ListContextTrait) IsItemVisible(item types.HasUrn) bool {
}
return false
}
+
+// By default, list contexts supporta range select
+func (self *ListContextTrait) RangeSelectEnabled() bool {
+ return true
+}
diff --git a/pkg/gui/context/menu_context.go b/pkg/gui/context/menu_context.go
index b5c1a3c20..131aa8665 100644
--- a/pkg/gui/context/menu_context.go
+++ b/pkg/gui/context/menu_context.go
@@ -195,3 +195,8 @@ func (self *MenuContext) OnMenuPress(selectedItem *types.MenuItem) error {
return nil
}
+
+// There is currently no need to use range-select in a menu so we're disabling it.
+func (self *MenuContext) RangeSelectEnabled() bool {
+ return false
+}
diff --git a/pkg/gui/context/suggestions_context.go b/pkg/gui/context/suggestions_context.go
index 0921a7329..30781fce1 100644
--- a/pkg/gui/context/suggestions_context.go
+++ b/pkg/gui/context/suggestions_context.go
@@ -90,3 +90,8 @@ func (self *SuggestionsContext) RefreshSuggestions() {
}
})
}
+
+// There is currently no need to use range-select in the suggestions view so we're disabling it.
+func (self *SuggestionsContext) RangeSelectEnabled() bool {
+ return false
+}