Add accessible value updates to processing progress bar

Screen readers now announce progress bar value with descriptive
text like "Processing 5 of 47: sunset.jpg" during batch processing,
instead of just reporting the fraction.
This commit is contained in:
2026-03-06 13:53:32 +02:00
parent abd794b3b9
commit b79ce58338

View File

@@ -1258,8 +1258,15 @@ fn run_processing(_window: &adw::ApplicationWindow, ui: &WizardUi) {
file, file,
} => { } => {
if let Some(ref bar) = progress_bar { if let Some(ref bar) = progress_bar {
bar.set_fraction(current as f64 / total as f64); let frac = current as f64 / total as f64;
bar.set_fraction(frac);
bar.set_text(Some(&format!("{}/{} - {}", current, total, file))); bar.set_text(Some(&format!("{}/{} - {}", current, total, file)));
bar.update_property(&[
gtk::accessible::Property::ValueNow(frac * 100.0),
gtk::accessible::Property::ValueText(
&format!("Processing {} of {}: {}", current, total, file)
),
]);
} }
let eta = calculate_eta(&start_time, current, total); let eta = calculate_eta(&start_time, current, total);
update_progress_labels(&ui_for_rx.nav_view, current, total, &file, &eta); update_progress_labels(&ui_for_rx.nav_view, current, total, &file, &eta);