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.

title_bar: Display the org name in the user avatar trigger when not the personal (#52356)

Danilo Leal1358e42d26ab
diff --git a/crates/title_bar/src/title_bar.rs b/crates/title_bar/src/title_bar.rs
index a393f71ec73..b40029bf933 100644
--- a/crates/title_bar/src/title_bar.rs
+++ b/crates/title_bar/src/title_bar.rs
@@ -1152,6 +1152,9 @@ impl TitleBar {
let has_organization = user_store_read.current_organization().is_some();
let current_organization = user_store_read.current_organization();
+ let business_organization = current_organization
+ .as_ref()
+ .filter(|organization| !organization.is_personal);
let organizations: Vec<_> = user_store_read
.organizations()
.iter()
@@ -1178,7 +1181,14 @@ impl TitleBar {
}
});
- ButtonLike::new("user-menu").children(avatar)
+ ButtonLike::new("user-menu").child(
+ h_flex()
+ .when_some(business_organization, |this, organization| {
+ this.gap_2()
+ .child(Label::new(&organization.name).size(LabelSize::Small))
+ })
+ .children(avatar),
+ )
} else {
ButtonLike::new("user-menu")
.child(Icon::new(IconName::ChevronDown).size(IconSize::Small))