Toggle window zoom/maximize when double clicking titlebar
This commit is contained in:
parent
1f7db46d98
commit
55be05b05c
1 changed files with 32 additions and 24 deletions
|
@ -1870,33 +1870,41 @@ impl Workspace {
|
||||||
};
|
};
|
||||||
|
|
||||||
ConstrainedBox::new(
|
ConstrainedBox::new(
|
||||||
Container::new(
|
MouseEventHandler::new::<Self, _, _>(0, cx, |_, cx| {
|
||||||
Stack::new()
|
Container::new(
|
||||||
.with_child(
|
Stack::new()
|
||||||
Label::new(worktree_root_names, theme.workspace.titlebar.title.clone())
|
.with_child(
|
||||||
.aligned()
|
Label::new(worktree_root_names, theme.workspace.titlebar.title.clone())
|
||||||
.left()
|
.aligned()
|
||||||
.boxed(),
|
.left()
|
||||||
)
|
|
||||||
.with_child(
|
|
||||||
Align::new(
|
|
||||||
Flex::row()
|
|
||||||
.with_children(self.render_collaborators(theme, cx))
|
|
||||||
.with_children(self.render_current_user(
|
|
||||||
self.user_store.read(cx).current_user().as_ref(),
|
|
||||||
replica_id,
|
|
||||||
theme,
|
|
||||||
cx,
|
|
||||||
))
|
|
||||||
.with_children(self.render_connection_status(cx))
|
|
||||||
.boxed(),
|
.boxed(),
|
||||||
)
|
)
|
||||||
.right()
|
.with_child(
|
||||||
|
Align::new(
|
||||||
|
Flex::row()
|
||||||
|
.with_children(self.render_collaborators(theme, cx))
|
||||||
|
.with_children(self.render_current_user(
|
||||||
|
self.user_store.read(cx).current_user().as_ref(),
|
||||||
|
replica_id,
|
||||||
|
theme,
|
||||||
|
cx,
|
||||||
|
))
|
||||||
|
.with_children(self.render_connection_status(cx))
|
||||||
|
.boxed(),
|
||||||
|
)
|
||||||
|
.right()
|
||||||
|
.boxed(),
|
||||||
|
)
|
||||||
.boxed(),
|
.boxed(),
|
||||||
)
|
)
|
||||||
.boxed(),
|
.with_style(container_theme)
|
||||||
)
|
.boxed()
|
||||||
.with_style(container_theme)
|
})
|
||||||
|
.on_click(MouseButton::Left, |event, cx| {
|
||||||
|
if event.click_count == 2 {
|
||||||
|
cx.zoom_window(cx.window_id());
|
||||||
|
}
|
||||||
|
})
|
||||||
.boxed(),
|
.boxed(),
|
||||||
)
|
)
|
||||||
.with_height(theme.workspace.titlebar.height)
|
.with_height(theme.workspace.titlebar.height)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue