Move workspace overlay elements into an actual overlay in order to get proper stacking context depths

Co-Authored-By: Mikayla Maki <mikayla@zed.dev>
This commit is contained in:
K Simmons
2022-09-11 15:34:12 -07:00
co-authored by Mikayla Maki
parent 6b26965074
commit 444417203b
4 changed files with 50 additions and 41 deletions
+1
View File
@@ -150,6 +150,7 @@ impl Dock {
cx: &mut RenderContext<Workspace>,
) -> Option<ElementBox> {
let style = &theme.workspace.dock;
self.position
.visible()
.filter(|current_anchor| *current_anchor == anchor)
+21 -10
View File
@@ -2618,16 +2618,27 @@ impl View for Workspace {
)
.boxed()
})
.with_children(self.dock.render(&theme, DockAnchor::Expanded, cx))
.with_children(self.modal.as_ref().map(|m| {
ChildView::new(m)
.contained()
.with_style(theme.workspace.modal)
.aligned()
.top()
.boxed()
}))
.with_children(self.render_notifications(&theme.workspace))
.with_child(
Overlay::new(
Stack::new()
.with_children(self.dock.render(
&theme,
DockAnchor::Expanded,
cx,
))
.with_children(self.modal.as_ref().map(|m| {
ChildView::new(m)
.contained()
.with_style(theme.workspace.modal)
.aligned()
.top()
.boxed()
}))
.with_children(self.render_notifications(&theme.workspace))
.boxed(),
)
.boxed(),
)
.flex(1.0, true)
.boxed(),
)