From d40f8889b9d12dbb9b59ada34e8416c64630154c Mon Sep 17 00:00:00 2001 From: Jason Lee Date: Tue, 25 Mar 2025 19:20:50 +0800 Subject: [PATCH] title_bar: Anchor user menu popover at top right corner (#27329) Release Notes: - Improved user menu placement | Before | After | | --- | --- | | ![Pasted image (2)](https://github.com/user-attachments/assets/fae750fd-d6bc-45d2-9ab0-7a1a1c6262ba) | ![image](https://github.com/user-attachments/assets/c5d0453f-5bd5-45e2-a56d-e200e90c0a2a) | --- crates/title_bar/src/title_bar.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/title_bar/src/title_bar.rs b/crates/title_bar/src/title_bar.rs index 294c3fdb4c..dc7fb4801a 100644 --- a/crates/title_bar/src/title_bar.rs +++ b/crates/title_bar/src/title_bar.rs @@ -21,7 +21,7 @@ use call::ActiveCall; use client::{Client, UserStore}; use feature_flags::{FeatureFlagAppExt, ZedPro}; use gpui::{ - actions, div, px, Action, AnyElement, App, Context, Decorations, Element, Entity, + actions, div, px, Action, AnyElement, App, Context, Corner, Decorations, Element, Entity, InteractiveElement, Interactivity, IntoElement, MouseButton, ParentElement, Render, Stateful, StatefulInteractiveElement, Styled, Subscription, WeakEntity, Window, }; @@ -670,6 +670,7 @@ impl TitleBar { if let Some(user) = user_store.current_user() { let plan = user_store.current_plan(); PopoverMenu::new("user-menu") + .anchor(Corner::TopRight) .menu(move |window, cx| { ContextMenu::build(window, cx, |menu, _, cx| { menu.when(cx.has_flag::(), |menu| { @@ -734,6 +735,7 @@ impl TitleBar { .anchor(gpui::Corner::TopRight) } else { PopoverMenu::new("user-menu") + .anchor(Corner::TopRight) .menu(|window, cx| { ContextMenu::build(window, cx, |menu, _, _| { menu.action("Settings", zed_actions::OpenSettings.boxed_clone())