diff options
author | Koni Marti <koni.marti@gmail.com> | 2024-08-07 20:52:32 +0200 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2024-08-20 12:26:47 +0200 |
commit | 899d16f20f46abe6ce30e969f868cd1125ddadb9 (patch) | |
tree | eb206d9e729f9e219c8174a5c7c14af743debdca /app | |
parent | 9d4a61503c5eddad814cd3cd825a586d612f15e6 (diff) | |
download | aerc-899d16f20f46abe6ce30e969f868cd1125ddadb9.tar.gz |
tabs: update ui config in any tab
Update UI config in tabs.
Signed-off-by: Koni Marti <koni.marti@gmail.com>
Tested-by: Inwit <inwit@sindominio.net>
Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'app')
-rw-r--r-- | app/aerc.go | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/app/aerc.go b/app/aerc.go index 38340c7d..beef6328 100644 --- a/app/aerc.go +++ b/app/aerc.go @@ -57,7 +57,13 @@ func (aerc *Aerc) Init( complete func(cmd string) ([]string, string), cmdHistory lib.History, deferLoop chan struct{}, ) { - tabs := ui.NewTabs(config.Ui) + tabs := ui.NewTabs(func(d ui.Drawable) *config.UIConfig { + acct := aerc.account(d) + if acct != nil { + return config.Ui.ForAccount(acct.Name()) + } + return config.Ui + }) statusbar := ui.NewStack(config.Ui) statusline := &StatusLine{} @@ -88,10 +94,10 @@ func (aerc *Aerc) Init( for _, acct := range config.Accounts { view, err := NewAccountView(acct, deferLoop) if err != nil { - tabs.Add(errorScreen(err.Error()), acct.Name, nil, false) + tabs.Add(errorScreen(err.Error()), acct.Name, false) } else { aerc.accounts[acct.Name] = view - view.tab = tabs.Add(view, acct.Name, view.UiConfig(), false) + view.tab = tabs.Add(view, acct.Name, false) } } @@ -504,11 +510,7 @@ func (aerc *Aerc) SelectedTab() *ui.Tab { } func (aerc *Aerc) NewTab(clickable ui.Drawable, name string, background bool) *ui.Tab { - uiConf := config.Ui - if acct := aerc.account(clickable); acct != nil { - uiConf = acct.UiConfig() - } - tab := aerc.tabs.Add(clickable, name, uiConf, background) + tab := aerc.tabs.Add(clickable, name, background) aerc.UpdateStatus() return tab } |