Toggle window zoom/maximize when double clicking titlebar

This commit is contained in:
ForLoveOfCats 2022-08-19 11:28:03 -04:00
parent 1f7db46d98
commit 55be05b05c

View file

@ -1870,6 +1870,7 @@ impl Workspace {
};
ConstrainedBox::new(
MouseEventHandler::new::<Self, _, _>(0, cx, |_, cx| {
Container::new(
Stack::new()
.with_child(
@ -1897,6 +1898,13 @@ impl Workspace {
.boxed(),
)
.with_style(container_theme)
.boxed()
})
.on_click(MouseButton::Left, |event, cx| {
if event.click_count == 2 {
cx.zoom_window(cx.window_id());
}
})
.boxed(),
)
.with_height(theme.workspace.titlebar.height)