From 2512c0403fa42b19c3e87fed44240da045ec902f Mon Sep 17 00:00:00 2001 From: Koni Marti Date: Fri, 18 Mar 2022 22:35:33 +0100 Subject: statusline: implement per-account status Implement a statusline state for each account. Keep the ex line and the push notifications global. Add account name prefix to push notifications. Prefix status line with account name when multiple accounts are available. Use account-specific status line for each tab where an account is defined. Handle threading, filter/search, viewer passthrough and connection status. Signed-off-by: Koni Marti Acked-by: Robin Jarry --- widgets/status.go | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) (limited to 'widgets/status.go') diff --git a/widgets/status.go b/widgets/status.go index 960f244..c70d215 100644 --- a/widgets/status.go +++ b/widgets/status.go @@ -14,7 +14,6 @@ type StatusLine struct { ui.Invalidatable stack []*StatusMessage fallback StatusMessage - extra string aerc *Aerc uiConfig config.UIConfig } @@ -30,7 +29,6 @@ func NewStatusLine(uiConfig config.UIConfig) *StatusLine { style: uiConfig.GetStyle(config.STYLE_STATUSLINE_DEFAULT), message: "Idle", }, - extra: "", uiConfig: uiConfig, } } @@ -51,11 +49,7 @@ func (status *StatusLine) Draw(ctx *ui.Context) { pendingKeys += string(pendingKey.Rune) } } - text := line.message - if status.extra != "" { - text += " " + status.extra - } - message := runewidth.FillRight(text, ctx.Width()-len(pendingKeys)-5) + message := runewidth.FillRight(line.message, ctx.Width()-len(pendingKeys)-5) ctx.Printf(0, 0, line.style, "%s%s", message, pendingKeys) } @@ -109,14 +103,6 @@ func (status *StatusLine) PushSuccess(text string) *StatusMessage { return msg } -func (status *StatusLine) SetExtra(text string) { - status.extra = text -} - -func (status *StatusLine) ClearExtra() { - status.extra = "" -} - func (status *StatusLine) Expire() { status.stack = nil } -- cgit v1.2.3