Add What's New dialog, accessibility labels, focus management

This commit is contained in:
2026-03-06 13:13:39 +02:00
parent 36e291e486
commit dbc215f0ad
2 changed files with 106 additions and 0 deletions

View File

@@ -27,6 +27,10 @@ impl StepIndicator {
.margin_end(12)
.build();
container.update_property(&[
gtk::accessible::Property::Label("Wizard step indicator"),
]);
let mut dots = Vec::new();
for (i, name) in step_names.iter().enumerate() {
@@ -93,14 +97,26 @@ impl StepIndicator {
pub fn set_current(&self, index: usize) {
let dots = self.dots.borrow();
let total = dots.len();
for (i, dot) in dots.iter().enumerate() {
if i == index {
dot.icon.set_icon_name(Some("radio-checked-symbolic"));
dot.button.set_sensitive(true);
dot.label.add_css_class("accent");
// Update accessible description for screen readers
dot.button.update_property(&[
gtk::accessible::Property::Label(
&format!("Step {} of {}: {} (current)", i + 1, total, dot.label.label())
),
]);
} else if dot.icon.icon_name().as_deref() != Some("emblem-ok-symbolic") {
dot.icon.set_icon_name(Some("radio-symbolic"));
dot.label.remove_css_class("accent");
dot.button.update_property(&[
gtk::accessible::Property::Label(
&format!("Step {} of {}: {}", i + 1, total, dot.label.label())
),
]);
}
}
}