aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/account.go
diff options
context:
space:
mode:
authorKoni Marti <koni.marti@gmail.com>2022-03-21 22:18:51 +0100
committerRobin Jarry <robin@jarry.cc>2022-03-23 20:55:30 +0100
commitfeecc09b73e2c904be42f271e0c10574b98a95ea (patch)
tree3bc763d021ad55f42debfa326ed2340f0ae06b2b /widgets/account.go
parente56648029f2231a58ed4afbbe804b845e02fde62 (diff)
downloadaerc-feecc09b73e2c904be42f271e0c10574b98a95ea.tar.gz
statusline: make statusline folder-specific
Make statusline folder-specific. Update filter, search and threading status when changing folders. Commit 2512c04 ("statusline: implement per-account status") introduced an account-specific statusline. This makes it account- and folder-specific. Signed-off-by: Koni Marti <koni.marti@gmail.com> Tested-by: Moritz Poldrack <moritz@poldrack.dev>
Diffstat (limited to 'widgets/account.go')
-rw-r--r--widgets/account.go12
1 files changed, 4 insertions, 8 deletions
diff --git a/widgets/account.go b/widgets/account.go
index 5d1315c2..1d319232 100644
--- a/widgets/account.go
+++ b/widgets/account.go
@@ -32,7 +32,6 @@ type AccountView struct {
msglist *MessageList
worker *types.Worker
state *statusline.State
- update bool
}
func (acct *AccountView) UiConfig() config.UIConfig {
@@ -112,13 +111,13 @@ func (acct *AccountView) Tick() bool {
func (acct *AccountView) SetStatus(setters ...statusline.SetStateFunc) {
for _, fn := range setters {
- fn(acct.state)
+ fn(acct.state, acct.SelectedDirectory())
}
- acct.update = true
+ acct.UpdateStatus()
}
func (acct *AccountView) UpdateStatus() {
- acct.host.SetStatus(acct.state.String())
+ acct.host.SetStatus(acct.state.StatusLine(acct.SelectedDirectory()))
}
func (acct *AccountView) PushStatus(status string, expiry time.Duration) {
@@ -160,10 +159,6 @@ func (acct *AccountView) Invalidate() {
}
func (acct *AccountView) Draw(ctx *ui.Context) {
- if acct.update {
- acct.UpdateStatus()
- acct.update = false
- }
acct.grid.Draw(ctx)
}
@@ -322,6 +317,7 @@ func (acct *AccountView) onMessage(msg types.WorkerMessage) {
acct.logger.Printf("%v", msg.Error)
acct.PushError(msg.Error)
}
+ acct.UpdateStatus()
}
func (acct *AccountView) getSortCriteria() []*types.SortCriterion {