From d825840bce807536a7ff49e440db19addc22126b Mon Sep 17 00:00:00 2001 From: Vikram Bhaskaran Date: Tue, 13 Oct 2026 15:14:01 +1100 Subject: [PATCH] Make the space between popup menu rows part of the rows. (#4624) Context menus inherited a 6 pt item gap that belonged to neither button, so a drag across Merge Down or an adjustment list fell into dead space. Popup menus now stack their rows, and Pro rows use a square hover. (#4602) Co-authored-by: Brandon Thomas --- crates/ui-egui/src/widgets.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/widgets.rs b/crates/ui-egui/src/widgets.rs index a9559dd636e..32f5cd457d5 100644 --- a/crates/ui-egui/src/widgets.rs +++ b/crates/ui-egui/src/widgets.rs @@ -17,6 +17,9 @@ pub use type_ahead::list_open as dropdown_list_open; /// The setting is local to this popup's Ui and leaves other themes unchanged. pub fn style_spectrum_popup_menu(ui: &mut Ui) { let t = Tokens::get(ui.ctx()); + // The 6 pt gap between rows was outside both buttons, so a drag across a menu + // dropped the highlight (#4602). Padding stays inside the row, which is the hit target. + ui.spacing_mut().item_spacing.y = 0.0; if !t.pro { return; } @@ -26,7 +29,9 @@ pub fn style_spectrum_popup_menu(ui: &mut Ui) { v.widgets.hovered.bg_fill = t.accent; v.widgets.hovered.fg_stroke = Stroke::new(1.0, Color32::WHITE); v.widgets.hovered.bg_stroke = Stroke::NONE; - v.widgets.hovered.corner_radius = CornerRadius::same(3); + v.widgets.inactive.corner_radius = CornerRadius::ZERO; + v.widgets.hovered.corner_radius = CornerRadius::ZERO; + v.widgets.active.corner_radius = CornerRadius::ZERO; } /// An accent insertion line on one edge of `r` while a drag hovers it (vertical: on its left or, @@ -1751,6 +1756,7 @@ mod tests { let original_padding = ui.spacing().button_padding; let original_hover = ui.visuals().widgets.hovered.fg_stroke; super::style_spectrum_popup_menu(ui); + assert_eq!(ui.spacing().item_spacing.y, 0.0, "{kind:?}: menu rows meet so the gap is selectable"); if tokens.pro { assert_eq!(ui.spacing().button_padding, egui::vec2(10.0, 4.0)); assert_eq!(ui.visuals().widgets.hovered.bg_fill, tokens.accent);