Skip to content

Disabled button does not fade emoji (bitmap glyph) text content #6383

Description

@mohsenm4

Context

Spun off from #6217 — that issue mixed two related problems:

  1. PNG/bitmap icon resource on a disabled button is not faded — being addressed in Fade disabled button icon when resource is a bitmap (#6217) #6381.
  2. Emoji glyphs in disabled button text are not faded — this issue.

Describe the bug

A button whose text is an emoji (e.g. 🔝) stays at full brightness when disabled. Regular text glyphs and Unicode triangle () get colored with theme.ColorNameDisabled correctly, but emoji is rasterised by the font fallback (see comment from @andydotxyz on #6217) so it doesn't honor the text color.

How to reproduce

package main

import (
    "fyne.io/fyne/v2/app"
    "fyne.io/fyne/v2/container"
    "fyne.io/fyne/v2/widget"
)

func main() {
    a := app.New()
    w := a.NewWindow("Disable test")

    btn1 := widget.NewButton("🔝", nil)
    btn2 := widget.NewButton("▲", nil)

    btn1.Disable()
    btn2.Disable()

    w.SetContent(container.NewHBox(btn1, btn2))
    w.ShowAndRun()
}

btn2 () appears grayed out, btn1 (🔝) does not.

Why this needs a separate PR

The fix lives in the text/painter pipeline rather than the button renderer: emoji glyphs are drawn through the emoji font fallback in internal/painter/font.go, and a fade or grayscale would need to be propagated from the parent disabled state into the painter. The bitmap-icon fix in #6381 only covers Button.Icon and explicitly leaves this part out of scope.

Fyne version

develop branch (as of #6381).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions