diff options
author | Jeffas <dev@jeffas.io> | 2020-06-09 20:13:13 +0100 |
---|---|---|
committer | Reto Brunner <reto@labrat.space> | 2020-06-09 21:52:10 +0200 |
commit | 15b72df1dabb6675c20cff043648e97a209d2132 (patch) | |
tree | 184b15a40d8aa242259f4ee46caebc51527f5e26 /commands/account | |
parent | c6f4d7badd4cb36067f0e76198630a3d0f9e7ce9 (diff) | |
download | aerc-15b72df1dabb6675c20cff043648e97a209d2132.tar.gz |
Rework msglist scrolling
This changes the scrolling to be done on the draw, when the height is
updated, ensuring that the selected item is kept on screen during
resizing.
Also, this ensures that messages will fill the screen when resizing the
window, for instance, shrinking and then growing drags down more
messages if possible.
This is a transplant of the dirlist scrolling logic.
Diffstat (limited to 'commands/account')
-rw-r--r-- | commands/account/next-result.go | 4 | ||||
-rw-r--r-- | commands/account/next.go | 4 | ||||
-rw-r--r-- | commands/account/search.go | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/commands/account/next-result.go b/commands/account/next-result.go index 78d437d3..fe835eab 100644 --- a/commands/account/next-result.go +++ b/commands/account/next-result.go @@ -34,13 +34,13 @@ func (NextPrevResult) Execute(aerc *widgets.Aerc, args []string) error { if store != nil { store.PrevResult() } - acct.Messages().Scroll() + acct.Messages().Invalidate() } else { store := acct.Store() if store != nil { store.NextResult() } - acct.Messages().Scroll() + acct.Messages().Invalidate() } return nil } diff --git a/commands/account/next.go b/commands/account/next.go index 5e4838e0..427f5637 100644 --- a/commands/account/next.go +++ b/commands/account/next.go @@ -65,13 +65,13 @@ func ExecuteNextPrevMessage(args []string, acct *widgets.AccountView, pct bool, store := acct.Store() if store != nil { store.NextPrev(-n) - acct.Messages().Scroll() + acct.Messages().Invalidate() } } else { store := acct.Store() if store != nil { store.NextPrev(n) - acct.Messages().Scroll() + acct.Messages().Invalidate() } } return nil diff --git a/commands/account/search.go b/commands/account/search.go index 1d2e7a2b..607dc24c 100644 --- a/commands/account/search.go +++ b/commands/account/search.go @@ -45,7 +45,7 @@ func (SearchFilter) Execute(aerc *widgets.Aerc, args []string) error { acct.Logger().Printf("Search results: %v", uids) store.ApplySearch(uids) // TODO: Remove when stores have multiple OnUpdate handlers - acct.Messages().Scroll() + acct.Messages().Invalidate() } } store.Search(args, cb) |