diff options
author | Stefan Haller <stefan@haller-berlin.de> | 2024-06-05 18:48:26 +0200 |
---|---|---|
committer | Stefan Haller <stefan@haller-berlin.de> | 2024-06-23 11:54:21 +0200 |
commit | deee5fa95781bb515db539999394d651c8ba31c6 (patch) | |
tree | 107aab0fa791cb30078464100a65e23804d8fd93 /pkg/gui | |
parent | 44160ef8448239e397c7bddbbd78bc9cd38327a3 (diff) |
Render the view when scrolling with the wheel
Diffstat (limited to 'pkg/gui')
-rw-r--r-- | pkg/gui/context/list_context_trait.go | 4 | ||||
-rw-r--r-- | pkg/gui/controllers/list_controller.go | 6 | ||||
-rw-r--r-- | pkg/gui/types/context.go | 1 |
3 files changed, 11 insertions, 0 deletions
diff --git a/pkg/gui/context/list_context_trait.go b/pkg/gui/context/list_context_trait.go index aca33cbd0..773f946a9 100644 --- a/pkg/gui/context/list_context_trait.go +++ b/pkg/gui/context/list_context_trait.go @@ -136,3 +136,7 @@ func (self *ListContextTrait) IsItemVisible(item types.HasUrn) bool { func (self *ListContextTrait) RangeSelectEnabled() bool { return true } + +func (self *ListContextTrait) RenderOnlyVisibleLines() bool { + return self.renderOnlyVisibleLines +} diff --git a/pkg/gui/controllers/list_controller.go b/pkg/gui/controllers/list_controller.go index dc876b3fc..711d32f79 100644 --- a/pkg/gui/controllers/list_controller.go +++ b/pkg/gui/controllers/list_controller.go @@ -53,6 +53,9 @@ func (self *ListController) HandleScrollRight() error { func (self *ListController) HandleScrollUp() error { scrollHeight := self.c.UserConfig.Gui.ScrollHeight self.context.GetViewTrait().ScrollUp(scrollHeight) + if self.context.RenderOnlyVisibleLines() { + return self.context.HandleRender() + } return nil } @@ -60,6 +63,9 @@ func (self *ListController) HandleScrollUp() error { func (self *ListController) HandleScrollDown() error { scrollHeight := self.c.UserConfig.Gui.ScrollHeight self.context.GetViewTrait().ScrollDown(scrollHeight) + if self.context.RenderOnlyVisibleLines() { + return self.context.HandleRender() + } return nil } diff --git a/pkg/gui/types/context.go b/pkg/gui/types/context.go index 29b53b9eb..691d5694d 100644 --- a/pkg/gui/types/context.go +++ b/pkg/gui/types/context.go @@ -153,6 +153,7 @@ type IListContext interface { FocusLine() IsListContext() // used for type switch RangeSelectEnabled() bool + RenderOnlyVisibleLines() bool } type IPatchExplorerContext interface { |