Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Use flex_1 div instead of justify_center in toolbar

Nate Butlerc9893ce2fd87
diff --git a/crates/workspace2/src/toolbar.rs b/crates/workspace2/src/toolbar.rs
index a6c8f9d0bff..c9bcc9346e8 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()