pub struct PlacedSemanticsNode {Show 19 fields
pub node_id: NodeId,
pub role: SemanticsRole,
pub widget_role: Option<SemanticsWidgetRole>,
pub label: Option<String>,
pub state_description: Option<String>,
pub clickable: bool,
pub interactive: bool,
pub toggled: Option<bool>,
pub selected: Option<bool>,
pub enabled: bool,
pub editable_text: bool,
pub focusable: bool,
pub hidden: bool,
pub pane_title: Option<String>,
pub traversal_index: f32,
pub list_position: Option<usize>,
pub layout_bounds: Rect,
pub touch_bounds: Option<Rect>,
pub children: Vec<PlacedSemanticsNode>,
}Expand description
One semantics node, with the geometry it was placed and drawn at.
Field-for-field a subset of SemanticsNode plus the two boxes; the fields
that are dropped are the ones a geometry audit has no use for (custom
actions, text selection, the canvas children a drawn control publishes —
those already carry their own bounds).
Fields§
§node_id: NodeId§role: SemanticsRoleWhere the node sits in the tree: layout, text, subcomposition …
widget_role: Option<SemanticsWidgetRole>What a screen reader announces it as — Compose’s Role.
label: Option<String>The text of a Text node, or the content description of anything else.
state_description: Option<String>§clickable: boolWhether the node carries a click action, which is what separates a control from something merely described.
interactive: boolWhether the renderer carries any pointer-dispatch region for the node. This also includes gesture-only containers such as scrollable lists.
toggled: Option<bool>§selected: Option<bool>§enabled: bool§editable_text: boolWhether a reader can type into the node.
focusable: boolWhether Tab and a reader’s focus reach the node.
Whether a reader skips the node and everything under it.
pane_title: Option<String>The title the node gives the screen, when it is the screen’s root.
traversal_index: f32Where the app moved the node in the reading order; 0 leaves it be.
list_position: Option<usize>The place of a row among the rows of its list, counted from 1, when the parent says it is a collection. A reader speaks it, so two rows with one name are told apart.
layout_bounds: RectThe box the measure pass gave this node, in window coordinates.
touch_bounds: Option<Rect>The box the renderer draws and the hit test inverts, ancestor graphics
layers included. None when the hit graph carries no region for it.
children: Vec<PlacedSemanticsNode>Implementations§
Source§impl PlacedSemanticsNode
impl PlacedSemanticsNode
Sourcepub fn target_bounds(&self) -> Rect
pub fn target_bounds(&self) -> Rect
The box a finger has to find: the drawn quad where there is one, and the layout box where the node is not a hit target at all.
Sourcepub fn visit(&self, visitor: &mut impl FnMut(&PlacedSemanticsNode))
pub fn visit(&self, visitor: &mut impl FnMut(&PlacedSemanticsNode))
Depth-first walk, self first.
Sourcepub fn flatten(&self) -> Vec<&PlacedSemanticsNode>
pub fn flatten(&self) -> Vec<&PlacedSemanticsNode>
Every node in the subtree, self first, in tree order.
Sourcepub fn controls(&self) -> Vec<&PlacedSemanticsNode>
pub fn controls(&self) -> Vec<&PlacedSemanticsNode>
Every node a tap would do something to.
Trait Implementations§
Source§impl Clone for PlacedSemanticsNode
impl Clone for PlacedSemanticsNode
Source§fn clone(&self) -> PlacedSemanticsNode
fn clone(&self) -> PlacedSemanticsNode
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more