Add accessible labels to sliders and watermark position grid

Screen readers now announce the purpose and range of brightness,
contrast, saturation, and compression quality sliders. The
watermark position grid frame also has a descriptive label.
This commit is contained in:
2026-03-06 13:51:01 +02:00
parent bcf57927e9
commit be081307c4
3 changed files with 15 additions and 0 deletions

View File

@@ -111,6 +111,9 @@ pub fn build_adjustments_page(state: &AppState) -> adw::NavigationPage {
brightness_scale.set_valign(gtk::Align::Center);
brightness_scale.set_size_request(200, -1);
brightness_scale.set_draw_value(false);
brightness_scale.update_property(&[
gtk::accessible::Property::Label("Brightness adjustment, -100 to +100"),
]);
brightness_row.add_suffix(&brightness_scale);
adjust_expander.add_row(&brightness_row);
@@ -125,6 +128,9 @@ pub fn build_adjustments_page(state: &AppState) -> adw::NavigationPage {
contrast_scale.set_valign(gtk::Align::Center);
contrast_scale.set_size_request(200, -1);
contrast_scale.set_draw_value(false);
contrast_scale.update_property(&[
gtk::accessible::Property::Label("Contrast adjustment, -100 to +100"),
]);
contrast_row.add_suffix(&contrast_scale);
adjust_expander.add_row(&contrast_row);
@@ -139,6 +145,9 @@ pub fn build_adjustments_page(state: &AppState) -> adw::NavigationPage {
saturation_scale.set_valign(gtk::Align::Center);
saturation_scale.set_size_request(200, -1);
saturation_scale.set_draw_value(false);
saturation_scale.update_property(&[
gtk::accessible::Property::Label("Saturation adjustment, -100 to +100"),
]);
saturation_row.add_suffix(&saturation_scale);
adjust_expander.add_row(&saturation_row);

View File

@@ -57,6 +57,9 @@ pub fn build_compress_page(state: &AppState) -> adw::NavigationPage {
quality_scale.add_mark(3.0, gtk::PositionType::Bottom, Some("Medium"));
quality_scale.add_mark(4.0, gtk::PositionType::Bottom, Some("High"));
quality_scale.add_mark(5.0, gtk::PositionType::Bottom, Some("Maximum"));
quality_scale.update_property(&[
gtk::accessible::Property::Label("Compression quality, from Web Optimized to Maximum"),
]);
let quality_label = gtk::Label::builder()
.label(quality_description(initial_val as u32))

View File

@@ -120,6 +120,9 @@ pub fn build_watermark_page(state: &AppState) -> adw::NavigationPage {
.halign(gtk::Align::Center)
.build();
grid_frame.set_child(Some(&grid));
grid_frame.update_property(&[
gtk::accessible::Property::Label("Watermark position grid. Select where the watermark appears on the image."),
]);
let mut first_button: Option<gtk::ToggleButton> = None;
let buttons: Vec<gtk::ToggleButton> = position_names.iter().enumerate().map(|(i, name)| {