Skip to content

Commit

Permalink
[widget][theme] use warningOnBackground color instead of warning wher…
Browse files Browse the repository at this point in the history
…e appropriate
  • Loading branch information
toaster committed Jun 22, 2024
1 parent 02db92e commit 7641a44
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion theme/icons.go
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,7 @@ func NewThemedResource(src fyne.Resource) *ThemedResource {
func NewWarningThemedResource(src fyne.Resource) *ThemedResource {
return &ThemedResource{
source: src,
ColorName: ColorNameWarning,
ColorName: ColorNameWarningOnBackground,
}
}

Expand Down
6 changes: 3 additions & 3 deletions theme/icons_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,11 @@ func TestThemedResource_Warning(t *testing.T) {
fyne.CurrentApp().Settings().SetTheme(theme.DarkTheme())
source := helperNewStaticResource()
custom := theme.NewThemedResource(source)
custom.ColorName = theme.ColorNameWarning
custom.ColorName = theme.ColorNameWarningOnBackground

assert.Equal(t, custom.Name(), fmt.Sprintf("warning_%v", source.Name()))
assert.Equal(t, custom.Name(), fmt.Sprintf("warningOnBackground_%v", source.Name()))
custom = theme.NewWarningThemedResource(source)
assert.Equal(t, custom.Name(), fmt.Sprintf("warning_%v", source.Name()))
assert.Equal(t, custom.Name(), fmt.Sprintf("warningOnBackground_%v", source.Name()))
}

func TestDisabledResource_Name(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion widget/label.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ func (l *Label) syncSegments() {
case DangerImportance:
color = theme.ColorNameErrorOnBackground
case WarningImportance:
color = theme.ColorNameWarning
color = theme.ColorNameWarningOnBackground
case SuccessImportance:
color = theme.ColorNameSuccessOnBackground
default:
Expand Down
Binary file modified widget/testdata/label/label_importance_warning.png
Loading
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 7641a44

Please sign in to comment.