mirror of
https://github.com/gizak/termui.git
synced 2025-04-24 13:48:50 +08:00
Merge 2b1178ddc3f3aa7e599ea7f0d5458663ba963420 into 2b8f0c7960e9553acea6d579a740713066da5e13
This commit is contained in:
commit
4498d4f81d
@ -63,7 +63,7 @@ func readStyle(runes []rune, defaultStyle Style) Style {
|
||||
case tokenBg:
|
||||
style.Bg = StyleParserColorMap[pair[1]]
|
||||
case tokenModifier:
|
||||
style.Modifier = modifierMap[pair[1]]
|
||||
style.Modifier |= modifierMap[pair[1]]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -44,15 +44,17 @@ func (self *List) Draw(buf *Buffer) {
|
||||
|
||||
// draw rows
|
||||
for row := self.topRow; row < len(self.Rows) && point.Y < self.Inner.Max.Y; row++ {
|
||||
cells := ParseStyles(self.Rows[row], self.TextStyle)
|
||||
var cells []Cell
|
||||
if row == self.SelectedRow {
|
||||
cells = ParseStyles(self.Rows[row], self.SelectedRowStyle)
|
||||
} else {
|
||||
cells = ParseStyles(self.Rows[row], self.TextStyle)
|
||||
}
|
||||
if self.WrapText {
|
||||
cells = WrapCells(cells, uint(self.Inner.Dx()))
|
||||
}
|
||||
for j := 0; j < len(cells) && point.Y < self.Inner.Max.Y; j++ {
|
||||
style := cells[j].Style
|
||||
if row == self.SelectedRow {
|
||||
style = self.SelectedRowStyle
|
||||
}
|
||||
if cells[j].Rune == '\n' {
|
||||
point = image.Pt(self.Inner.Min.X, point.Y+1)
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user