pub struct VStack { /* private fields */ }Expand description
VStack - Vertical stack layout.
Children are arranged from top to bottom.
Implementations§
Source§impl VStack
impl VStack
Sourcepub fn with_options(options: StackOptions) -> Self
pub fn with_options(options: StackOptions) -> Self
Create a new VStack with options.
Sourcepub fn from_children(children: Vec<StackChild>) -> Self
pub fn from_children(children: Vec<StackChild>) -> Self
Create a VStack from a vector of children.
Sourcepub fn from_entries(children: Vec<StackEntry>) -> Self
pub fn from_entries(children: Vec<StackEntry>) -> Self
Create a VStack from a vector of stack entries.
Sourcepub fn add_child_with_options(
&self,
component: Arc<dyn Component>,
options: StackEntryOptions,
)
pub fn add_child_with_options( &self, component: Arc<dyn Component>, options: StackEntryOptions, )
Add a child with options.
Sourcepub fn remove_child(&self, component: &Arc<dyn Component>)
pub fn remove_child(&self, component: &Arc<dyn Component>)
Remove a child.
Sourcepub fn align(&self) -> StackAlign
pub fn align(&self) -> StackAlign
Get the alignment.
Sourcepub fn get_children(&self) -> Vec<StackEntry>
pub fn get_children(&self) -> Vec<StackEntry>
Get a clone of the children list.
Sourcepub fn get_layout_entries(&self) -> Vec<StackLayoutEntry>
pub fn get_layout_entries(&self) -> Vec<StackLayoutEntry>
Get layout entries for the layout system.
Trait Implementations§
Source§impl Component for VStack
impl Component for VStack
Source§fn render(&self, width: usize) -> Vec<String>
fn render(&self, width: usize) -> Vec<String>
Render the component to lines for the given viewport width. Read more
Source§fn invalidate(&self)
fn invalidate(&self)
Invalidate any cached rendering state.
Called when theme changes or when component needs to re-render from scratch.
Source§fn as_any(&self) -> &dyn Any
fn as_any(&self) -> &dyn Any
Downcast to Any for runtime type checking.
This enables the layout system to check for LayoutNodeProvider.
Source§fn handle_input(&self, _data: &str) -> bool
fn handle_input(&self, _data: &str) -> bool
Optional handler for keyboard input when component has focus. Read more
Source§fn wants_key_release(&self) -> bool
fn wants_key_release(&self) -> bool
If true, component receives key release events (Kitty protocol).
Default is false - release events are filtered out.
Source§impl LayoutNodeProvider for VStack
impl LayoutNodeProvider for VStack
Source§fn layout_node(&self) -> Option<LayoutNode>
fn layout_node(&self) -> Option<LayoutNode>
Get the layout node if this component has one.
Auto Trait Implementations§
impl Freeze for VStack
impl RefUnwindSafe for VStack
impl Send for VStack
impl Sync for VStack
impl Unpin for VStack
impl UnsafeUnpin for VStack
impl UnwindSafe for VStack
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