From 026ad191ebefce8234035295175e16ebe9263978 Mon Sep 17 00:00:00 2001 From: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com> Date: Sat, 1 Jul 2023 01:49:00 +0200 Subject: [PATCH] Dismiss dropdowns on click out --- crates/collab_ui/src/collab_titlebar_item.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/crates/collab_ui/src/collab_titlebar_item.rs b/crates/collab_ui/src/collab_titlebar_item.rs index 0857b2b79a01478992f4383187da6201d779fdb6..ea90a879cec13d5086c886d28a53c8bd03391d61 100644 --- a/crates/collab_ui/src/collab_titlebar_item.rs +++ b/crates/collab_ui/src/collab_titlebar_item.rs @@ -385,7 +385,11 @@ impl CollabTitlebarItem { .with_height(theme.contacts_popover.height) }) .on_click(MouseButton::Left, |_, _, _| {}) - .on_down_out(MouseButton::Left, move |_, _, cx| cx.emit(())) + .on_down_out(MouseButton::Left, move |_, this, cx| { + this.branch_popover.take(); + cx.emit(()); + cx.notify(); + }) .into_any(); Overlay::new(child) @@ -415,7 +419,11 @@ impl CollabTitlebarItem { .with_height(theme.contacts_popover.height) }) .on_click(MouseButton::Left, |_, _, _| {}) - .on_down_out(MouseButton::Left, move |_, _, cx| cx.emit(())) + .on_down_out(MouseButton::Left, move |_, this, cx| { + this.project_popover.take(); + cx.emit(()); + cx.notify(); + }) .into_any(); Overlay::new(child)