diff --git a/crates/collab_ui/src/collab_titlebar_item.rs b/crates/collab_ui/src/collab_titlebar_item.rs index 3bc890f91ba571e8b120c37ff7fe61936343518a..c8f1d7cf3038662bb9e24960e21efaee95f8a903 100644 --- a/crates/collab_ui/src/collab_titlebar_item.rs +++ b/crates/collab_ui/src/collab_titlebar_item.rs @@ -221,17 +221,19 @@ impl CollabTitlebarItem { .as_ref() .and_then(RepositoryEntry::branch) .map(|branch| util::truncate_and_trailoff(&branch, MAX_BRANCH_NAME_LENGTH)); - let project_style = theme.titlebar.title.clone(); - let git_style = theme.titlebar.git_branch.clone(); + let project_style = theme.titlebar.project_menu_button.clone(); + let git_style = theme.titlebar.git_menu_button.clone(); let divider_style = theme.titlebar.project_name_divider.clone(); let item_spacing = theme.titlebar.item_spacing; let mut ret = Flex::row().with_child( Stack::new() .with_child( - MouseEventHandler::::new(0, cx, |_, _| { - Label::new(name, project_style.text.clone()) + MouseEventHandler::::new(0, cx, |mouse_state, _| { + let style = project_style.in_state(self.project_popover.is_some()).style_for(mouse_state); + Label::new(name, style.text.clone()) .contained() + .with_style(style.container) .aligned() .left() .into_any_named("title-project-name") @@ -241,8 +243,6 @@ impl CollabTitlebarItem { this.toggle_project_menu(&Default::default(), cx) }) .on_click(MouseButton::Left, move |_, _, _| {}) - .contained() - .with_style(project_style.container), ) .with_children(self.render_project_popover_host(&theme.titlebar, cx)), ); @@ -259,9 +259,11 @@ impl CollabTitlebarItem { .with_child( Stack::new() .with_child( - MouseEventHandler::::new(0, cx, |_, _| { - Label::new(git_branch, git_style.text) + MouseEventHandler::::new(0, cx, |mouse_state, _| { + let style = git_style.in_state(self.branch_popover.is_some()).style_for(mouse_state); + Label::new(git_branch, style.text.clone()) .contained() + .with_style(style.container.clone()) .with_margin_right(item_spacing) .aligned() .left() diff --git a/crates/theme/src/theme.rs b/crates/theme/src/theme.rs index a4fbcedd32cca1aeb73fe39e4a963591f806e72c..3a7924f36ee813c6de7ce9bce41f04d1cf9655d4 100644 --- a/crates/theme/src/theme.rs +++ b/crates/theme/src/theme.rs @@ -118,9 +118,9 @@ pub struct Titlebar { #[serde(flatten)] pub container: ContainerStyle, pub height: f32, - pub title: ContainedText, + pub project_menu_button: Toggleable>, pub project_name_divider: ContainedText, - pub git_branch: ContainedText, + pub git_menu_button: Toggleable>, pub item_spacing: f32, pub face_pile_spacing: f32, pub avatar_ribbon: AvatarRibbon, diff --git a/styles/src/style_tree/titlebar.ts b/styles/src/style_tree/titlebar.ts index 686f814a5d72c3c7ee7b07e3288c6c957536bdcd..109db8db20ced6d42ac1690166365fbb9ec4a62e 100644 --- a/styles/src/style_tree/titlebar.ts +++ b/styles/src/style_tree/titlebar.ts @@ -173,9 +173,14 @@ export function titlebar(theme: ColorScheme): any { }, // Project - title: text(theme.lowest, "sans", "active"), project_name_divider: text(theme.lowest, "sans", "variant"), - git_branch: text(theme.lowest, "sans", "variant"), + + project_menu_button: toggleable_text_button(theme, { + color: 'base', + }), + git_menu_button: toggleable_text_button(theme, { + color: 'variant', + }), // Collaborators leader_avatar: {