Skip to main content

AccessibilityOverrides

Struct AccessibilityOverrides 

Source
pub struct AccessibilityOverrides {
Show 24 fields pub label: Option<Prop<String>>, pub description: Option<Prop<String>>, pub value: Option<Prop<String>>, pub role: Option<Role>, pub hidden: Option<Prop<bool>>, pub disabled: Option<bool>, pub identifier: Option<String>, pub controls: Vec<WidgetId>, pub described_by: Vec<WidgetId>, pub labelled_by: Vec<WidgetId>, pub live: Option<Live>, pub aria_current: Option<AriaCurrent>, pub shortcut: Option<String>, pub shortcut_id: Option<String>, pub has_popup: Option<HasPopup>, pub orientation: Option<Orientation>, pub numeric_value: Option<f64>, pub min_numeric_value: Option<f64>, pub max_numeric_value: Option<f64>, pub numeric_step: Option<f64>, pub actions: Vec<(Action, Box<dyn FnMut(&mut EventContext<'_>)>)>, pub removed_actions: Vec<Action>, pub custom_actions: Vec<(Prop<String>, Box<dyn FnMut(&mut EventContext<'_>)>)>, pub customize: Option<Box<dyn Fn(&mut AccessNodeBuilder)>>,
}
Expand description

Builder-level accessibility overrides.

Carried on HandlerSet during builder-chain construction, mirrored onto WidgetNode::access_overrides at arena insertion (parallel to clips_children / cursor / focus_within_signal), then applied by the accessibility tree walker after the inner widget’s accessibility(&self, builder) runs.

User-visible string fields store a Prop<String> rather than a resolved String, so they stay reactive to locale changes. teksilo-core can’t name LocalizedString (that lives in the downstream teksilo-i18n crate), but Prop<String> is a core type and impl From<LocalizedString> for Prop<String> in teksilo-i18n yields a Prop::Bound over a locale-observing Signal<String>. So .access_label(tr!(save())) stores a bound prop; the accessibility walker reads .get() at AT-build time, and sync_accessibility re-walks on locale change so the announced value follows the locale. The _literal builder variants store Prop::Static and are the #[doc(hidden)] grep markers for explicitly untranslated call sites (the only literal path reachable from within teksilo-core).

Fields§

§label: Option<Prop<String>>§description: Option<Prop<String>>§value: Option<Prop<String>>§role: Option<Role>§hidden: Option<Prop<bool>>

Reactive hidden-from-AT flag. Some(prop) where the prop reads true hides the node from assistive technologies; false un-sets a hidden state the inner widget emitted unconditionally. Bound props are registered at AccessibilityOnly so the AT tree re-walks when they flip (see the insertion paths in widget_tree.rs).

§disabled: Option<bool>§identifier: Option<String>§controls: Vec<WidgetId>§described_by: Vec<WidgetId>§labelled_by: Vec<WidgetId>§live: Option<Live>§aria_current: Option<AriaCurrent>§shortcut: Option<String>

Pre-formatted shortcut announcement string (e.g. "Ctrl+S"). Used by access_shortcut_literal. For chords routed through a Shortcut registration, prefer access_shortcut_id (stored in shortcut_id) so the announcement tracks rebinds.

§shortcut_id: Option<String>

Registered shortcut id (e.g. "app.save"). The accessibility walker resolves the current keystroke from WidgetTree::shortcut_registry() at AT-build time and writes the formatted string to Node::keyboard_shortcut. Refreshes automatically when the user rebinds (the registry’s version signal triggers a re-sync).

§has_popup: Option<HasPopup>§orientation: Option<Orientation>§numeric_value: Option<f64>§min_numeric_value: Option<f64>§max_numeric_value: Option<f64>§numeric_step: Option<f64>§actions: Vec<(Action, Box<dyn FnMut(&mut EventContext<'_>)>)>

Standard accesskit::Action advertisements with their handlers. Dispatched by event_dispatch_impl.rs when handling WidgetEvent::AccessAction, layered on top of any user-installed on_access_action / on_access_action_request handlers (both fire for the same dispatched event).

§removed_actions: Vec<Action>

Actions to remove from the widget-emitted action list (called after the widget’s accessibility() runs, before custom-action emission).

§custom_actions: Vec<(Prop<String>, Box<dyn FnMut(&mut EventContext<'_>)>)>

Custom-named actions (SwiftUI .accessibilityAction(named:_:)). Each entry pairs a (reactive) description prop with a handler. Index in the vec is the stable i32 CustomAction::id exposed to AT software.

§customize: Option<Box<dyn Fn(&mut AccessNodeBuilder)>>

Final escape hatch — invoked last in apply() with full &mut AccessNodeBuilder access (including inner_mut()). Used for sub-node surgery (synthetic children) and for cases the typed surface doesn’t cover.

Trait Implementations§

Source§

impl Debug for AccessibilityOverrides

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for AccessibilityOverrides

Source§

fn default() -> AccessibilityOverrides

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.