Move UI out of storybook2 and into ui2

This commit is contained in:
Marshall Bowers 2023-10-06 17:07:59 -04:00
parent 1cf5cdbeca
commit bcad2f4e9e
26 changed files with 51 additions and 78 deletions

View file

@ -0,0 +1,31 @@
use gpui3::{div, Div};
use crate::prelude::*;
pub trait Stack: StyleHelpers {
/// Horizontally stacks elements.
fn h_stack(self) -> Self {
self.flex().flex_row().items_center()
}
/// Vertically stacks elements.
fn v_stack(self) -> Self {
self.flex().flex_col()
}
}
impl<S> Stack for Div<S> {}
/// Horizontally stacks elements.
///
/// Sets `flex()`, `flex_row()`, `items_center()`
pub fn h_stack<S: 'static>() -> Div<S> {
div().h_stack()
}
/// Vertically stacks elements.
///
/// Sets `flex()`, `flex_col()`
pub fn v_stack<S: 'static>() -> Div<S> {
div().v_stack()
}