diff --git a/CHANGELOG.md b/CHANGELOG.md index b144bb1..00dbd3f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,24 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Changed + +- Dropdown menus across the app now match the branch selector's popover + style: one surface treatment, roomier rows with the same hover, and the + current choice marked with the active fill and a check. This covers the Git + page's Sync and "…" menus, changed-file and merge/rebase menus, the Review + source menu, the Usage filter and row menus, the composer's add/mode + popups, and the sidebar session menu; the branch, label, template, and + Settings pickers now share the same row treatment. Right-click context + menus stay compact. + +### Fixed + +- The Issue page's **Label** dropdown now closes when its trigger is clicked a + second time. The popup dismissed on mouse-down and the trigger's mouse-up + re-opened it on the same click; the trigger now honors the same gesture + guard every other dropdown uses. + ### Fixed - **New Task** now starts a fresh session when pi has exited instead of doing diff --git a/crates/orbit-pi/src/app/composer_ops.rs b/crates/orbit-pi/src/app/composer_ops.rs index 797e098..7a18818 100644 --- a/crates/orbit-pi/src/app/composer_ops.rs +++ b/crates/orbit-pi/src/app/composer_ops.rs @@ -278,10 +278,12 @@ impl OrbitApp { ); } // Full width of the chat box, so long paths are never cut. - let popup = context_menu_surface(div(), &theme) + let popup = picker_surface(div(), &theme) .w(px(CONTENT_MAX_W)) + .py(picker::list_padding_y(&theme)) .flex() .flex_col() + .gap(DynamicSpacing::Base01.px(&theme)) .overflow_hidden() .occlude() .on_mouse_down_out(cx.listener(Self::on_autocomplete_outside_down)) diff --git a/crates/orbit-pi/src/app/settings.rs b/crates/orbit-pi/src/app/settings.rs index 45e399a..b6c553e 100644 --- a/crates/orbit-pi/src/app/settings.rs +++ b/crates/orbit-pi/src/app/settings.rs @@ -5937,19 +5937,16 @@ impl OrbitApp { .h(row_h) .justify_between() .cursor_pointer() - // The keyboard cursor is a wash; the - // chosen option keeps the fill. - .when(highlighted_row, |row| row.bg(theme.overlay_strong)) - .when(!highlighted_row && selected_row, |row| { + // The chosen option keeps the fill; the + // keyboard cursor rides the same wash. + .when(highlighted_row || selected_row, |row| { row.bg(theme.active) }) .when(!highlighted_row && !selected_row, |row| { row.hover(|style| style.bg(theme.overlay)) }) - .text_color(if selected_row { + .text_color(if selected_row || highlighted_row { theme.active_fg - } else if highlighted_row { - theme.text } else { theme.text_2 }) diff --git a/crates/orbit-pi/src/app/sidebar.rs b/crates/orbit-pi/src/app/sidebar.rs index a5a7aa2..c1c3f20 100644 --- a/crates/orbit-pi/src/app/sidebar.rs +++ b/crates/orbit-pi/src/app/sidebar.rs @@ -1036,6 +1036,8 @@ pub(crate) fn session_menu_popup( .w_full() .flex() .flex_col() + .py(picker::list_padding_y(&theme)) + .gap(DynamicSpacing::Base01.px(&theme)) .child(menu_item( "menu-pin", "icons/pin.svg", @@ -1090,9 +1092,9 @@ pub(crate) fn session_menu_popup( .into_any_element() }; - // Zed's context-menu shell sizes the action list to its entries from a - // 200px minimum; the delete confirmation keeps its own fixed card. - let popup = context_menu_surface(div(), &theme) + // The branch selector's picker shell sizes the action list to its + // entries; the delete confirmation keeps its own fixed card. + let popup = picker_surface(div(), &theme) .when(confirm, |pop| { pop.w(px(210.)).p(DynamicSpacing::Base12.px(&theme)) }) @@ -1656,9 +1658,11 @@ where let (hover_bg, text_color, icon_color) = if danger { (theme.stop_red_hover, theme.send_fg, theme.send_fg) } else { - (theme.bg_hover, theme.text_2, theme.text_3) + (theme.overlay, theme.text_2, theme.text_3) }; - context_menu_entry(div().id(id), &theme) + picker_entry(div().id(id), &theme) + .h(picker::entry_height(&theme)) + .flex_none() .cursor_pointer() .when(danger, |s| s.bg(theme.stop_red)) .hover(move |s| s.bg(hover_bg)) @@ -1668,7 +1672,13 @@ where this.update(cx, |app, cx| (on_click)(app, cx)); }) .child(icon(icon_path, context_menu::ICON.px(&theme), icon_color)) - .child(label.to_string()) + .child( + div() + .flex_1() + .min_w_0() + .truncate() + .child(label.to_string()), + ) } /// Reveal a session file in the OS file manager (macOS first, matching the diff --git a/crates/orbit-pi/src/app/view.rs b/crates/orbit-pi/src/app/view.rs index d2c2412..8cabfb4 100644 --- a/crates/orbit-pi/src/app/view.rs +++ b/crates/orbit-pi/src/app/view.rs @@ -1604,11 +1604,10 @@ impl OrbitApp { list = list.child( picker_entry(entry, &theme) .cursor_pointer() - .when(highlighted, |row| row.bg(theme.overlay_strong)) - .when(selected && !highlighted, |row| { - row.bg(theme.accent.opacity(0.1)) + .when(selected || highlighted, |row| row.bg(theme.active)) + .when(!selected && !highlighted, |row| { + row.hover(|style| style.bg(theme.overlay)) }) - .hover(|style| style.bg(theme.overlay_strong)) .on_hover(move |hovered, _, cx| { if *hovered { this.update(cx, |app, cx| { @@ -1635,8 +1634,8 @@ impl OrbitApp { .flex() .items_center() .justify_center() - .bg(if selected { - theme.accent.opacity(0.16) + .bg(if selected || highlighted { + theme.active_fg.opacity(0.14) } else { theme.overlay }) @@ -1655,7 +1654,11 @@ impl OrbitApp { .child( div() .font_weight(FontWeight::MEDIUM) - .text_color(if selected { theme.text } else { theme.text_2 }) + .text_color(if selected || highlighted { + theme.active_fg + } else { + theme.text_2 + }) .child(mode.label()), ) .child( @@ -1663,7 +1666,11 @@ impl OrbitApp { .mt(DynamicSpacing::Base02.px(&theme)) .whitespace_normal() .text_size(picker::SECONDARY_TEXT.px(&theme)) - .text_color(theme.text_3) + .text_color(if selected || highlighted { + theme.active_fg.opacity(0.75) + } else { + theme.text_3 + }) .child(mode.description()), ), ) @@ -1677,10 +1684,12 @@ impl OrbitApp { ); } - let popup = context_menu_surface(div(), &theme) + let popup = picker_surface(div(), &theme) .w(px(300.)) + .py(picker::list_padding_y(&theme)) .flex() .flex_col() + .gap(DynamicSpacing::Base01.px(&theme)) .overflow_hidden() .occlude() .key_context("AccessMenu") @@ -1791,11 +1800,10 @@ impl OrbitApp { list = list.child( picker_entry(entry, &theme) .cursor_pointer() - .when(highlighted, |row| row.bg(theme.overlay_strong)) - .when(selected && !highlighted, |row| { - row.bg(theme.accent.opacity(0.1)) + .when(selected || highlighted, |row| row.bg(theme.active)) + .when(!selected && !highlighted, |row| { + row.hover(|style| style.bg(theme.overlay)) }) - .hover(|style| style.bg(theme.overlay_strong)) .on_hover(move |hovered, _, cx| { if *hovered { this.update(cx, |app, cx| { @@ -1822,8 +1830,8 @@ impl OrbitApp { .flex() .items_center() .justify_center() - .bg(if selected { - theme.accent.opacity(0.16) + .bg(if selected || highlighted { + theme.active_fg.opacity(0.14) } else { theme.overlay }) @@ -1842,7 +1850,11 @@ impl OrbitApp { .child( div() .font_weight(FontWeight::MEDIUM) - .text_color(if selected { theme.text } else { theme.text_2 }) + .text_color(if selected || highlighted { + theme.active_fg + } else { + theme.text_2 + }) .child(mode.label()), ) .child( @@ -1850,7 +1862,11 @@ impl OrbitApp { .mt(DynamicSpacing::Base02.px(&theme)) .whitespace_normal() .text_size(picker::SECONDARY_TEXT.px(&theme)) - .text_color(theme.text_3) + .text_color(if selected || highlighted { + theme.active_fg.opacity(0.75) + } else { + theme.text_3 + }) .child(mode.description()), ), ) @@ -1864,10 +1880,12 @@ impl OrbitApp { ); } - let popup = context_menu_surface(div(), &theme) + let popup = picker_surface(div(), &theme) .w(px(300.)) + .py(picker::list_padding_y(&theme)) .flex() .flex_col() + .gap(DynamicSpacing::Base01.px(&theme)) .overflow_hidden() .occlude() .key_context("WorkflowMenu") @@ -2032,7 +2050,9 @@ impl OrbitApp { let this = this.clone(); let entry = div().id(ElementId::NamedInteger("add-menu-row".into(), ix as u64)); list = list.child( - context_menu_entry(entry, &theme) + picker_entry(entry, &theme) + .h(picker::entry_height(&theme)) + .flex_none() .cursor_pointer() .when(highlighted, |row| row.bg(theme.active)) .hover(|style| style.bg(theme.overlay)) @@ -2079,9 +2099,11 @@ impl OrbitApp { ); } - let popup = context_menu_surface(div(), &theme) + let popup = picker_surface(div(), &theme) + .py(picker::list_padding_y(&theme)) .flex() .flex_col() + .gap(DynamicSpacing::Base01.px(&theme)) .overflow_hidden() .occlude() // The menu owns the keyboard while open (`AddMenu` bindings in diff --git a/crates/orbit-pi/src/git_panel/mod.rs b/crates/orbit-pi/src/git_panel/mod.rs index 7299649..3661d7b 100644 --- a/crates/orbit-pi/src/git_panel/mod.rs +++ b/crates/orbit-pi/src/git_panel/mod.rs @@ -25,9 +25,9 @@ use gpui::{ }; use crate::app::{ - button_frame, context_menu_entry, context_menu_separator, context_menu_surface, icon, - icon_button_frame, input_field_frame, menu_header, nerd_font_family, picker_entry, - picker_search_frame, picker_surface, press, refresh_glyph, spinner, TipExt, BUTTON_GROUP, + button_frame, context_menu_separator, icon, icon_button_frame, input_field_frame, menu_header, + nerd_font_family, picker_entry, picker_search_frame, picker_surface, press, refresh_glyph, + spinner, TipExt, BUTTON_GROUP, }; use crate::commit_message; use crate::gh; @@ -1274,8 +1274,8 @@ impl GitPanel { list = list.child( picker_entry(div().id("git-template-blank"), &theme) .cursor_pointer() - .text_color(theme.text) - .hover(|s| s.bg(theme.bg_hover)) + .text_color(theme.text_2) + .hover(|s| s.bg(theme.overlay)) .on_click(cx.listener(move |this, _: &ClickEvent, _, cx| { this.set_template(target, None, cx) })) @@ -1308,8 +1308,8 @@ impl GitPanel { &theme, ) .cursor_pointer() - .text_color(theme.text) - .hover(|s| s.bg(theme.bg_hover)) + .text_color(theme.text_2) + .hover(|s| s.bg(theme.overlay)) .on_click(cx.listener(move |this, _: &ClickEvent, _, cx| { this.set_template(target, Some(index), cx) })) @@ -1464,7 +1464,7 @@ impl GitPanel { .cursor_pointer() .when(selected, |row| row.bg(theme.active).text_color(theme.active_fg)) .when(!selected, |row| { - row.text_color(theme.text).hover(|s| s.bg(theme.bg_hover)) + row.text_color(theme.text_2).hover(|s| s.bg(theme.overlay)) }) .on_click(cx.listener(move |this, _: &ClickEvent, _, cx| { this.pr_new_base = Some(branch.clone()); @@ -3141,10 +3141,12 @@ impl GitPanel { if !self.sync_menu_open { return None; } - let menu = context_menu_surface(div().id("git-sync-popup"), &theme) + let menu = picker_surface(div().id("git-sync-popup"), &theme) .w(px(200.)) + .py(picker::list_padding_y(&theme)) .flex() .flex_col() + .gap(DynamicSpacing::Base01.px(&theme)) .occlude() .on_mouse_down_out(cx.listener(|this, _: &MouseDownEvent, _, cx| { this.sync_menu_open = false; @@ -3259,10 +3261,12 @@ impl GitPanel { if !self.branch_more_open { return None; } - let mut menu = context_menu_surface(div().id("git-branch-more-popup"), &theme) + let mut menu = picker_surface(div().id("git-branch-more-popup"), &theme) .w(px(220.)) + .py(picker::list_padding_y(&theme)) .flex() .flex_col() + .gap(DynamicSpacing::Base01.px(&theme)) .occlude() .on_mouse_down_out(cx.listener(|this, _: &MouseDownEvent, _, cx| { this.dismiss_branch_more(cx); @@ -4622,13 +4626,15 @@ impl GitPanel { /// The per-file actions menu: open, reveal, copy path, file history. fn file_actions_menu(&self, theme: Theme, cx: &mut Context) -> Option { let (path, _hash) = self.file_menu.clone()?; - let menu = context_menu_surface(div().id("git-file-menu"), &theme) + let menu = picker_surface(div().id("git-file-menu"), &theme) .absolute() .top(px(42.)) .right(px(12.)) .w(px(220.)) + .py(picker::list_padding_y(&theme)) .flex() .flex_col() + .gap(DynamicSpacing::Base01.px(&theme)) .occlude() .on_mouse_down_out( cx.listener(|this, _: &MouseDownEvent, _, cx| this.close_file_menu(cx)), @@ -4910,6 +4916,15 @@ impl GitPanel { "icons/chevron-down.svg", theme, cx.listener(|this, _: &ClickEvent, _, cx| { + // mouse-down-out closes the popup; the chip's mouse-up + // would otherwise toggle it straight back open on the + // same gesture (see AGENT.md popovers). + const GESTURE: Duration = Duration::from_millis(200); + if let Some(dismissed) = this.menu_dismissed_at.take() { + if dismissed.elapsed() < GESTURE { + return; + } + } this.label_menu_open = !this.label_menu_open; cx.notify(); }), @@ -5268,6 +5283,15 @@ impl GitPanel { self.issue_busy, theme, cx.listener(|this, _: &ClickEvent, _, cx| { + // mouse-down-out closes the popup; the button's mouse-up + // would otherwise toggle it straight back open on the + // same gesture (see AGENT.md popovers). + const GESTURE: Duration = Duration::from_millis(200); + if let Some(dismissed) = this.menu_dismissed_at.take() { + if dismissed.elapsed() < GESTURE { + return; + } + } this.label_menu_open = !this.label_menu_open; cx.notify(); }), @@ -5510,8 +5534,8 @@ impl GitPanel { list = list.child( picker_entry(div().id(id), &theme) .cursor_pointer() - .text_color(theme.text) - .hover(|s| s.bg(theme.bg_hover)) + .text_color(theme.text_2) + .hover(|s| s.bg(theme.overlay)) .on_click(cx.listener(move |this, _: &ClickEvent, _, cx| { if this.issue_detail.is_some() { this.toggle_issue_label(name.clone(), cx); @@ -5538,6 +5562,9 @@ impl GitPanel { .occlude() .on_mouse_down_out(cx.listener(|this, _: &MouseDownEvent, _, cx| { this.label_menu_open = false; + // Arm the gesture guard so the same click's mouse-up on the + // trigger cannot immediately re-open the popup. + this.menu_dismissed_at = Some(Instant::now()); cx.notify(); })) .child(menu_header(tr!("git_panel.labels"), &theme)) @@ -6690,7 +6717,7 @@ impl GitPanel { row.bg(theme.active).text_color(theme.active_fg) }) .when(!selected, |row| { - row.text_color(theme.text).hover(|s| s.bg(theme.bg_hover)) + row.text_color(theme.text_2).hover(|s| s.bg(theme.overlay)) }) .on_click(cx.listener(move |this, _: &ClickEvent, _, cx| { if selected { @@ -6764,15 +6791,17 @@ impl GitPanel { RefTarget::Rebase => tr!("git_panel.rebase_onto"), RefTarget::PrBase => tr!("git_panel.base_branch"), }; - let mut menu = context_menu_surface(div().id("git-ref-menu"), &theme) + let mut menu = picker_surface(div().id("git-ref-menu"), &theme) .absolute() .top(px(42.)) .right(px(12.)) .w(px(300.)) .max_h(px(360.)) + .py(picker::list_padding_y(&theme)) .overflow_y_scroll() .flex() .flex_col() + .gap(DynamicSpacing::Base01.px(&theme)) .occlude() .on_mouse_down_out(cx.listener(|this, _: &MouseDownEvent, _, cx| { this.close_ref_picker(cx); @@ -6814,7 +6843,9 @@ impl GitPanel { } if self.refs.is_empty() { menu = menu.child( - context_menu_entry(div(), &theme) + picker_entry(div(), &theme) + .h(picker::entry_height(&theme)) + .flex_none() .text_color(theme.text_3) .child(tr!("git_panel.no_refs")), ); @@ -6828,7 +6859,9 @@ impl GitPanel { let label = entry.name.clone(); let id = gpui::ElementId::Name(format!("git-ref-{name}").into()); menu = menu.child( - context_menu_entry(div().id(id), &theme) + picker_entry(div().id(id), &theme) + .h(picker::entry_height(&theme)) + .flex_none() .cursor_pointer() .text_color(theme.text_2) .hover(|s| s.bg(theme.overlay).text_color(theme.text)) @@ -7301,8 +7334,9 @@ fn recovery_button(action: RecoveryAction, theme: Theme, cx: &Context) ) } -/// One entry of the Git page's context menus (sync, branch "…", file -/// actions), on Zed's context menu metrics. +/// One entry of the Git page's dropdown menus (sync, branch "…", file +/// actions), on the branch selector's picker metrics: one `picker_entry` +/// row, `overlay` hover, and the shared menu icon size. fn menu_row( id: &'static str, icon_path: &'static str, @@ -7311,14 +7345,22 @@ fn menu_row( listener: impl Fn(&ClickEvent, &mut Window, &mut gpui::App) + 'static, ) -> AnyElement { press( - context_menu_entry(div().id(id).group(BUTTON_GROUP), &theme) + picker_entry(div().id(id).group(BUTTON_GROUP), &theme) + .h(picker::entry_height(&theme)) + .flex_none() .cursor_pointer() .text_color(theme.text_2) .hover(|s| s.bg(theme.overlay).text_color(theme.text)), ) .on_click(listener) .child(icon(icon_path, context_menu::ICON.px(&theme), theme.text_3)) - .child(label.to_string()) + .child( + div() + .flex_1() + .min_w_0() + .truncate() + .child(label.to_string()), + ) .into_any_element() } diff --git a/crates/orbit-pi/src/sidepane.rs b/crates/orbit-pi/src/sidepane.rs index 950ceb2..8173305 100644 --- a/crates/orbit-pi/src/sidepane.rs +++ b/crates/orbit-pi/src/sidepane.rs @@ -23,9 +23,9 @@ use gpui::{ }; use crate::app::{ - button_frame, context_menu_entry, context_menu_separator, context_menu_surface, empty_state, - file_glyph, icon, icon_button_frame, nerd_font_family, picker_search_frame, refresh_glyph, - EmptyFill, TipExt, BUTTON_GROUP, PRESS_DIM, + button_frame, context_menu_separator, empty_state, file_glyph, icon, icon_button_frame, + nerd_font_family, picker_entry, picker_search_frame, picker_surface, refresh_glyph, EmptyFill, + TipExt, BUTTON_GROUP, PRESS_DIM, }; use crate::composer::ComposerInput; use crate::diff_view::{ @@ -34,7 +34,9 @@ use crate::diff_view::{ }; use crate::git; use crate::review::{self, ExpansionDirection, GapPosition, LineKind, Snapshot, Source}; -use crate::theme::tokens::{context_menu, input, popover, ButtonSize, IconSize, Radius, TextSize}; +use crate::theme::tokens::{ + context_menu, input, picker, popover, ButtonSize, DynamicSpacing, IconSize, Radius, TextSize, +}; use crate::theme::{self, Theme, ThemeMode}; use crate::usage::tooltip::Tooltip; @@ -1710,14 +1712,16 @@ impl SidePane { if !self.source_menu_open { return None; } - let mut menu = context_menu_surface(div().id("review-source-menu"), &theme) + let mut menu = picker_surface(div().id("review-source-menu"), &theme) .absolute() // Below the toolbar's source button. .top(menu_top(1. + PANE_ROW_H, ButtonSize::Medium, &theme)) .left(px(10.)) .w(px(200.)) + .py(picker::list_padding_y(&theme)) .flex() .flex_col() + .gap(DynamicSpacing::Base01.px(&theme)) .occlude() .on_mouse_down_out( cx.listener(|this, _: &MouseDownEvent, _, cx| this.dismiss_source_menu(cx)), @@ -1766,12 +1770,14 @@ fn source_row( theme: Theme, cx: &mut Context, ) -> AnyElement { - let row = context_menu_entry( + let row = picker_entry( div().id(gpui::ElementId::Name( format!("review-source-{label}").into(), )), &theme, ) + .h(picker::entry_height(&theme)) + .flex_none() .when(enabled, |row| row.cursor_pointer()) .when(selected, |row| row.bg(theme.active)) .when(enabled && !selected, |row| { diff --git a/crates/orbit-pi/src/usage/filters.rs b/crates/orbit-pi/src/usage/filters.rs index d2991bb..5aeea0d 100644 --- a/crates/orbit-pi/src/usage/filters.rs +++ b/crates/orbit-pi/src/usage/filters.rs @@ -10,9 +10,8 @@ //! object drives every panel on the page (§10). use crate::app::{ - button_frame, context_menu_entry, context_menu_separator, context_menu_surface, - icon_button_frame, menu_header, picker_search_frame, press, refresh_glyph, TipExt, - BUTTON_GROUP, + button_frame, context_menu_separator, icon_button_frame, menu_header, picker_entry, + picker_search_frame, picker_surface, press, refresh_glyph, TipExt, BUTTON_GROUP, }; use chrono::Datelike; use gpui::{ @@ -29,7 +28,7 @@ use super::page::{ }; use super::table::FailureSort; use crate::theme::tokens::{ - context_menu, input, list, popover, ButtonSize, DynamicSpacing, IconSize, TextSize, + context_menu, input, list, picker, popover, ButtonSize, DynamicSpacing, IconSize, TextSize, }; use crate::theme::Theme; use crate::{app::icon, composer::ComposerInput}; @@ -157,8 +156,8 @@ pub fn chip( )) } -/// The popover shell shared by every filter menu, on Zed's context-menu -/// metrics ([`context_menu_surface`]). `width` pins menus whose content needs +/// The popover shell shared by every filter menu, on the branch selector's +/// picker metrics ([`picker_surface`]). `width` pins menus whose content needs /// a definite width (a truncating list, the calendar grid); `None` sizes the /// menu to its entries from the shell's minimum. A click outside closes it, /// and so does Escape — while a filter menu is open it owns that key, so it can @@ -171,7 +170,7 @@ fn panel( page: Entity, ) -> AnyElement { let dismiss_click = page.clone(); - context_menu_surface(div().id(ElementId::Name(SharedString::from(id))), &theme) + picker_surface(div().id(ElementId::Name(SharedString::from(id))), &theme) .when_some(width, |menu, width| menu.w(px(width))) .flex() .flex_col() @@ -220,10 +219,14 @@ fn row( on_click: impl Fn(&MouseDownEvent, &mut Window, &mut App) + 'static, on_hover: impl Fn(&bool, &mut Window, &mut App) + 'static, ) -> AnyElement { - context_menu_entry(div().id(id), &theme) + picker_entry(div().id(id), &theme) + .h(picker::entry_height(&theme)) + .flex_none() .cursor_pointer() - .when(highlighted, |row| row.bg(theme.active)) - .hover(|style| style.bg(theme.overlay)) + .when(highlighted || selected, |row| row.bg(theme.active)) + .when(!highlighted && !selected, |row| { + row.hover(|style| style.bg(theme.overlay)) + }) .on_hover(on_hover) .on_mouse_down(MouseButton::Left, on_click) .child( @@ -251,7 +254,7 @@ fn row( .min_w_0() .truncate() .when(selected, |text| text.font_weight(FontWeight::MEDIUM)) - .text_color(if highlighted { + .text_color(if highlighted || selected { theme.active_fg } else { theme.text_2 @@ -391,7 +394,9 @@ pub fn multi_menu( ); if rows.is_empty() && !query.trim().is_empty() { children.push( - context_menu_entry(div(), &theme) + picker_entry(div(), &theme) + .h(picker::entry_height(&theme)) + .flex_none() .text_color(theme.text_3) .child( div() diff --git a/crates/orbit-pi/src/usage/view.rs b/crates/orbit-pi/src/usage/view.rs index 64cccb7..96be55d 100644 --- a/crates/orbit-pi/src/usage/view.rs +++ b/crates/orbit-pi/src/usage/view.rs @@ -62,12 +62,12 @@ use super::table::{ }; use super::tooltip::Tooltip; use crate::app::{ - button_frame, context_menu_entry, context_menu_separator, context_menu_surface, icon, - icon_button_frame, picker_search_frame, press, TipExt, BUTTON_GROUP, + button_frame, context_menu_separator, icon, icon_button_frame, picker_entry, + picker_search_frame, picker_surface, press, TipExt, BUTTON_GROUP, }; use crate::composer::ComposerInput; use crate::theme::tokens::{ - button, input, popover, ButtonSize, DynamicSpacing, IconSize, Radius, TextSize, + button, input, picker, popover, ButtonSize, DynamicSpacing, IconSize, Radius, TextSize, }; use crate::theme::{self, Theme}; @@ -4438,12 +4438,14 @@ fn session_context_menu(row: &SessionRow, theme: Theme, page: Entity) .into_any_element() } -/// The menu shell, on Zed's context-menu metrics ([`context_menu_surface`]), -/// dismissed by an outside click. +/// The menu shell, on the branch selector's picker metrics +/// ([`picker_surface`]), dismissed by an outside click. fn context_menu_shell(theme: Theme, page: Entity, items: Vec) -> AnyElement { - context_menu_surface(div().id("usage-row-menu"), &theme) + picker_surface(div().id("usage-row-menu"), &theme) + .py(picker::list_padding_y(&theme)) .flex() .flex_col() + .gap(DynamicSpacing::Base01.px(&theme)) .overflow_hidden() .occlude() .on_mouse_down(MouseButton::Left, |_, _, cx| cx.stop_propagation()) @@ -4454,16 +4456,18 @@ fn context_menu_shell(theme: Theme, page: Entity, items: Vec AnyElement { - context_menu_entry(div(), &theme) - .text_color(theme.text) + picker_entry(div(), &theme) + .h(picker::entry_height(&theme)) + .flex_none() + .text_color(theme.text_2) .cursor_pointer() - .hover(|style| style.bg(theme.bg_hover)) + .hover(|style| style.bg(theme.overlay).text_color(theme.text)) .on_mouse_down(MouseButton::Left, move |_, window, cx| { cx.stop_propagation(); on_click(window, cx);