mirror of
https://github.com/emilk/egui.git
synced 2026-08-31 22:00:03 -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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user