fix(form/Draw): Use button colors for focused state

This commit is contained in:
Andreas Bieber 2020-09-17 13:22:45 +02:00
parent 367d377081
commit 128c6692d4
1 changed files with 3 additions and 2 deletions

View File

@ -687,8 +687,8 @@ func (f *Form) Draw(screen tcell.Screen) {
buttonWidth = space
}
button.SetLabelColor(f.buttonTextColor).
SetLabelColorFocused(f.buttonBackgroundColor).
SetBackgroundColorFocused(f.buttonTextColor).
SetLabelColorFocused(f.buttonTextColorFocused).
SetBackgroundColorFocused(f.buttonBackgroundColorFocused).
SetBackgroundColor(f.buttonBackgroundColor)
buttonIndex := index + len(f.items)
@ -735,6 +735,7 @@ func (f *Form) Draw(screen tcell.Screen) {
// Draw buttons.
for index, button := range f.buttons {
// Set position.
buttonIndex := index + len(f.items)
y := positions[buttonIndex].y - offset