Add What's New dialog, accessibility labels, focus management
This commit is contained in:
@@ -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())
|
||||
),
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user