fix room name overwriting unread count

This commit is contained in:
evan 2018-05-25 00:12:22 -05:00
parent 1ed786ff5e
commit dd63d32d62

View File

@ -53,6 +53,9 @@ func (or *OrderedRoom) Draw(roomList *RoomList, screen tcell.Screen, x, y, lineW
} }
unreadCount := or.UnreadCount() unreadCount := or.UnreadCount()
widget.WriteLinePadded(screen, tview.AlignLeft, or.GetTitle(), x, y, lineWidth, style)
if unreadCount > 0 { if unreadCount > 0 {
unreadMessageCount := "99+" unreadMessageCount := "99+"
if unreadCount < 100 { if unreadCount < 100 {
@ -65,8 +68,6 @@ func (or *OrderedRoom) Draw(roomList *RoomList, screen tcell.Screen, x, y, lineW
widget.WriteLine(screen, tview.AlignRight, unreadMessageCount, x+lineWidth-7, y, 7, style) widget.WriteLine(screen, tview.AlignRight, unreadMessageCount, x+lineWidth-7, y, 7, style)
lineWidth -= len(unreadMessageCount) lineWidth -= len(unreadMessageCount)
} }
widget.WriteLinePadded(screen, tview.AlignLeft, or.GetTitle(), x, y, lineWidth, style)
} }
type TagRoomList struct { type TagRoomList struct {