Skip to content

Commit

Permalink
respect user-set button icon color for Medium importance
Browse files Browse the repository at this point in the history
  • Loading branch information
dweymouth committed May 27, 2024
1 parent 09c078f commit 29b7614
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions widget/button.go
Original file line number Diff line number Diff line change
Expand Up @@ -337,9 +337,11 @@ func (r *buttonRenderer) applyTheme() {
r.label.Refresh()
if r.icon != nil && r.icon.Resource != nil {
icon := r.icon.Resource
if thRes, ok := icon.(fyne.ThemedResource); ok {
if thRes.ThemeColorName() != fgColorName {
icon = theme.NewColoredResource(icon, fgColorName)
if r.button.Importance != MediumImportance {
if thRes, ok := icon.(fyne.ThemedResource); ok {
if thRes.ThemeColorName() != fgColorName {
icon = theme.NewColoredResource(icon, fgColorName)
}
}
}
r.icon.Resource = cache.OverrideResourceTheme(icon, r.button)
Expand Down

0 comments on commit 29b7614

Please sign in to comment.