1
0
mirror of https://github.com/emilk/egui.git synced 2026-09-01 06:10:06 -04:00

Disabled widgets are now also disabled in the accesskit output (#4750)

Marking widgets as disabled was not reflected in the accesskit output,
now the disabled status should match.

---------

Co-authored-by: Wybe Westra <w.westra@kwantcontrols.nl>
This commit is contained in:
Wybe Westra
2024-07-02 09:18:30 +02:00
committed by GitHub
parent fcec84ca74
commit fa8d535fe7
18 changed files with 165 additions and 72 deletions

View File

@@ -38,7 +38,9 @@ pub fn toggle_ui(ui: &mut egui::Ui, on: &mut bool) -> egui::Response {
}
// Attach some meta-data to the response which can be used by screen readers:
response.widget_info(|| egui::WidgetInfo::selected(egui::WidgetType::Checkbox, *on, ""));
response.widget_info(|| {
egui::WidgetInfo::selected(egui::WidgetType::Checkbox, ui.is_enabled(), *on, "")
});
// 4. Paint!
// Make sure we need to paint:
@@ -77,7 +79,9 @@ fn toggle_ui_compact(ui: &mut egui::Ui, on: &mut bool) -> egui::Response {
*on = !*on;
response.mark_changed();
}
response.widget_info(|| egui::WidgetInfo::selected(egui::WidgetType::Checkbox, *on, ""));
response.widget_info(|| {
egui::WidgetInfo::selected(egui::WidgetType::Checkbox, ui.is_enabled(), *on, "")
});
if ui.is_rect_visible(rect) {
let how_on = ui.ctx().animate_bool_responsive(response.id, *on);