From c5777645c9c4f7c769f4731b1040f7291b3f4acf Mon Sep 17 00:00:00 2001 From: Trevor Slocum Date: Thu, 7 Jan 2021 14:58:59 -0800 Subject: [PATCH] Fix highlighting focused Form element Resolves #51. --- CHANGELOG | 1 + form.go | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index e7d3365..201e789 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,6 @@ v1.5.3 (WIP) - Document how to prevent screen artifacts when using SetBackgroundTransparent +- Fix highlighting focused Form element - Fix incorrect TabbedPanels colors - Preserve order of panels when updating panel diff --git a/form.go b/form.go index 96bc73a..7260ada 100644 --- a/form.go +++ b/form.go @@ -154,12 +154,12 @@ func NewForm() *Form { fieldBackgroundColor: Styles.ContrastBackgroundColor, fieldTextColor: Styles.PrimaryTextColor, buttonBackgroundColor: Styles.ContrastBackgroundColor, - buttonTextColor: Styles.PrimaryTextColor, buttonBackgroundColorFocused: Styles.PrimaryTextColor, + buttonTextColor: Styles.PrimaryTextColor, buttonTextColorFocused: Styles.InverseTextColor, labelColorFocused: ColorUnset, - fieldBackgroundColorFocused: ColorUnset, fieldTextColorFocused: ColorUnset, + fieldBackgroundColorFocused: ColorUnset, } f.focus = f @@ -627,12 +627,12 @@ func (f *Form) getAttributes() *FormItemAttributes { attrs.LabelColorFocused = f.labelColorFocused } if f.fieldBackgroundColorFocused == ColorUnset { - attrs.FieldBackgroundColorFocused = f.fieldBackgroundColor + attrs.FieldBackgroundColorFocused = f.fieldTextColor } else { attrs.FieldBackgroundColorFocused = f.fieldBackgroundColorFocused } if f.fieldTextColorFocused == ColorUnset { - attrs.FieldTextColorFocused = f.fieldTextColor + attrs.FieldTextColorFocused = f.fieldBackgroundColor } else { attrs.FieldTextColorFocused = f.fieldTextColorFocused }