mirror of https://github.com/rivo/tview.git
This commit is contained in:
parent
a8dd8799d6
commit
e4c497cc59
|
@ -207,10 +207,9 @@ func (d *DropDown) SetPrefixTextColor(color tcell.Color) *DropDown {
|
||||||
// as well as selected items). Style attributes are currently ignored but may be
|
// as well as selected items). Style attributes are currently ignored but may be
|
||||||
// used in the future.
|
// used in the future.
|
||||||
func (d *DropDown) SetListStyles(unselected, selected tcell.Style) *DropDown {
|
func (d *DropDown) SetListStyles(unselected, selected tcell.Style) *DropDown {
|
||||||
fg, bg, _ := unselected.Decompose()
|
d.list.SetMainTextStyle(unselected).SetSelectedStyle(selected)
|
||||||
d.list.SetMainTextColor(fg).SetBackgroundColor(bg)
|
_, bg, _ := unselected.Decompose()
|
||||||
fg, bg, _ = selected.Decompose()
|
d.list.SetBackgroundColor(bg)
|
||||||
d.list.SetSelectedTextColor(fg).SetSelectedBackgroundColor(bg)
|
|
||||||
return d
|
return d
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue