diff options
Diffstat (limited to 'widgets')
-rw-r--r-- | widgets/account.go | 8 | ||||
-rw-r--r-- | widgets/aerc.go | 3 |
2 files changed, 10 insertions, 1 deletions
diff --git a/widgets/account.go b/widgets/account.go index 3bf104bd..6cf49aa1 100644 --- a/widgets/account.go +++ b/widgets/account.go @@ -126,7 +126,9 @@ func (acct *AccountView) SetStatus(setters ...statusline.SetStateFunc) { } func (acct *AccountView) UpdateStatus() { - acct.host.SetStatus(acct.state.StatusLine(acct.SelectedDirectory())) + if acct.isSelected() { + acct.host.SetStatus(acct.state.StatusLine(acct.SelectedDirectory())) + } } func (acct *AccountView) PushStatus(status string, expiry time.Duration) { @@ -226,6 +228,10 @@ func (acct *AccountView) SelectedMessagePart() *PartInfo { return nil } +func (acct *AccountView) isSelected() bool { + return acct.aerc.NumTabs() > 0 && acct == acct.aerc.SelectedAccount() +} + func (acct *AccountView) onMessage(msg types.WorkerMessage) { switch msg := msg.(type) { case *types.Done: diff --git a/widgets/aerc.go b/widgets/aerc.go index db447e47..94e67542 100644 --- a/widgets/aerc.go +++ b/widgets/aerc.go @@ -343,6 +343,7 @@ func (aerc *Aerc) NewTab(clickable ui.Drawable, name string) *ui.Tab { func (aerc *Aerc) RemoveTab(tab ui.Drawable) { aerc.tabs.Remove(tab) + aerc.UpdateStatus() } func (aerc *Aerc) ReplaceTab(tabSrc ui.Drawable, tabTarget ui.Drawable, name string) { @@ -373,6 +374,7 @@ func (aerc *Aerc) SelectTab(name string) bool { for i, tab := range aerc.tabs.Tabs { if tab.Name == name { aerc.tabs.Select(i) + aerc.UpdateStatus() return true } } @@ -383,6 +385,7 @@ func (aerc *Aerc) SelectTabIndex(index int) bool { for i := range aerc.tabs.Tabs { if i == index { aerc.tabs.Select(i) + aerc.UpdateStatus() return true } } |