diff --git a/crates/storybook/src/module/tab_bar.rs b/crates/storybook/src/module/tab_bar.rs index 24f96337a03d161c4bab0286c093b8b475da7fd5..c3d145ed83c369e84ea9b7cc5a0d0ff45f856b3c 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 ed6f11e074193da265f59a887c7e781b4e98eb87..9a7868a9e75e5b0726123f9d538b5795369671b7 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() },