diff --git a/widget/button.go b/widget/button.go index fdd317a14d..62ccad2a37 100644 --- a/widget/button.go +++ b/widget/button.go @@ -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" @@ -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