pub enum A11yOffScreenMode {
AllItems,
ViewportPlusN {
n: u32,
},
ViewportOnly,
}Expand description
Off-screen visibility policy for the AT walker. Decides which scene items get emitted as synthetic AT nodes per AT-rebuild.
ViewportPlusN { n: 1 } is the default: an item appears in the
AT tree if its bounds_in_scene intersects viewport ∪ (1× viewport-grown-rect). That keeps the tree close to “what the
user can interact with right now” while letting screen-reader
users discover items just outside the visible region by jumping
to the next/prev — at which point SceneView::ensure_visible
pans the view to bring the focused item into view.
Variants§
AllItems
Emit every item in the scene as a synthetic AT node. Heaviest mode — appropriate for small scenes (< ~500 items) where AT users want a complete table of contents.
ViewportPlusN
Emit items inside the viewport plus an n × viewport-grown
margin around it. n = 0 collapses to “viewport only” with
the same allocation pattern as ViewportOnly. n = 1 is
the default — gives screen-reader users a one-screen
“lookahead” to navigate without ensure_visible round-tripping
through pan animation.
ViewportOnly
Strict: only items intersecting the current viewport. Pairs with apps that have very large scenes where listing off-screen content would overwhelm AT clients.
Implementations§
Source§impl A11yOffScreenMode
impl A11yOffScreenMode
Sourcepub fn at_visible_region(&self, visible_scene_region: Rect) -> Option<Rect>
pub fn at_visible_region(&self, visible_scene_region: Rect) -> Option<Rect>
Compute the scene-coord rectangle a given mode considers
“AT-visible” given the current visible scene region. Used by
SceneView::accessibility as the spatial-index query rect.
AllItems returns None so the caller knows to bypass the
query and emit every item.
Trait Implementations§
Source§impl Clone for A11yOffScreenMode
impl Clone for A11yOffScreenMode
Source§fn clone(&self) -> A11yOffScreenMode
fn clone(&self) -> A11yOffScreenMode
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for A11yOffScreenMode
Source§impl Debug for A11yOffScreenMode
impl Debug for A11yOffScreenMode
Auto Trait Implementations§
impl Freeze for A11yOffScreenMode
impl RefUnwindSafe for A11yOffScreenMode
impl Send for A11yOffScreenMode
impl Sync for A11yOffScreenMode
impl Unpin for A11yOffScreenMode
impl UnsafeUnpin for A11yOffScreenMode
impl UnwindSafe for A11yOffScreenMode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> ErasedDestructor for Twhere
T: 'static,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more