diff options
author | Tim Culverhouse <tim@timculverhouse.com> | 2022-08-12 14:51:25 -0500 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2022-08-22 09:30:37 +0200 |
commit | e1b62db583c39ae67cd6aa02b0ebde642eda308c (patch) | |
tree | 9fc9ffcf4f9d6be7f23175466fc6b2c423562d56 /widgets/dirtree.go | |
parent | 0db924dc14a38109d892613bb4e16159ff305350 (diff) | |
download | aerc-e1b62db583c39ae67cd6aa02b0ebde642eda308c.tar.gz |
fix: Set proper UIConfig for msgstores
The merged UIConfig used to create new message stores is based on the
selected directory. If the message store is created by other means than
selecting (ListDirectories for maildir/notmuch/mbox, or check-mail) it
may have an incorrect configuration if the user has folder-specific
values for:
- Threaded view
- Client built threads
- Client threads delay
- Sort criteria
- NewMessage bell
Use the correct merged UIConfig when creating a new message store.
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'widgets/dirtree.go')
-rw-r--r-- | widgets/dirtree.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/widgets/dirtree.go b/widgets/dirtree.go index c3b80773..65fb3116 100644 --- a/widgets/dirtree.go +++ b/widgets/dirtree.go @@ -51,7 +51,7 @@ func (dt *DirectoryTree) UpdateList(done func([]string)) { func (dt *DirectoryTree) Draw(ctx *ui.Context) { ctx.Fill(0, 0, ctx.Width(), ctx.Height(), ' ', - dt.UiConfig().GetStyle(config.STYLE_DIRLIST_DEFAULT)) + dt.UiConfig("").GetStyle(config.STYLE_DIRLIST_DEFAULT)) if dt.DirectoryList.spinner.IsRunning() { dt.DirectoryList.spinner.Draw(ctx) @@ -60,8 +60,8 @@ func (dt *DirectoryTree) Draw(ctx *ui.Context) { n := dt.countVisible(dt.list) if n == 0 { - style := dt.UiConfig().GetStyle(config.STYLE_DIRLIST_DEFAULT) - ctx.Printf(0, 0, style, dt.UiConfig().EmptyDirlist) + style := dt.UiConfig("").GetStyle(config.STYLE_DIRLIST_DEFAULT) + ctx.Printf(0, 0, style, dt.UiConfig("").EmptyDirlist) return } @@ -104,10 +104,10 @@ func (dt *DirectoryTree) Draw(ctx *ui.Context) { case 2: dirStyle = append(dirStyle, config.STYLE_DIRLIST_RECENT) } - style := dt.UiConfig().GetComposedStyle( + style := dt.UiConfig(path).GetComposedStyle( config.STYLE_DIRLIST_DEFAULT, dirStyle) if i == dt.listIdx { - style = dt.UiConfig().GetComposedStyleSelected( + style = dt.UiConfig(path).GetComposedStyleSelected( config.STYLE_DIRLIST_DEFAULT, dirStyle) } ctx.Fill(0, row, textWidth, 1, ' ', style) |