Browse Source

Fix highlighting focused Form element

Resolves #51.
master
Trevor Slocum 2 years ago
parent
commit
c5777645c9
  1. 1
      CHANGELOG
  2. 8
      form.go

1
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

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

Loading…
Cancel
Save