diff options
author | Hubert Hirtz <hubert@hirtz.pm> | 2021-09-01 13:01:54 +0200 |
---|---|---|
committer | Hubert Hirtz <hubert@hirtz.pm> | 2021-09-01 13:01:54 +0200 |
commit | 526eb96db874951a8ad6f66e300ac8e7e5b809b9 (patch) | |
tree | b73c2a8f37bf0144284213e772fdf377096ee662 /ui/buffers.go | |
parent | Fetch missed messages on reconnect (diff) |
Channel list is horizontal by default
Diffstat (limited to 'ui/buffers.go')
-rw-r--r-- | ui/buffers.go | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/ui/buffers.go b/ui/buffers.go index 681918c..b2f0930 100644 --- a/ui/buffers.go +++ b/ui/buffers.go @@ -413,6 +413,37 @@ func (bs *BufferList) DrawVerticalBufferList(screen tcell.Screen, x0, y0, width, } } +func (bs *BufferList) DrawHorizontalBufferList(screen tcell.Screen, x0, y0, width int) { + x := x0 + + for i, b := range bs.list { + if width <= x-x0 { + break + } + st := tcell.StyleDefault + if b.unread { + st = st.Bold(true) + } else if i == bs.current { + st = st.Underline(true) + } + if i == bs.clicked { + st = st.Reverse(true) + } + title := truncate(b.title, width-x, "\u2026") + printString(screen, &x, y0, Styled(title, st)) + if 0 < b.highlights { + st = st.Foreground(tcell.ColorRed).Reverse(true) + screen.SetContent(x, y0, ' ', nil, st) + x++ + printNumber(screen, &x, y0, st, b.highlights) + screen.SetContent(x, y0, ' ', nil, st) + x++ + } + screen.SetContent(x, y0, ' ', nil, tcell.StyleDefault) + x++ + } +} + func (bs *BufferList) DrawVerticalMemberList(screen tcell.Screen, x0, y0, width, height int, members []irc.Member, offset *int) { st := tcell.StyleDefault |