From 1c3bc122c47d71d00a5d452bf9032ef6b4af67e5 Mon Sep 17 00:00:00 2001 From: citrons Date: Thu, 5 Jun 2025 19:50:37 -0500 Subject: more compact list command --- client/channel_window.go | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/client/channel_window.go b/client/channel_window.go index cb00761..3fec792 100644 --- a/client/channel_window.go +++ b/client/channel_window.go @@ -184,29 +184,27 @@ func (u userListMsg) Show(odd bool) { tui.Pop() tui.Push("", tui.Box {Width: tui.Fill, Height: tui.Children}) + tui.Push("", tui.Box {Width: tui.Fill, Height: tui.TextSize}) tui.Text(strconv.Itoa(len(u.names)), nil) tui.Text(" users in ", nil) tui.Text(u.channelName, nameStyle) tui.Pop() - for _, name := range u.names { - tui.Push("", tui.Box { - Width: tui.Fill, Height: tui.Children, Dir: tui.Right, - }) - tui.Push("", tui.Box {Width: tui.TextSize, Height: tui.TextSize}) - tui.Text(" * ", nil) - tui.Pop() - - tui.Push("", tui.Box {Width: tui.TextSize, Height: tui.TextSize}) + tui.Push("names", tui.Box { + Width: tui.Fill, Height: tui.TextSize, Margins: [4]int {1, 0, 0, 0}, + }) + for i, name := range u.names { tui.Text(name, nameStyle) - tui.Pop() - - tui.Pop() + if i < len(u.names) - 1 { + tui.Text(", ", nil) + } } tui.Pop() tui.Pop() + + tui.Pop() } func (cw *channelWindow) userList(callback func(userListMsg)) { -- cgit v1.2.3