Skip to main content

uzor_core/containers/
flex.rs

1use crate::layout::types::*;
2use crate::types::state::WidgetId;
3
4pub struct VBox;
5impl VBox {
6    #[allow(clippy::new_ret_no_self)]
7    pub fn new(id: impl Into<WidgetId>) -> LayoutNode {
8        LayoutNode::new(id)
9            .with_style(LayoutStyle {
10                display: Display::Flex,
11                direction: FlexDirection::Column,
12                ..Default::default()
13            })
14    }
15}
16
17pub struct HBox;
18impl HBox {
19    #[allow(clippy::new_ret_no_self)]
20    pub fn new(id: impl Into<WidgetId>) -> LayoutNode {
21        LayoutNode::new(id)
22            .with_style(LayoutStyle {
23                display: Display::Flex,
24                direction: FlexDirection::Row,
25                ..Default::default()
26            })
27    }
28}