diff options
author | Jordan Bracco <href@random.sh> | 2023-01-15 17:25:25 +0100 |
---|---|---|
committer | Jordan Bracco <href@random.sh> | 2023-01-15 17:32:46 +0100 |
commit | cc80d8c82c2d510ab14e9dd58316cf748c653b08 (patch) | |
tree | 76c41e3aa7c765c00bbfe71f5a447030831413b1 /ui/buffers.go | |
parent | feat(ui): improve /TOPIC ui (diff) |
Multi-WIP that I probably should have done in multiples commits:
- more colors settings:
- server foreground
- channel foreground (active, inactive)
- dumb cosmetic changes because why not (`!` -> `:(`, coloring)
- temporary lines to unclutter main ui from disconnections/reconnections
- display line head only once in case of multiple lines
- cosmetic motd
- handle 396 numeric as "server" head
- improved ACTION display
- imrpoved topic display
bugs:
- ACTION fucks up with multi-line head
- multi-line head needs rework before trying upstream
- what the fuck to with my cosmetic changes
- document new config values
Diffstat (limited to 'ui/buffers.go')
-rw-r--r-- | ui/buffers.go | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/ui/buffers.go b/ui/buffers.go index 3a17b18..703fd1a 100644 --- a/ui/buffers.go +++ b/ui/buffers.go @@ -37,6 +37,7 @@ type Line struct { Highlight bool Readable bool Mergeable bool + Temporary bool Data interface{} splitPoints []point @@ -392,9 +393,12 @@ func (bs *BufferList) AddLine(netID, title string, line Line) { } else { if n != 0 { l := &b.lines[n-1] - if l.Head == line.Head || l.HeadTag == line.Head { + if l.Temporary { + b.lines = b.lines[:n-1] + } + if line.HeadTag == l.HeadTag || l.Head == line.Head || l.HeadTag == line.Head { line.HeadTag = line.Head - line.Head = "" + line.Head = "│" } } line.computeSplitPoints() @@ -435,9 +439,9 @@ func (bs *BufferList) AddLines(netID, title string, before, after []Line) { } if len(lines) > 0 { l := &lines[len(lines)-1] - if l.Head == line.Head || l.HeadTag == line.Head { + if line.HeadTag == l.HeadTag || l.Head == line.Head || l.HeadTag == line.Head { line.HeadTag = line.Head - line.Head = "" + line.Head = "│" } } lines = append(lines, line) @@ -595,6 +599,8 @@ func (bs *BufferList) DrawVerticalBufferList(screen tcell.Screen, x0, y0, width, st := tcell.StyleDefault if b.unread { st = st.Bold(true).Foreground(bs.colors.Unread) + } else { + st = st.Foreground(bs.colors.ChanForegroundInactive) } if bi == bs.current || bi == bs.clicked { st = st.Reverse(true) @@ -609,6 +615,7 @@ func (bs *BufferList) DrawVerticalBufferList(screen tcell.Screen, x0, y0, width, var title string if b.title == "" { title = b.netName + st.Foreground(bs.colors.ServerForeground) } else { if bi == bs.current || bi == bs.clicked { screen.SetContent(x, y, ' ', nil, tcell.StyleDefault.Reverse(true)) @@ -708,6 +715,7 @@ func (bs *BufferList) DrawHorizontalBufferList(screen tcell.Screen, x0, y0, widt break } st := tcell.StyleDefault + st = st.Foreground(bs.colors.ChanForegroundInactive) if b.unread { st = st.Bold(true).Foreground(bs.colors.Unread) } else if i == bs.current { @@ -719,7 +727,7 @@ func (bs *BufferList) DrawHorizontalBufferList(screen tcell.Screen, x0, y0, widt var title string if b.title == "" { - st = st.Dim(true) + st = st.Dim(true).Foreground(bs.colors.ServerForeground) title = b.netName } else { title = b.title |