pub struct HStack { /* private fields */ }Expand description
HStack - Horizontal stack layout.
Children are arranged from left to right.
Implementations§
Source§impl HStack
impl HStack
Sourcepub fn with_options(options: StackOptions) -> Self
pub fn with_options(options: StackOptions) -> Self
Create a new HStack with options.
Sourcepub fn from_entries(children: Vec<StackEntry>) -> Self
pub fn from_entries(children: Vec<StackEntry>) -> Self
Create an HStack 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 HStack
impl Component for HStack
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 HStack
impl LayoutNodeProvider for HStack
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 HStack
impl RefUnwindSafe for HStack
impl Send for HStack
impl Sync for HStack
impl Unpin for HStack
impl UnsafeUnpin for HStack
impl UnwindSafe for HStack
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