From a8a4c72d14027afa669fd7c85ea3a48bde8a3924 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Wed, 16 May 2018 21:06:50 +0300 Subject: [PATCH] Show per-tag room count in room list --- ui/room-list.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ui/room-list.go b/ui/room-list.go index 6905d0e..268666d 100644 --- a/ui/room-list.go +++ b/ui/room-list.go @@ -672,7 +672,9 @@ func (list *RoomList) Draw(screen tcell.Screen) { } } - widget.WriteLine(screen, tview.AlignLeft, tagDisplayName, x, y, width, tcell.StyleDefault.Underline(true).Bold(true)) + roomCount := strconv.Itoa(tagRoomList.TotalLength()) + widget.WriteLine(screen, tview.AlignLeft, tagDisplayName, x, y, width-1-len(roomCount), tcell.StyleDefault.Underline(true).Bold(true)) + widget.WriteLine(screen, tview.AlignLeft, roomCount, x+len(tagDisplayName)+1, y, width-2-len(tagDisplayName), tcell.StyleDefault.Italic(true)) items := tagRoomList.Visible()