From 99775968c1c97050f3ec10fc4a861d145ed0d9b9 Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Tue, 26 Mar 2024 12:09:11 +0200 Subject: [PATCH] Make UniformList non-occluding. Move the `occlude` in the places where they are needed. Co-authored-by: Antonio Scandurra --- crates/editor/src/editor.rs | 6 +++--- crates/gpui/src/elements/uniform_list.rs | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rs index 05582f4441ba6655f54ae2cbb0d8005c86b244df..f936657f0ade4b4e835f61df27e0aa1b1b97e6d7 100644 --- a/crates/editor/src/editor.rs +++ b/crates/editor/src/editor.rs @@ -898,9 +898,7 @@ impl CompletionsMenu { .max_w(px(640.)) .w(px(500.)) .overflow_y_scroll() - // Prevent a mouse down on documentation from being propagated to the editor, - // because that would move the cursor. - .on_mouse_down(MouseButton::Left, |_, cx| cx.stop_propagation()) + .occlude() }) } else { None @@ -989,6 +987,7 @@ impl CompletionsMenu { .collect() }, ) + .occlude() .max_h(max_height) .track_scroll(self.scroll_handle.clone()) .with_width_from_item(widest_completion_ix); @@ -1212,6 +1211,7 @@ impl CodeActionsMenu { .px_2() .py_1() .max_h(max_height) + .occlude() .track_scroll(self.scroll_handle.clone()) .with_width_from_item( self.actions diff --git a/crates/gpui/src/elements/uniform_list.rs b/crates/gpui/src/elements/uniform_list.rs index 55cd48b9cc4b81da56121ae61a6c95340855101d..82a9a48c0111dbde76b29dba9d786d10e39200cf 100644 --- a/crates/gpui/src/elements/uniform_list.rs +++ b/crates/gpui/src/elements/uniform_list.rs @@ -48,7 +48,6 @@ where interactivity: Interactivity { element_id: Some(id), base_style: Box::new(base_style), - occlude_mouse: true, #[cfg(debug_assertions)] location: Some(*core::panic::Location::caller()),