pub struct PlacedSemanticsNode {
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 toggled: Option<bool>,
pub enabled: bool,
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.
toggled: Option<bool>§enabled: bool§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