Add double click to zoom the window

Co-Authored-By: Antonio <me@as-cii.com>
This commit is contained in:
Conrad Irwin 2023-11-02 10:58:24 -06:00
parent bd54bfa4e1
commit 803d2b6710
3 changed files with 31 additions and 13 deletions

View file

@ -2690,14 +2690,15 @@ impl Workspace {
fn render_titlebar(&self, cx: &mut ViewContext<Self>) -> impl Component<Self> {
div()
.bg(cx.theme().colors().title_bar)
.when(
matches!(cx.window_bounds(), WindowBounds::Fullscreen),
!matches!(cx.window_bounds(), WindowBounds::Fullscreen),
|s| s.pl_20(),
)
.id(0)
.id("titlebar")
.on_click(|workspace, event, cx| {
if event.up.click_count == 2 {
println!("ZOOOOOM")
cx.zoom_window();
}
})
.child("Collab title bar Item") // self.titlebar_item