pub struct NodeView<'a> { /* private fields */ }Expand description
One node of a laid-out window: a widget, or the window itself at the root. Draw it, then its children in order, so later ones are on top.
Implementations§
Source§impl<'a> NodeView<'a>
impl<'a> NodeView<'a>
Sourcepub fn name(&self) -> &'static str
pub fn name(&self) -> &'static str
The widget type, such as "Row", or "PanelWindow" at the root.
Sourcepub fn rect(&self) -> Rect
pub fn rect(&self) -> Rect
The rectangle from the last layout, in window coordinates. Empty before the first layout.
Sourcepub fn bounds(&self) -> Rect
pub fn bounds(&self) -> Rect
The area the node and everything inside it painted at the last
layout: its rectangle, text and icons that overflow it, and its
descendants’ bounds, moved by its transform into
its parent’s coordinates. Nothing outside it needs drawing for this
node.
Sourcepub fn inner_bounds(&self) -> Rect
pub fn inner_bounds(&self) -> Rect
bounds before the node’s own transform, in its own
coordinates: what a layer drawn for the transform must hold. The
same as bounds when it has none.
Sourcepub fn transform(&self) -> Option<Affine>
pub fn transform(&self) -> Option<Affine>
How the node’s style moves it and everything inside it where it is
drawn, from its own coordinates, which its rectangle and its
children’s are in, into its parent’s. None when it doesn’t. The
whole subtree is drawn as one layer through it.
Sourcepub fn style(&self) -> Style
pub fn style(&self) -> Style
The style in effect, with a button’s hover and pressed styles laid
over its own. Inherited fields aren’t filled in;
TextView::color has the color text is drawn in.
Sourcepub fn children(&self) -> impl Iterator<Item = NodeView<'a>> + 'a
pub fn children(&self) -> impl Iterator<Item = NodeView<'a>> + 'a
The children, in drawing order.