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.

pane: Fix double or invisible borders in tab bar (#29061)

Smit Barmase3932a6c51eaa
diff --git a/crates/ui/src/components/tab.rs b/crates/ui/src/components/tab.rs
index 8b7d5bbdd4b..71736c46ba5 100644
--- a/crates/ui/src/components/tab.rs
+++ b/crates/ui/src/components/tab.rs
@@ -122,9 +122,15 @@ impl RenderOnce for Tab {
};
let (start_slot, end_slot) = {
- let start_slot = h_flex().size_3().justify_center().children(self.start_slot);
+ let start_slot = h_flex()
+ .size(px(12.)) // use px over rem from size_3
+ .justify_center()
+ .children(self.start_slot);
- let end_slot = h_flex().size_3().justify_center().children(self.end_slot);
+ let end_slot = h_flex()
+ .size(px(12.)) // use px over rem from size_3
+ .justify_center()
+ .children(self.end_slot);
match self.close_side {
TabCloseSide::End => (start_slot, end_slot),
@@ -148,7 +154,7 @@ impl RenderOnce for Tab {
if self.selected {
this.border_l_1().border_r_1().pb_px()
} else {
- this.pr_px().pl_px().border_b_1().border_r_1()
+ this.pr_px().border_b_1().border_r_1()
}
}
TabPosition::Middle(Ordering::Equal) => this.border_l_1().border_r_1().pb_px(),
diff --git a/crates/workspace/src/pane.rs b/crates/workspace/src/pane.rs
index a3090e53834..19a5e408b84 100644
--- a/crates/workspace/src/pane.rs
+++ b/crates/workspace/src/pane.rs
@@ -2661,12 +2661,12 @@ impl Pane {
tab_bar
}
})
- .children(pinned_tabs.len().ne(&0).then(|| {
- h_flex()
- .children(pinned_tabs)
- .border_r_2()
- .border_color(cx.theme().colors().border)
- }))
+ .children(
+ pinned_tabs
+ .len()
+ .ne(&0)
+ .then(|| h_flex().children(pinned_tabs)),
+ )
.child(
h_flex()
.id("unpinned tabs")