diff --git a/packages/dioxus-blitz/Cargo.toml b/packages/dioxus-blitz/Cargo.toml index 94ada8f7..1dbf7a47 100644 --- a/packages/dioxus-blitz/Cargo.toml +++ b/packages/dioxus-blitz/Cargo.toml @@ -4,9 +4,9 @@ version = "0.0.0" edition = "2021" [features] -accesskit = ["dep:accesskit", "dep:accesskit_winit"] +accessibility = ["dep:accesskit", "dep:accesskit_winit"] hot-reload = [] -default = ["accesskit"] +default = ["accessibility"] [dependencies] accesskit = { version = "0.15.0", optional = true } diff --git a/packages/dioxus-blitz/src/accessibility.rs b/packages/dioxus-blitz/src/accessibility.rs index 57033756..c91262a6 100644 --- a/packages/dioxus-blitz/src/accessibility.rs +++ b/packages/dioxus-blitz/src/accessibility.rs @@ -53,7 +53,7 @@ impl AccessibilityState { self.adapter.update_if_active(|| tree_update) } - #[cfg(feature = "accesskit")] + #[cfg(feature = "accessibility")] fn build_node(&mut self, node: &Node) -> (accesskit::NodeId, accesskit::NodeBuilder) { let mut node_builder = accesskit::NodeBuilder::default(); if let Some(element_data) = node.element_data() { diff --git a/packages/dioxus-blitz/src/lib.rs b/packages/dioxus-blitz/src/lib.rs index b62d2ce2..67b3350e 100644 --- a/packages/dioxus-blitz/src/lib.rs +++ b/packages/dioxus-blitz/src/lib.rs @@ -2,7 +2,7 @@ mod documents; mod waker; mod window; -#[cfg(feature = "accesskit")] +#[cfg(feature = "accessibility")] mod accessibility; use crate::waker::{EventData, UserEvent}; @@ -191,7 +191,7 @@ fn launch_with_window(window: View<'static, Doc>) { } }; } - #[cfg(feature = "accesskit")] + #[cfg(feature = "accessibility")] UserEvent::Accessibility(accessibility_event) => { if let Some(window) = windows.get_mut(&accessibility_event.window_id) { window.handle_accessibility_event(&accessibility_event.window_event); diff --git a/packages/dioxus-blitz/src/waker.rs b/packages/dioxus-blitz/src/waker.rs index 9398dd67..962fe039 100644 --- a/packages/dioxus-blitz/src/waker.rs +++ b/packages/dioxus-blitz/src/waker.rs @@ -2,7 +2,7 @@ use futures_util::task::ArcWake; use std::sync::Arc; use winit::{event_loop::EventLoopProxy, window::WindowId}; -#[cfg(feature = "accesskit")] +#[cfg(feature = "accessibility")] use accesskit_winit::Event as AccessibilityEvent; #[derive(Debug, Clone)] @@ -13,7 +13,7 @@ pub enum UserEvent { }, /// An accessibility event from `accesskit`. - #[cfg(feature = "accesskit")] + #[cfg(feature = "accessibility")] Accessibility(Arc), /// A hotreload event, basically telling us to update our templates. @@ -26,7 +26,7 @@ pub enum UserEvent { HotReloadEvent(dioxus_hot_reload::HotReloadMsg), } -#[cfg(feature = "accesskit")] +#[cfg(feature = "accessibility")] impl From for UserEvent { fn from(value: AccessibilityEvent) -> Self { Self::Accessibility(Arc::new(value)) diff --git a/packages/dioxus-blitz/src/window.rs b/packages/dioxus-blitz/src/window.rs index 42e31099..a102bd3b 100644 --- a/packages/dioxus-blitz/src/window.rs +++ b/packages/dioxus-blitz/src/window.rs @@ -17,7 +17,7 @@ use winit::event_loop::{ActiveEventLoop, EventLoopProxy}; use winit::{event::WindowEvent, keyboard::KeyCode, keyboard::ModifiersState, window::Window}; struct State { - #[cfg(feature = "accesskit")] + #[cfg(feature = "accessibility")] /// Accessibility adapter for `accesskit`. accessibility: crate::accessibility::AccessibilityState, @@ -56,7 +56,7 @@ impl<'a, Doc: DocumentLike> View<'a, Doc> { Some(waker) => { let cx = std::task::Context::from_waker(waker); if self.renderer.poll(cx) { - #[cfg(feature = "accesskit")] + #[cfg(feature = "accessibility")] { if let Some(ref mut state) = self.state { // TODO send fine grained accessibility tree updates. @@ -293,7 +293,7 @@ impl<'a, Doc: DocumentLike> View<'a, Doc> { } } - #[cfg(feature = "accesskit")] + #[cfg(feature = "accessibility")] pub fn handle_accessibility_event(&mut self, event: &accesskit_winit::WindowEvent) { match event { accesskit_winit::WindowEvent::InitialTreeRequested => { @@ -330,7 +330,7 @@ impl<'a, Doc: DocumentLike> View<'a, Doc> { &window, ); self.state = Some(State { - #[cfg(feature = "accesskit")] + #[cfg(feature = "accessibility")] accessibility: crate::accessibility::AccessibilityState::new( &window, proxy.clone(),