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 revision(&self) -> u64
pub fn revision(&self) -> u64
A number that changes whenever anything the node and everything inside it draw changes, but for the node’s own opacity and transform: a style, its own or one its text inherits, text shaped again, a picture or frame coming in, a child added, removed or moved, a scroll, a hover. A renderer that kept the node’s layer may blend it in again while this stays the same. What only the renderer knows, such as its icon theme, it tracks itself.
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 mask_region(&self) -> Option<&'a Region>
pub fn mask_region(&self) -> Option<&'a Region>
The region the node and everything inside it show within, in its
own logical pixels from its rectangle’s top-left corner, from
mask_region. Draw nothing outside it or outside the rectangle.
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: by their style’s z, lowest
first, and in child order where it is equal.
Sourcepub fn clips(&self) -> bool
pub fn clips(&self) -> bool
Whether the node cuts its children to the inside of its border: a clipping style or a scroll view.
Sourcepub fn scroll_bar(&self) -> Option<(Rect, Style)>
pub fn scroll_bar(&self) -> Option<(Rect, Style)>
A scroll view’s first scroll bar handle and the style to draw it
with, over its children, while it shows one. See
scroll_bars for a view that scrolls both ways.
Sourcepub fn scroll_bars(&self) -> impl Iterator<Item = (Rect, Style)> + 'a
pub fn scroll_bars(&self) -> impl Iterator<Item = (Rect, Style)> + 'a
A scroll view’s scroll bar handles, one an axis it shows a bar along, and the style to draw them with, over its children.