summaryrefslogtreecommitdiff
path: root/widgets/compose.go
diff options
context:
space:
mode:
authorRobin Jarry <robin@jarry.cc>2022-04-28 15:28:11 +0200
committerRobin Jarry <robin@jarry.cc>2022-04-28 17:56:42 +0200
commit2f2a520ab04ee00008b0929415e9062a8042e576 (patch)
treec62abe4427cf52115416a3f35351b1c53f05f560 /widgets/compose.go
parent01528ae1e2f6d133566a612b1c0e72b363b56868 (diff)
downloadaerc-2f2a520ab04ee00008b0929415e9062a8042e576.zip
compose: use account ui config where missing
The composer widget already has a reference to the AccountView object. Get the UI config from it directly. This completes commit 6edfbfa8ce37 ("aerc: use contextual ui styleset for tabs/compose"). Fixes: https://todo.sr.ht/~rjarry/aerc/3 Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Koni Marti <koni.marti@gmail.com>
Diffstat (limited to 'widgets/compose.go')
-rw-r--r--widgets/compose.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/widgets/compose.go b/widgets/compose.go
index 13c56a5..d660fe3 100644
--- a/widgets/compose.go
+++ b/widgets/compose.go
@@ -124,7 +124,7 @@ func (c *Composer) buildComposeHeader(aerc *Aerc, cmpl *completer.Completer) {
c.layout = aerc.conf.Compose.HeaderLayout
c.editors = make(map[string]*headerEditor)
c.focusable = make([]ui.MouseableDrawableInteractive, 0)
- uiConfig := aerc.SelectedAccountUiConfig()
+ uiConfig := c.acct.UiConfig()
for i, row := range c.layout {
for j, h := range row {
@@ -717,7 +717,7 @@ func (c *Composer) AddEditor(header string, value string, appendHeader bool) {
e.storeValue() // flush modifications from the user to the header
editor = e
} else {
- uiConfig := c.aerc.SelectedAccountUiConfig()
+ uiConfig := c.acct.UiConfig()
e := newHeaderEditor(header, c.header, uiConfig)
if uiConfig.CompletionPopovers {
e.input.TabComplete(c.completer.ForHeader(header), uiConfig.CompletionDelay)
@@ -772,8 +772,8 @@ func (c *Composer) updateGrid() {
if c.heditors != nil {
c.grid.RemoveChild(c.heditors)
}
- borderStyle := c.config.Ui.GetStyle(config.STYLE_BORDER)
- borderChar := c.config.Ui.BorderCharHorizontal
+ borderStyle := c.acct.UiConfig().GetStyle(config.STYLE_BORDER)
+ borderChar := c.acct.UiConfig().BorderCharHorizontal
c.heditors = heditors
c.grid.AddChild(c.heditors).At(0, 0)
c.grid.AddChild(ui.NewFill(borderChar, borderStyle)).At(1, 0)
@@ -970,7 +970,7 @@ func newReviewMessage(composer *Composer, err error) *reviewMessage {
{Strategy: ui.SIZE_WEIGHT, Size: ui.Const(1)},
})
- uiConfig := composer.config.Ui
+ uiConfig := composer.acct.UiConfig()
if err != nil {
grid.AddChild(ui.NewText(err.Error(), uiConfig.GetStyle(config.STYLE_ERROR)))