1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-31 05:40:03 -04:00

Add checkbox in demo app to turn screen reader on/off

This commit is contained in:
Emil Ernerfeldt
2021-03-24 21:35:29 +01:00
parent cbe6faa83b
commit 70c6f4596a
7 changed files with 32 additions and 9 deletions

View File

@@ -315,9 +315,17 @@ impl BackendPanel {
}
}
let mut screen_reader = ui.ctx().memory().options.screen_reader;
ui.checkbox(&mut screen_reader, "Screen reader").on_hover_text("Experimental feature: checking this will turn on the screen reader on supported platforms");
ui.ctx().memory().options.screen_reader = screen_reader;
ui.collapsing("Output events", |ui| {
ui.set_max_width(450.0);
ui.label("Recent output events from egui:");
ui.label(
"Recent output events from egui. \
These are emitted when you switch selected widget with tab, \
and can be hooked up to a screen reader on supported platforms.",
);
ui.advance_cursor(8.0);
for event in &self.output_event_history {
ui.label(format!("{:?}", event));