Using styles instead of colours for drop-down lists. Fixes #993, fixes #990

This commit is contained in:
Oliver 2024-08-07 22:51:29 +02:00
parent a8dd8799d6
commit e4c497cc59
1 changed files with 3 additions and 4 deletions

View File

@ -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
} }