Keep a brush channel card's name from reading as unavailable

The Material section's channel cards mark their top row as a disabled
label, so a screen reader announced "Metallic: Uniform" as unavailable
although the card's reset and its value row answer. The row is a label
that picks nothing, not a disabled control.
This commit is contained in:
Rebornim committed 2026-11-27 08:39:51 +00:00
1 parent 9a871c0c06
commit 8f50db09f6
2 files changed
+10 -1

No files matched your search

+1 -1
View File
@@ -122,7 +122,7 @@ impl PropertySheet<'_> {
});
} else {
// A label's words are its value, so the name and source read as one
pick.widget_info(|| egui::WidgetInfo::labeled(egui::Role::Label, false, format!("{name}: {source}")));
pick.widget_info(|| egui::WidgetInfo::labeled(egui::Role::Label, true, format!("{name}: {source}")));
}
let mut result = SlotResponse { pick, clear: false, reset: false, toggled: false };
+9
View File
@@ -89,3 +89,12 @@ fn the_eraser_picks_its_channels_without_value_cards() {
assert!(harness.query_by_role_and_label(Role::Button, "Base color").is_none(), "the eraser paints no colour");
assert!(harness.query_by_role_and_label(Role::Slider, "Roughness").is_none());
}
#[test]
fn a_channel_cards_name_is_not_read_as_unavailable() {
let harness = material_section("paint");
let named = |node: &egui_kittest::Node<'_>| node.accesskit_node().value().is_some_and(|value| value.starts_with("Metallic: "));
let card = harness.query_all_by_role(Role::Label).find(named).unwrap();
assert!(!card.accesskit_node().is_disabled(), "the card's reset and value row answer, so its name must not read as unavailable");
}