mirror of
https://github.com/storytold/texturecraft.git
synced 2026-11-30 18:14:00 +01:00
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:
1 parent
9a871c0c06
commit
8f50db09f6
2 files changed
+10
-1
No files matched your search
@@ -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 };
|
||||
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
Reference in new issue
Block a user