mirror of
https://github.com/zed-industries/zed.git
synced 2025-02-11 12:46:07 +00:00
Do not display a getting start message when the project is open
This commit is contained in:
parent
172e434bec
commit
5de32f7b0b
1 changed files with 13 additions and 7 deletions
|
@ -1930,7 +1930,8 @@ impl Render for Pane {
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
.child(self.render_tab_bar(cx))
|
.child(self.render_tab_bar(cx))
|
||||||
.child(
|
.child({
|
||||||
|
let has_worktrees = self.project.read(cx).worktrees().next().is_some();
|
||||||
// main content
|
// main content
|
||||||
div()
|
div()
|
||||||
.flex_1()
|
.flex_1()
|
||||||
|
@ -1944,11 +1945,16 @@ impl Render for Pane {
|
||||||
.child(self.toolbar.clone())
|
.child(self.toolbar.clone())
|
||||||
.child(item.to_any())
|
.child(item.to_any())
|
||||||
} else {
|
} else {
|
||||||
div.h_flex().size_full().justify_center().child(
|
let placeholder = div.h_flex().size_full().justify_center();
|
||||||
|
if has_worktrees {
|
||||||
|
placeholder
|
||||||
|
} else {
|
||||||
|
placeholder.child(
|
||||||
Label::new("Open a file or project to get started.")
|
Label::new("Open a file or project to get started.")
|
||||||
.color(Color::Muted),
|
.color(Color::Muted),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.child(
|
.child(
|
||||||
// drag target
|
// drag target
|
||||||
|
@ -1984,8 +1990,8 @@ impl Render for Pane {
|
||||||
div.top_0().bottom_0().right_0().w_32()
|
div.top_0().bottom_0().right_0().w_32()
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
),
|
|
||||||
)
|
)
|
||||||
|
})
|
||||||
.on_mouse_down(
|
.on_mouse_down(
|
||||||
MouseButton::Navigate(NavigationDirection::Back),
|
MouseButton::Navigate(NavigationDirection::Back),
|
||||||
cx.listener(|pane, _, cx| {
|
cx.listener(|pane, _, cx| {
|
||||||
|
|
Loading…
Reference in a new issue