pub struct LayoutNode {Show 13 fields
pub rect: Rect,
pub id: Option<String>,
pub on_click: Option<String>,
pub children: Vec<LayoutNode>,
pub enabled: bool,
pub focused: bool,
pub content_h: f32,
pub scroll_y: f32,
pub clip: bool,
pub scrollbar: bool,
pub action: Option<Action>,
pub visible: bool,
pub grid: Option<Box<GridLines>>,
}Fields§
§rect: Rect§id: Option<String>§on_click: Option<String>§children: Vec<LayoutNode>§enabled: bool§focused: bool§content_h: f32Height of everything inside — children plus padding — before
scrolling. Larger than rect.h when the children overflow.
scroll_y: f32Effective vertical scroll offset: the widget’s
scroll_y clamped to
0..=Self::max_scroll. Children are already shifted by it.
clip: boolThe widget clips its children (see Style::clip).
scrollbar: boolThe widget shows a scrollbar on overflow (see Style::scrollbar).
action: Option<Action>The widget’s typed click target (see Widget::action).
visible: boolfalse = collapsed (see Widget::visible): a zero rect, no
children, never hit.
grid: Option<Box<GridLines>>A grid’s rows and columns as laid out (None for other widgets).
Implementations§
Source§impl LayoutNode
impl LayoutNode
Sourcepub fn max_scroll(&self) -> f32
pub fn max_scroll(&self) -> f32
How far the children can scroll: content_h - rect.h, at least 0.
Sourcepub fn scrollbar_rects(&self) -> Option<(Rect, Rect)>
pub fn scrollbar_rects(&self) -> Option<(Rect, Rect)>
Scrollbar track and knob rects — None unless the widget has a
scrollbar and its content overflows.
Source§impl LayoutNode
impl LayoutNode
Sourcepub fn is_clickable(&self) -> bool
pub fn is_clickable(&self) -> bool
Clicking it does something: it has an action or on_click, is
enabled and visible.
Trait Implementations§
Source§impl Clone for LayoutNode
impl Clone for LayoutNode
Source§fn clone(&self) -> LayoutNode
fn clone(&self) -> LayoutNode
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more