Redraw the status bar when a line arrives in another window (closes #232)
check / check (push) Canceled after 0s
check / check (push) Canceled after 0s
A line that arrives in a window that is not shown is counted as unread, but refreshStatusBar did nothing, so the window joined the status bar's unread list only at the next SetStatus. UI now keeps the nick, target and connection state last passed to SetStatus, and refreshStatusBar redraws the status bar with them. Model: opus-5-5
This commit was merged in pull request #243.
This commit is contained in:
+14
-2
@@ -30,6 +30,12 @@ type UI struct {
|
||||
buffers []*Buffer
|
||||
currentBuffer int
|
||||
|
||||
// The nick, target and connection state last passed to
|
||||
// SetStatus.
|
||||
nick string
|
||||
target string
|
||||
connStatus string
|
||||
|
||||
onInput func(string)
|
||||
// inputDone is closed once the line last passed to onInput
|
||||
// has been handled. Only callOnInput, on the event loop, uses
|
||||
@@ -179,7 +185,11 @@ func (ui *UI) SetStatus(
|
||||
nick, target, connStatus string,
|
||||
) {
|
||||
ui.app.QueueUpdateDraw(func() {
|
||||
ui.renderStatusBar(nick, target, connStatus)
|
||||
ui.nick = nick
|
||||
ui.target = target
|
||||
ui.connStatus = connStatus
|
||||
|
||||
ui.refreshStatusBar()
|
||||
})
|
||||
}
|
||||
|
||||
@@ -300,8 +310,10 @@ func (ui *UI) callOnInput(text string) {
|
||||
}()
|
||||
}
|
||||
|
||||
// refreshStatusBar redraws the status bar with the nick, target
|
||||
// and connection state last passed to SetStatus.
|
||||
func (ui *UI) refreshStatusBar() {
|
||||
// Placeholder; full refresh needs nick/target context.
|
||||
ui.renderStatusBar(ui.nick, ui.target, ui.connStatus)
|
||||
}
|
||||
|
||||
func (ui *UI) renderStatusBar(
|
||||
|
||||
Reference in New Issue
Block a user