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 moreSource§impl Debug for LayoutNode
impl Debug for LayoutNode
Source§impl Default for LayoutNode
impl Default for LayoutNode
Source§fn default() -> LayoutNode
fn default() -> 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> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.