Hide pane tab bar for 0 items, hide its end buttons for no focus
This commit is contained in:
parent
698460ea89
commit
e839dc5ee6
1 changed files with 8 additions and 4 deletions
|
@ -1684,10 +1684,12 @@ impl Pane {
|
||||||
.tooltip(|cx| Tooltip::for_action("Go Forward", &GoForward, cx)),
|
.tooltip(|cx| Tooltip::for_action("Go Forward", &GoForward, cx)),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
.end_child({
|
.when(self.has_focus(cx), |tab_bar| {
|
||||||
|
tab_bar.end_child({
|
||||||
let render_tab_buttons = self.render_tab_bar_buttons.clone();
|
let render_tab_buttons = self.render_tab_bar_buttons.clone();
|
||||||
render_tab_buttons(self, cx)
|
render_tab_buttons(self, cx)
|
||||||
})
|
})
|
||||||
|
})
|
||||||
.children(
|
.children(
|
||||||
self.items
|
self.items
|
||||||
.iter()
|
.iter()
|
||||||
|
@ -1937,7 +1939,9 @@ impl Render for Pane {
|
||||||
})
|
})
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
.child(self.render_tab_bar(cx))
|
.when(self.active_item().is_some(), |pane| {
|
||||||
|
pane.child(self.render_tab_bar(cx))
|
||||||
|
})
|
||||||
.child({
|
.child({
|
||||||
let has_worktrees = self.project.read(cx).worktrees().next().is_some();
|
let has_worktrees = self.project.read(cx).worktrees().next().is_some();
|
||||||
// main content
|
// main content
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue