Skip to content

Commit

Permalink
Fix issue where non-disablable form items would not update label colour
Browse files Browse the repository at this point in the history
Fixes #2810
  • Loading branch information
andydotxyz committed Mar 3, 2022
1 parent 51bcc90 commit cd997be
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions widget/form.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,8 @@ func (f *Form) updateLabels() {
} else {
l.Color = theme.ForegroundColor()
}
} else {
l.Color = theme.ForegroundColor()
}

l.Text = item.Text
Expand Down
2 changes: 1 addition & 1 deletion widget/form_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ func TestForm_ChangeTheme(t *testing.T) {
form := &Form{
Items: []*FormItem{
{Text: "test1", Widget: NewEntry()},
{Text: "test2", Widget: NewEntry()},
{Text: "test2", Widget: NewLabel("static")},
},
OnSubmit: func() {}, OnCancel: func() {}}
w := test.NewWindow(form)
Expand Down
Binary file modified widget/testdata/form/theme_changed.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified widget/testdata/form/theme_initial.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit cd997be

Please sign in to comment.