From c9893ce2fd87f349cbb5f92d2ba8eb86889494f8 Mon Sep 17 00:00:00 2001 From: Nate Butler Date: Mon, 18 Dec 2023 13:51:04 -0500 Subject: [PATCH 1/4] Use flex_1 div instead of justify_center in toolbar --- crates/workspace2/src/toolbar.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/workspace2/src/toolbar.rs b/crates/workspace2/src/toolbar.rs index a6c8f9d0bff03ec3edd42779b49bdf4382a15a25..c9bcc9346e86ab5f68ab0efcb851a58d2587f2c7 100644 --- a/crates/workspace2/src/toolbar.rs +++ b/crates/workspace2/src/toolbar.rs @@ -108,7 +108,6 @@ impl Render for Toolbar { .bg(cx.theme().colors().toolbar_background) .child( h_stack() - .justify_between() .when(self.left_items().count() > 0, |this| { this.child( h_stack() @@ -117,6 +116,11 @@ impl Render for Toolbar { .children(self.left_items().map(|item| item.to_any())), ) }) + // Render an empty div that takes up the space between + // the left and right sides. This won't cause items to + // be centered like justify_center() will if left or + // right is missing. + .child(div().flex_1()) .when(self.right_items().count() > 0, |this| { this.child( h_stack() From 2ae39b70c8dcef9d8a0459a07887b678a3e2e9f7 Mon Sep 17 00:00:00 2001 From: Nate Butler Date: Mon, 18 Dec 2023 13:55:30 -0500 Subject: [PATCH 2/4] Add left side padding --- crates/workspace2/src/toolbar.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/workspace2/src/toolbar.rs b/crates/workspace2/src/toolbar.rs index c9bcc9346e86ab5f68ab0efcb851a58d2587f2c7..ef8595ae0941478e3a7dc0ccf2177212d1712284 100644 --- a/crates/workspace2/src/toolbar.rs +++ b/crates/workspace2/src/toolbar.rs @@ -111,6 +111,7 @@ impl Render for Toolbar { .when(self.left_items().count() > 0, |this| { this.child( h_stack() + .p_1() .flex_1() .justify_start() .children(self.left_items().map(|item| item.to_any())), From 9cd8e99a9a39e346d3a31dd491039496a1fb6f51 Mon Sep 17 00:00:00 2001 From: Nate Butler Date: Mon, 18 Dec 2023 14:10:12 -0500 Subject: [PATCH 3/4] Update toolbar.rs --- crates/workspace2/src/toolbar.rs | 5 ----- 1 file changed, 5 deletions(-) diff --git a/crates/workspace2/src/toolbar.rs b/crates/workspace2/src/toolbar.rs index ef8595ae0941478e3a7dc0ccf2177212d1712284..df19ca44516384483e8044623e1723ea2338cf8b 100644 --- a/crates/workspace2/src/toolbar.rs +++ b/crates/workspace2/src/toolbar.rs @@ -117,11 +117,6 @@ impl Render for Toolbar { .children(self.left_items().map(|item| item.to_any())), ) }) - // Render an empty div that takes up the space between - // the left and right sides. This won't cause items to - // be centered like justify_center() will if left or - // right is missing. - .child(div().flex_1()) .when(self.right_items().count() > 0, |this| { this.child( h_stack() From a286ec46504093365f52abf5ad9f9c3838683d24 Mon Sep 17 00:00:00 2001 From: Nate Butler Date: Mon, 18 Dec 2023 16:10:13 -0500 Subject: [PATCH 4/4] Update toolbar.rs --- crates/workspace2/src/toolbar.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/workspace2/src/toolbar.rs b/crates/workspace2/src/toolbar.rs index df19ca44516384483e8044623e1723ea2338cf8b..1c60b8967f4b3553905b706b2038e077954be2b3 100644 --- a/crates/workspace2/src/toolbar.rs +++ b/crates/workspace2/src/toolbar.rs @@ -108,6 +108,7 @@ impl Render for Toolbar { .bg(cx.theme().colors().toolbar_background) .child( h_stack() + .justify_between() .when(self.left_items().count() > 0, |this| { this.child( h_stack()