mirror of
https://github.com/rivo/tview.git
synced 2025-05-01 22:18:30 +08:00
Fix unselected list color
This commit is contained in:
parent
037df494fb
commit
95779c15c5
8
list.go
8
list.go
@ -506,12 +506,16 @@ func (l *List) Draw(screen tcell.Screen) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Main text.
|
// Main text.
|
||||||
|
var printedWidth int
|
||||||
|
var style tcell.Style
|
||||||
selected := index == l.currentItem && (!l.selectedFocusOnly || l.HasFocus())
|
selected := index == l.currentItem && (!l.selectedFocusOnly || l.HasFocus())
|
||||||
style := l.mainTextStyle
|
|
||||||
if selected {
|
if selected {
|
||||||
style = l.selectedStyle
|
style = l.selectedStyle
|
||||||
|
_, _, printedWidth = printWithStyle(screen, item.MainText, x, y, l.horizontalOffset, width, AlignLeft, style, false)
|
||||||
|
} else {
|
||||||
|
style = l.mainTextStyle
|
||||||
|
_, _, printedWidth = printWithStyle(screen, item.MainText, x, y, l.horizontalOffset, width, AlignLeft, style, true)
|
||||||
}
|
}
|
||||||
_, _, printedWidth := printWithStyle(screen, item.MainText, x, y, l.horizontalOffset, width, AlignLeft, style, false)
|
|
||||||
if printedWidth > maxWidth {
|
if printedWidth > maxWidth {
|
||||||
maxWidth = printedWidth
|
maxWidth = printedWidth
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user