Avoid creating occlusions for editor blocks, since these block mouse wheel events (#20649)
Just block mouse down events, and in the case of the inline assist prompt, set the default cursor. Release Notes: - N/A Co-authored-by: Richard <richard@zed.dev>
This commit is contained in:
@@ -511,7 +511,7 @@ impl Interactivity {
|
||||
}
|
||||
|
||||
/// Block the mouse from interacting with this element or any of its children
|
||||
/// The imperative API equivalent to [`InteractiveElement::block_mouse`]
|
||||
/// The imperative API equivalent to [`InteractiveElement::occlude`]
|
||||
pub fn occlude_mouse(&mut self) {
|
||||
self.occlude_mouse = true;
|
||||
}
|
||||
@@ -874,11 +874,17 @@ pub trait InteractiveElement: Sized {
|
||||
}
|
||||
|
||||
/// Block the mouse from interacting with this element or any of its children
|
||||
/// The fluent API equivalent to [`Interactivity::block_mouse`]
|
||||
/// The fluent API equivalent to [`Interactivity::occlude_mouse`]
|
||||
fn occlude(mut self) -> Self {
|
||||
self.interactivity().occlude_mouse();
|
||||
self
|
||||
}
|
||||
|
||||
/// Block the mouse from interacting with this element or any of its children
|
||||
/// The fluent API equivalent to [`Interactivity::occlude_mouse`]
|
||||
fn block_mouse_down(mut self) -> Self {
|
||||
self.on_mouse_down(MouseButton::Left, |_, cx| cx.stop_propagation())
|
||||
}
|
||||
}
|
||||
|
||||
/// A trait for elements that want to use the standard GPUI interactivity features
|
||||
|
||||
Reference in New Issue
Block a user