From e4c497cc59ed2f1b8eea43ef37456edc63e21749 Mon Sep 17 00:00:00 2001 From: Oliver <480930+rivo@users.noreply.github.com> Date: Wed, 7 Aug 2024 22:51:29 +0200 Subject: [PATCH] Using styles instead of colours for drop-down lists. Fixes #993, fixes #990 --- dropdown.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/dropdown.go b/dropdown.go index 22a6013..3bef0ac 100644 --- a/dropdown.go +++ b/dropdown.go @@ -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 // used in the future. func (d *DropDown) SetListStyles(unselected, selected tcell.Style) *DropDown { - fg, bg, _ := unselected.Decompose() - d.list.SetMainTextColor(fg).SetBackgroundColor(bg) - fg, bg, _ = selected.Decompose() - d.list.SetSelectedTextColor(fg).SetSelectedBackgroundColor(bg) + d.list.SetMainTextStyle(unselected).SetSelectedStyle(selected) + _, bg, _ := unselected.Decompose() + d.list.SetBackgroundColor(bg) return d }