Fix modal click throughs and adjust height for channel modal

This commit is contained in:
Mikayla 2023-08-07 13:39:05 -07:00
parent f1957b1737
commit 90cdbe8bf3
No known key found for this signature in database
3 changed files with 17 additions and 7 deletions

View file

@ -205,7 +205,7 @@ impl View for ChannelModal {
])) ]))
.with_child(ChildView::new(&self.picker, cx)) .with_child(ChildView::new(&self.picker, cx))
.constrained() .constrained()
.with_height(theme.height) .with_max_height(theme.height)
.contained() .contained()
.with_style(theme.container) .with_style(theme.container)
.into_any() .into_any()

View file

@ -3755,11 +3755,20 @@ impl View for Workspace {
) )
})) }))
.with_children(self.modal.as_ref().map(|modal| { .with_children(self.modal.as_ref().map(|modal| {
ChildView::new(modal.view.as_any(), cx) enum ModalBackground {}
.contained() MouseEventHandler::<ModalBackground, _>::new(
.with_style(theme.workspace.modal) 0,
.aligned() cx,
.top() |_, 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)), .with_children(self.render_notifications(&theme.workspace, cx)),
)) ))

View file

@ -29,7 +29,7 @@ export default function channel_modal(): any {
selection: theme.players[0], selection: theme.players[0],
border: border(theme.middle), border: border(theme.middle),
padding: { padding: {
bottom: 4, bottom: 8,
left: 8, left: 8,
right: 8, right: 8,
top: 4, top: 4,
@ -37,6 +37,7 @@ export default function channel_modal(): any {
margin: { margin: {
left: side_margin, left: side_margin,
right: side_margin, right: side_margin,
bottom: 8,
}, },
} }