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

Remove dependency on tts (#3651)

We were using [`tts`](https://github.com/ndarilek/tts-rs) for the
web-only screen reader. This was overkill, to say the least. It is now
replaced with ten lines of `web-sys` calls.
This commit is contained in:
Emil Ernerfeldt
2023-11-28 10:46:18 +01:00
committed by GitHub
parent 8494cf854c
commit a1f3c71b7f
9 changed files with 29 additions and 303 deletions

View File

@@ -19,7 +19,7 @@ crate-type = ["cdylib", "rlib"]
default = ["glow", "persistence"]
# image_viewer adds about 0.9 MB of WASM
web_app = ["http", "persistence", "web_screen_reader"]
web_app = ["http", "persistence"]
http = ["ehttp", "image", "poll-promise", "egui_extras/image"]
image_viewer = ["image", "egui_extras/all_loaders", "rfd"]
@@ -27,7 +27,6 @@ persistence = ["eframe/persistence", "egui/persistence", "serde"]
puffin = ["eframe/puffin", "dep:puffin", "dep:puffin_http"]
serde = ["dep:serde", "egui_demo_lib/serde", "egui/serde"]
syntect = ["egui_demo_lib/syntect"]
web_screen_reader = ["eframe/web_screen_reader"] # experimental
glow = ["eframe/glow"]
wgpu = ["eframe/wgpu", "bytemuck"]
@@ -37,7 +36,9 @@ chrono = { version = "0.4", default-features = false, features = [
"js-sys",
"wasmbind",
] }
eframe = { version = "0.24.0", path = "../eframe", default-features = false }
eframe = { version = "0.24.0", path = "../eframe", default-features = false, features = [
"web_screen_reader",
] }
egui = { version = "0.24.0", path = "../egui", features = [
"callstack",
"extra_debug_asserts",

View File

@@ -94,15 +94,12 @@ impl BackendPanel {
self.egui_windows.checkboxes(ui);
#[cfg(debug_assertions)]
{
if ui.ctx().style().debug.debug_on_hover_with_all_modifiers {
ui.separator();
if ui.ctx().style().debug.debug_on_hover_with_all_modifiers {
ui.label("Press down all modifiers and hover a widget to see a callstack for it");
}
ui.label("Press down all modifiers and hover a widget to see a callstack for it");
}
#[cfg(target_arch = "wasm32")]
#[cfg(feature = "web_screen-reader")]
{
ui.separator();
let mut screen_reader = ui.ctx().options(|o| o.screen_reader);