Make focusing the parent an effect to avoid querying ancestors

This commit is contained in:
Antonio Scandurra 2023-05-05 10:04:54 +02:00
parent d6b0569bed
commit 80ad59a620
5 changed files with 53 additions and 33 deletions

View file

@ -1770,7 +1770,7 @@ impl View for Pane {
self.render_blank_pane(&theme, cx)
})
.on_down(MouseButton::Left, |_, _, cx| {
cx.focus_parent_view();
cx.focus_parent();
})
.into_any()
}

View file

@ -90,7 +90,7 @@ impl View for SharedScreen {
.contained()
.with_style(cx.global::<Settings>().theme.shared_screen)
})
.on_down(MouseButton::Left, |_, _, cx| cx.focus_parent_view())
.on_down(MouseButton::Left, |_, _, cx| cx.focus_parent())
.into_any()
}
}