mirror of
https://github.com/storytold/texturecraft.git
synced 2026-11-30 10:03:56 +01:00
Name the view camera and view mode pickers for screen readers
Both boxes showed only their value, so they had no accessible name. Once the window settles, the accessibility check fails on them in a short window (rail::history_actions_remain_reachable_in_a_short_window).
This commit is contained in:
1 parent
ccf2ad6b52
commit
9d6531c43f
2 files changed
+14
-2
No files matched your search
@@ -76,7 +76,7 @@ pub(crate) fn show(app: &mut TextureCraftApp, child: &mut Ui, id_salt: &str, wid
|
||||
// The picker stays greyed without project maps
|
||||
let combo = child
|
||||
.add_enabled_ui(project_open, |child| {
|
||||
egui::ComboBox::from_id_salt(id_salt).width(width).height(LIST_HEIGHT).selected_text(label).show_ui(child, |ui| {
|
||||
egui::ComboBox::from_id_salt(id_salt).width(width).height(LIST_HEIGHT).selected_text(label.as_str()).show_ui(child, |ui| {
|
||||
// Bake mode keeps its own list: the material, then the mesh maps, without titles
|
||||
if !baking {
|
||||
section(ui, "Lighting");
|
||||
@@ -135,6 +135,11 @@ pub(crate) fn show(app: &mut TextureCraftApp, child: &mut Ui, id_salt: &str, wid
|
||||
})
|
||||
.inner;
|
||||
|
||||
// The box shows only the mode's name: it is named for what it picks
|
||||
combo.response.widget_info(|| egui::WidgetInfo {
|
||||
current_text_value: Some(label.clone()),
|
||||
..egui::WidgetInfo::labeled(egui::Role::ComboBox, project_open, tr("View mode"))
|
||||
});
|
||||
image_picker(app, &combo.response, popup_id);
|
||||
}
|
||||
|
||||
|
||||
@@ -572,7 +572,7 @@ fn view_header(app: &mut TextureCraftApp, ui: &mut Ui, rect: Rect, id: &str) {
|
||||
let names: Vec<String> = app.session.doc.project.cameras.iter().map(|camera| camera.name.clone()).collect();
|
||||
let shown = current.and_then(|index| names.get(index)).map_or(tr(DEFAULT_CAMERA), String::as_str);
|
||||
if project_open {
|
||||
egui::ComboBox::from_id_salt(format!("{id}_cam")).width(VIEW_PICKER_WIDTH).selected_text(shown).show_ui(&mut child, |ui| {
|
||||
let picker = egui::ComboBox::from_id_salt(format!("{id}_cam")).width(VIEW_PICKER_WIDTH).selected_text(shown).show_ui(&mut child, |ui| {
|
||||
if ui.selectable_label(current.is_none(), tr(DEFAULT_CAMERA)).clicked() {
|
||||
app.run("camera.select", json!({}));
|
||||
}
|
||||
@@ -586,6 +586,13 @@ fn view_header(app: &mut TextureCraftApp, ui: &mut Ui, rect: Rect, id: &str) {
|
||||
app.run("camera.add", json!({}));
|
||||
}
|
||||
});
|
||||
|
||||
// The box shows only the camera's name: it is named for what it picks
|
||||
let enabled = child.is_enabled();
|
||||
picker.response.widget_info(|| egui::WidgetInfo {
|
||||
current_text_value: Some(shown.to_owned()),
|
||||
..egui::WidgetInfo::labeled(egui::Role::ComboBox, enabled, tr("View camera"))
|
||||
});
|
||||
}
|
||||
|
||||
// The 2D view of a UV tile project: a checkable button left of the view mode, with no tooltip, that shows or hides the tile numbers and the hover label
|
||||
|
||||
Reference in new issue
Block a user