1
0
Fork 0
forked from Mirrors/gomuks

Add textual selection indicator in modern mode

This commit is contained in:
FIGBERT 2023-05-01 23:46:37 -07:00
parent 7e1f8bcc59
commit 706375b5a1
No known key found for this signature in database
GPG key ID: 67F1598D607A844B

View file

@ -243,13 +243,19 @@ func (rstr *RosterView) Draw(screen mauview.Screen) {
lastMessage, received := rstr.getMostRecentMessage(room)
msgStyle := style.Foreground(tcell.ColorGray).Italic(!received)
startingX := 2
if isSelected {
lastMessage = " " + lastMessage
msgStyle = msgStyle.Background(tcell.ColorWhite).Italic(true)
startingX += 2
widget.WriteLine(screen, mauview.AlignLeft, string(tcell.RuneDiamond)+" ", 2, y, 4, style)
}
tmX := rstr.width - 3 - len(tm)
widget.WriteLinePadded(screen, mauview.AlignLeft, room.GetTitle(), 2, y, tmX, style)
widget.WriteLine(screen, mauview.AlignLeft, tm, tmX, y, 2+len(tm), style)
widget.WriteLinePadded(screen, mauview.AlignLeft, room.GetTitle(), startingX, y, tmX, style)
widget.WriteLine(screen, mauview.AlignLeft, tm, tmX, y, startingX+len(tm), style)
widget.WriteLinePadded(screen, mauview.AlignLeft, lastMessage, 2, y+1, rstr.width-5, msgStyle)
y += renderHeight