pub struct LayoutNode {
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,
}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.
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§impl Debug for LayoutNode
impl Debug for LayoutNode
Auto Trait Implementations§
impl Freeze for LayoutNode
impl RefUnwindSafe for LayoutNode
impl Send for LayoutNode
impl Sync for LayoutNode
impl Unpin for LayoutNode
impl UnsafeUnpin for LayoutNode
impl UnwindSafe for LayoutNode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more