mirror of
https://github.com/tulir/gomuks.git
synced 2025-04-20 10:33: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)
|
lastMessage, received := rstr.getMostRecentMessage(room)
|
||||||
msgStyle := style.Foreground(tcell.ColorGray).Italic(!received)
|
msgStyle := style.Foreground(tcell.ColorGray).Italic(!received)
|
||||||
|
startingX := 2
|
||||||
|
|
||||||
if isSelected {
|
if isSelected {
|
||||||
|
lastMessage = " " + lastMessage
|
||||||
msgStyle = msgStyle.Background(tcell.ColorWhite).Italic(true)
|
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)
|
tmX := rstr.width - 3 - len(tm)
|
||||||
widget.WriteLinePadded(screen, mauview.AlignLeft, room.GetTitle(), 2, y, tmX, style)
|
widget.WriteLinePadded(screen, mauview.AlignLeft, room.GetTitle(), startingX, y, tmX, style)
|
||||||
widget.WriteLine(screen, mauview.AlignLeft, tm, tmX, y, 2+len(tm), 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)
|
widget.WriteLinePadded(screen, mauview.AlignLeft, lastMessage, 2, y+1, rstr.width-5, msgStyle)
|
||||||
|
|
||||||
y += renderHeight
|
y += renderHeight
|
||||||
|
|
Loading…
Add table
Reference in a new issue