Skip to content

Toggle hover color overrides active state (Makepad upstream bug) #78

@TigerInYourDream

Description

@TigerInYourDream

Problem

When a Toggle is in the ON (active) state and the user hovers over it, the pill color briefly flashes gray instead of staying blue. This makes the toggle appear broken on hover.

Root Cause

Makepad's Toggle pixel shader in widgets2/src/check_box.rs has an incorrect mix chain order:

// color_fill: active → hover (hover overrides active — BUG)
.mix(self.color_active, self.active)
.mix(self.color_hover, self.hover)    // ← overwrites active color

// mark_color: hover → active (active overrides hover — CORRECT)
.mix(self.mark_color_hover, self.hover)
.mix(self.mark_color_active, self.active)

The color_fill and color_stroke chains have hover after active, causing hover to unconditionally override the active state color. Meanwhile mark_color correctly has active after hover.

Fix

Swap the hover and active lines in color_fill and color_stroke mix chains to match mark_color order.

Upstream PR

PR submitted to makepad/makepad (link TBD).

Affected Robrix UI

  • Settings → Labs → App Service toggle
  • Settings → Labs → Translation toggle

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions