mirror of
https://github.com/tulir/gomuks.git
synced 2025-04-19 18:13:41 -05:00
Add textual selection indicator in modern mode
This commit is contained in:
parent
7e1f8bcc59
commit
706375b5a1
1 changed files with 8 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue