You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
macOS: textSetColor is a no-op on a Text label (padding cell bakes attributedStringValue, overriding setTextColor:) #10856
On macOS, textSetColor has no visible effect on a Text() label. The label always renders in the default labelColor (white in dark appearance), regardless of the color passed.
Cause
Text() creates an NSTextField.labelWithString (crates/perry-ui-macos/src/widgets/text.rs), then install_label_cell (crates/perry-ui-macos/src/widgets/padding.rs:208) captures and re-sets the field's attributedStringValue (line 219). An NSTextField with an attributedStringValue ignores setTextColor: — the attributed string's baked-in color attribute (the default labelColor) wins. So perry_ui_text_set_color → setTextColor: is silently overridden.
Reproduce
macOS, Perry 0.5.1622 (local build), Darwin 25.6.0 arm64.
const t = Text("hi"); textSetFontSize(t, 40); textSetColor(t, 1, 0, 0, 1) on a white background.
The label renders in the default color (white in dark appearance / invisible on white), not red. A pure-red, -green, -blue label all render white on a dark background — the color argument is ignored entirely.
Expected
textSetColor colors the label.
Workaround
Re-set the string after coloring (textSetString(widget, text)), which replaces the stale attributedStringValue with a plain stringValue, so textColor applies.
Suggested fix
Have set_color (and the other text setters) update the attributed string's color attribute when the label carries an attributedStringValue, or have install_label_cell not bake a color attribute into it.
Fixed on main. PR #10862 landed in merge train 251 as 62b71c8664 ("fix(ui-macos): textSetColor no longer a no-op on a Text label").
Its Fixes #10856 never fired because trains rebase-merge: the source PR is closed as landed rather than merged, so GitHub doesn't run its close keywords. Closing by hand.
Activity
proggeramlug commentedon Sep 22, 2026
Fixed on main. PR #10862 landed in merge train 251 as
62b71c8664("fix(ui-macos): textSetColor no longer a no-op on a Text label").Its
Fixes #10856never fired because trains rebase-merge: the source PR is closed as landed rather than merged, so GitHub doesn't run its close keywords. Closing by hand.