Skip to content

Commit

Permalink
don't keep logging errors for disabled buttons with bitmap icon
Browse files Browse the repository at this point in the history
  • Loading branch information
andydotxyz committed Jun 22, 2024
1 parent 9af6b77 commit c134cd1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion widget/button.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"fyne.io/fyne/v2/canvas"
"fyne.io/fyne/v2/driver/desktop"
col "fyne.io/fyne/v2/internal/color"
"fyne.io/fyne/v2/internal/svg"
"fyne.io/fyne/v2/internal/widget"
"fyne.io/fyne/v2/layout"
"fyne.io/fyne/v2/theme"
Expand Down Expand Up @@ -399,7 +400,8 @@ func (r *buttonRenderer) updateIconAndText() {
r.icon.FillMode = canvas.ImageFillContain
r.SetObjects([]fyne.CanvasObject{r.background, r.tapBG, r.label, r.icon})
}
if r.button.Disabled() {
// TODO support disabling bitmap resource not just SVG
if r.button.Disabled() && svg.IsResourceSVG(icon) {
icon = theme.NewDisabledResource(icon)
}
r.icon.Resource = icon
Expand Down

0 comments on commit c134cd1

Please sign in to comment.