From e84e791dde16cb9171a509755ed80587ca4e56e7 Mon Sep 17 00:00:00 2001 From: Nate Butler Date: Sat, 9 Sep 2023 17:51:23 -0400 Subject: [PATCH] Checkpoint --- crates/storybook/src/module/tab_bar.rs | 25 +++++++++++++++---------- crates/storybook/src/storybook.rs | 4 ++-- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/crates/storybook/src/module/tab_bar.rs b/crates/storybook/src/module/tab_bar.rs index 24f96337a0..c3d145ed83 100644 --- a/crates/storybook/src/module/tab_bar.rs +++ b/crates/storybook/src/module/tab_bar.rs @@ -29,17 +29,15 @@ impl TabBar { .w_full() .flex() .items_center() + .overflow_hidden() + .justify_between() .fill(theme.highest.base.default.background) // Left Side .child( div() .px_1() .flex() - // Nate - // This isn't what I wanted, but I wanted to try to get at least SOME x overflow scroll working - // Ideally this should be on the "Tabs" div below - // So only the tabs scroll, and the nav buttons stay pinned left, and the other controls stay pinned right - .overflow_x_scroll(self.scroll_state.clone()) + .flex_none() .gap_2() // Nav Buttons .child( @@ -49,14 +47,21 @@ impl TabBar { .gap_px() .child(icon_button("icons/arrow_left.svg", ButtonVariant::Ghost)) .child(icon_button("icons/arrow_right.svg", ButtonVariant::Ghost)), - ) - // Tabs + ), + ) + // Tabs + .child( + div() + .flex_1() + .py_1() + .overflow_hidden() + .items_center() + .fill(theme.highest.accent.default.background) .child( div() - .py_1() .flex() - .items_center() .gap_px() + .overflow_x_scroll(self.scroll_state.clone()) .child(tab("Cargo.toml", false)) .child(tab("Channels Panel", true)) .child(tab("channels_panel.rs", false)) @@ -73,7 +78,7 @@ impl TabBar { div() .px_1() .flex() - .flex_initial() + .flex_none() .gap_2() // Nav Buttons .child( diff --git a/crates/storybook/src/storybook.rs b/crates/storybook/src/storybook.rs index ed6f11e074..9a7868a9e7 100644 --- a/crates/storybook/src/storybook.rs +++ b/crates/storybook/src/storybook.rs @@ -11,9 +11,9 @@ use simplelog::SimpleLogger; mod collab_panel; mod component; -mod module; mod components; mod element_ext; +mod module; mod theme; mod workspace; @@ -36,7 +36,7 @@ fn main() { cx.add_window( gpui2::WindowOptions { - bounds: WindowBounds::Fixed(RectF::new(vec2f(0., 0.), vec2f(1400., 900.))), + bounds: WindowBounds::Fixed(RectF::new(vec2f(0., 0.), vec2f(700., 900.))), center: true, ..Default::default() },