pub struct AccessNode { /* private fields */ }Expand description
A node of the accessibility tree: a widget, or a part of one (such as a dock’s tab).
Bits a node does not support are not asked of it: AccessNode::add_action says which
requests it handles.
Implementations§
Source§impl AccessNode
impl AccessNode
Sourcepub fn set_label(&mut self, label: impl Into<String>)
pub fn set_label(&mut self, label: impl Into<String>)
Sets its name, such as a button’s text. Static text goes in
set_value.
Sourcepub fn set_value(&mut self, value: impl Into<String>)
pub fn set_value(&mut self, value: impl Into<String>)
Sets its text content: a label’s text, a text input’s text.
Sourcepub fn set_bounds(&mut self, bounds: Rect)
pub fn set_bounds(&mut self, bounds: Rect)
Sets where it is, in physical pixels from the window’s top-left corner (a widget’s node starts with the widget’s rectangle).
Sourcepub fn add_action(&mut self, action: AccessAction)
pub fn add_action(&mut self, action: AccessAction)
Says it handles action.
Sourcepub fn set_selected(&mut self, selected: bool)
pub fn set_selected(&mut self, selected: bool)
Sets whether it is the chosen one of its kind, such as the shown tab.
Sourcepub fn set_checked(&mut self, checked: bool)
pub fn set_checked(&mut self, checked: bool)
Sets whether it is on, for something that is on or off (a check menu item).
Sourcepub fn set_expanded(&mut self, expanded: bool)
pub fn set_expanded(&mut self, expanded: bool)
Sets whether what it opens is open, for something that opens more (a menu title, an item with a submenu).
Sourcepub fn set_disabled(&mut self, disabled: bool)
pub fn set_disabled(&mut self, disabled: bool)
Sets whether it is unavailable.
Sourcepub fn set_focused_part(&mut self, part: u32)
pub fn set_focused_part(&mut self, part: u32)
Says which of its parts has keyboard focus while the widget does (such as a dock’s chosen tab), so assistive technology reads that part rather than the whole widget.
Sourcepub fn focused_part(&self) -> Option<u32>
pub fn focused_part(&self) -> Option<u32>
The part with keyboard focus while the widget has it.
Sourcepub fn push_part(&mut self, part: u32, node: AccessNode)
pub fn push_part(&mut self, part: u32, node: AccessNode)
Adds node as a part of this one, numbered part: a piece that is not a widget of its
own, such as a tab of a dock. Requests for it come to the widget with that number.
Parts come before the widget’s children. Numbers must be unique within the widget, at
any depth, and at most MAX_PART; a part breaking either rule is left out. Keep a
part’s number while it lasts (number by identity, not by position), or a screen reader
tracking it follows another one.
Sourcepub fn has_action(&self, action: AccessAction) -> bool
pub fn has_action(&self, action: AccessAction) -> bool
Whether it handles action.
Sourcepub fn actions(&self) -> impl Iterator<Item = AccessAction> + '_
pub fn actions(&self) -> impl Iterator<Item = AccessAction> + '_
The actions it handles.
Sourcepub fn selected(&self) -> Option<bool>
pub fn selected(&self) -> Option<bool>
Whether it is the chosen one of its kind, if that applies.
Sourcepub fn is_disabled(&self) -> bool
pub fn is_disabled(&self) -> bool
Whether it is unavailable.
Sourcepub fn clips_children(&self) -> bool
pub fn clips_children(&self) -> bool
Whether it cuts off its children where they leave its bounds (it scrolls or clips), so children outside it are off screen.
Sourcepub fn set_clips_children(&mut self, clips: bool)
pub fn set_clips_children(&mut self, clips: bool)
Sets whether it cuts off its children where they leave its bounds (a widget’s node starts with this set when its style clips or scrolls).
Sourcepub fn set_placeholder(&mut self, placeholder: impl Into<String>)
pub fn set_placeholder(&mut self, placeholder: impl Into<String>)
Sets the hint shown while it is empty, such as a text input’s placeholder.
Sourcepub fn placeholder(&self) -> Option<&str>
pub fn placeholder(&self) -> Option<&str>
The hint shown while it is empty.