mirror of
https://github.com/zed-industries/zed.git
synced 2025-02-03 17:44:30 +00:00
Render zoomed item in the workspace
This commit is contained in:
parent
487edcb12b
commit
793381f455
1 changed files with 37 additions and 12 deletions
|
@ -3556,6 +3556,8 @@ impl Render for Workspace {
|
|||
)
|
||||
};
|
||||
|
||||
let theme = cx.theme().clone();
|
||||
let colors = theme.colors();
|
||||
cx.set_rem_size(ui_font_size);
|
||||
|
||||
self.actions(div(), cx)
|
||||
|
@ -3568,10 +3570,10 @@ impl Render for Workspace {
|
|||
.gap_0()
|
||||
.justify_start()
|
||||
.items_start()
|
||||
.text_color(cx.theme().colors().text)
|
||||
.bg(cx.theme().colors().background)
|
||||
.text_color(colors.text)
|
||||
.bg(colors.background)
|
||||
.border()
|
||||
.border_color(cx.theme().colors().border)
|
||||
.border_color(colors.border)
|
||||
.children(self.titlebar_item.clone())
|
||||
.child(
|
||||
div()
|
||||
|
@ -3584,7 +3586,7 @@ impl Render for Workspace {
|
|||
.overflow_hidden()
|
||||
.border_t()
|
||||
.border_b()
|
||||
.border_color(cx.theme().colors().border)
|
||||
.border_color(colors.border)
|
||||
.child(
|
||||
canvas(cx.listener(|workspace, bounds, _| {
|
||||
workspace.bounds = *bounds;
|
||||
|
@ -3623,13 +3625,17 @@ impl Render for Workspace {
|
|||
.flex_row()
|
||||
.h_full()
|
||||
// Left Dock
|
||||
.child(
|
||||
div()
|
||||
.flex()
|
||||
.flex_none()
|
||||
.overflow_hidden()
|
||||
.child(self.left_dock.clone()),
|
||||
)
|
||||
.children(if self.zoomed_position == Some(DockPosition::Left) {
|
||||
None
|
||||
} else {
|
||||
Some(
|
||||
div()
|
||||
.flex()
|
||||
.flex_none()
|
||||
.overflow_hidden()
|
||||
.child(self.left_dock.clone()),
|
||||
)
|
||||
})
|
||||
// Panes
|
||||
.child(
|
||||
div()
|
||||
|
@ -3657,7 +3663,26 @@ impl Render for Workspace {
|
|||
.child(self.right_dock.clone()),
|
||||
),
|
||||
)
|
||||
.children(self.render_notifications(cx)),
|
||||
.children(self.render_notifications(cx))
|
||||
.children(self.zoomed.as_ref().and_then(|view| {
|
||||
let zoomed_view = view.upgrade()?;
|
||||
let div = div()
|
||||
.z_index(1)
|
||||
.absolute()
|
||||
.overflow_hidden()
|
||||
.border_color(colors.border)
|
||||
.bg(colors.background)
|
||||
.child(zoomed_view)
|
||||
.inset_0()
|
||||
.shadow_lg();
|
||||
|
||||
Some(match self.zoomed_position {
|
||||
Some(DockPosition::Left) => div.right_2().border_r(),
|
||||
Some(DockPosition::Right) => div.left_2().border_l(),
|
||||
Some(DockPosition::Bottom) => div.top_2().border_t(),
|
||||
None => div.top_2().bottom_2().left_2().right_2().border(),
|
||||
})
|
||||
})),
|
||||
)
|
||||
.child(self.status_bar.clone())
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue