Fix highlighting focused Form element

Resolves #51.
This commit is contained in:
Trevor Slocum 2021-01-07 14:58:59 -08:00
parent 3bd98fd55f
commit c5777645c9
2 changed files with 5 additions and 4 deletions

View File

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

View File

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