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.

titlebar: show placeholder when no project is selected (#8021)

Bennet Bo Fenner49a53e765412
diff --git a/crates/collab_ui/src/collab_titlebar_item.rs b/crates/collab_ui/src/collab_titlebar_item.rs
index f6e1299437b..33d769b1d99 100644
--- a/crates/collab_ui/src/collab_titlebar_item.rs
+++ b/crates/collab_ui/src/collab_titlebar_item.rs
@@ -421,14 +421,20 @@ impl CollabTitlebarItem {
worktree.root_name()
});
- names.next().unwrap_or("")
+ names.next()
+ };
+ let is_project_selected = name.is_some();
+ let name = if let Some(name) = name {
+ util::truncate_and_trailoff(name, MAX_PROJECT_NAME_LENGTH)
+ } else {
+ "Open recent project".to_string()
};
- let name = util::truncate_and_trailoff(name, MAX_PROJECT_NAME_LENGTH);
let workspace = self.workspace.clone();
popover_menu("project_name_trigger")
.trigger(
Button::new("project_name_trigger", name)
+ .when(!is_project_selected, |b| b.color(Color::Muted))
.style(ButtonStyle::Subtle)
.label_size(LabelSize::Small)
.tooltip(move |cx| Tooltip::text("Recent Projects", cx)),