From 90cdbe8bf37c3683856ca17efa82a4308e0bec28 Mon Sep 17 00:00:00 2001 From: Mikayla Date: Mon, 7 Aug 2023 13:39:05 -0700 Subject: [PATCH] Fix modal click throughs and adjust height for channel modal --- .../src/collab_panel/channel_modal.rs | 2 +- crates/workspace/src/workspace.rs | 19 ++++++++++++++----- styles/src/style_tree/channel_modal.ts | 3 ++- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/crates/collab_ui/src/collab_panel/channel_modal.rs b/crates/collab_ui/src/collab_panel/channel_modal.rs index f1775eb084e51475bc284fd14abb0dbf3e287f66..0671eee8af78d39b05f906cd13a32c0b216d421c 100644 --- a/crates/collab_ui/src/collab_panel/channel_modal.rs +++ b/crates/collab_ui/src/collab_panel/channel_modal.rs @@ -205,7 +205,7 @@ impl View for ChannelModal { ])) .with_child(ChildView::new(&self.picker, cx)) .constrained() - .with_height(theme.height) + .with_max_height(theme.height) .contained() .with_style(theme.container) .into_any() diff --git a/crates/workspace/src/workspace.rs b/crates/workspace/src/workspace.rs index cec9904eaca34471a4f2af52d58c512a1a9d43e0..e01f81c29e40395eb3f8af42d5aeff332885f0a6 100644 --- a/crates/workspace/src/workspace.rs +++ b/crates/workspace/src/workspace.rs @@ -3755,11 +3755,20 @@ impl View for Workspace { ) })) .with_children(self.modal.as_ref().map(|modal| { - ChildView::new(modal.view.as_any(), cx) - .contained() - .with_style(theme.workspace.modal) - .aligned() - .top() + enum ModalBackground {} + MouseEventHandler::::new( + 0, + cx, + |_, cx| { + ChildView::new(modal.view.as_any(), cx) + .contained() + .with_style(theme.workspace.modal) + .aligned() + .top() + }, + ) + .on_click(MouseButton::Left, |_, _, _| {}) + // Consume click events to stop focus dropping through })) .with_children(self.render_notifications(&theme.workspace, cx)), )) diff --git a/styles/src/style_tree/channel_modal.ts b/styles/src/style_tree/channel_modal.ts index a097bc561f75afbfe1607e976bbb2a914a1e3b6f..8dc9e799677894355b815c6af9f046fb83ac9a82 100644 --- a/styles/src/style_tree/channel_modal.ts +++ b/styles/src/style_tree/channel_modal.ts @@ -29,7 +29,7 @@ export default function channel_modal(): any { selection: theme.players[0], border: border(theme.middle), padding: { - bottom: 4, + bottom: 8, left: 8, right: 8, top: 4, @@ -37,6 +37,7 @@ export default function channel_modal(): any { margin: { left: side_margin, right: side_margin, + bottom: 8, }, }