Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Restore generic modal closing on mouse click (#45183)

Kirill Bulatovea37057814d0
diff --git a/crates/workspace/src/modal_layer.rs b/crates/workspace/src/modal_layer.rs
index db4d8575283..58667e7ffa8 100644
--- a/crates/workspace/src/modal_layer.rs
+++ b/crates/workspace/src/modal_layer.rs
@@ -193,6 +193,12 @@ impl Render for ModalLayer {
background.fade_out(0.2);
this.bg(background)
})
+ .on_mouse_down(
+ MouseButton::Left,
+ cx.listener(|this, _, window, cx| {
+ this.hide_modal(window, cx);
+ }),
+ )
.child(
v_flex()
.h(px(0.0))