diff --git a/crates/go_to_line2/src/go_to_line.rs b/crates/go_to_line2/src/go_to_line.rs index 6ae58124d8..c2e2f28ab2 100644 --- a/crates/go_to_line2/src/go_to_line.rs +++ b/crates/go_to_line2/src/go_to_line.rs @@ -32,7 +32,7 @@ impl Render for GoToLine { type Element = Div; fn render(&mut self, cx: &mut ViewContext) -> Self::Element { - modal(cx).child(div().bg(red()).w(px(100.0)).h(px(100.0))) + modal(cx).child(div().m_4().bg(red()).w(px(100.0)).h(px(100.0))) } } diff --git a/crates/ui2/src/components/elevated_surface.rs b/crates/ui2/src/components/elevated_surface.rs index 9070ac4428..5d0bbe698c 100644 --- a/crates/ui2/src/components/elevated_surface.rs +++ b/crates/ui2/src/components/elevated_surface.rs @@ -1,4 +1,4 @@ -use gpui::{div, hsla, point, px, BoxShadow, Div}; +use gpui::Div; use crate::{prelude::*, v_stack}; diff --git a/crates/workspace2/src/modal_layer.rs b/crates/workspace2/src/modal_layer.rs index 5f8b9b0345..a0c3515245 100644 --- a/crates/workspace2/src/modal_layer.rs +++ b/crates/workspace2/src/modal_layer.rs @@ -1,9 +1,10 @@ use std::{any::TypeId, sync::Arc}; use gpui::{ - div, AnyView, AppContext, Component, DispatchPhase, Div, ParentElement, Render, + div, hsla, px, red, AnyView, AppContext, Component, DispatchPhase, Div, ParentElement, Render, StatelessInteractive, Styled, View, ViewContext, }; +use ui::v_stack; use crate::Workspace; @@ -83,7 +84,7 @@ impl ModalLayer { // whatever pub fn render(&self, workspace: &Workspace, cx: &ViewContext) -> Div { - let mut parent = div().relative(); + let mut parent = div().relative().bg(red()).size_full(); for (_, action) in cx.global::().registered_modals.iter() { parent = (action)(parent); @@ -92,21 +93,20 @@ impl ModalLayer { parent.when_some(self.open_modal.as_ref(), |parent, open_modal| { let container1 = div() .absolute() + .flex() + .flex_col() + .items_center() .size_full() .top_0() .left_0() - .right_0() - .bottom_0(); + .z_index(400); // transparent layer - let container2 = div() - .flex() - .h_96() - .justify_center() - .size_full() + let container2 = v_stack() + .bg(hsla(0.5, 0.5, 0.5, 0.5)) + .h(px(0.0)) .relative() - .top_20() - .z_index(400); + .top_20(); parent.child(container1.child(container2.child(open_modal.clone()))) }) diff --git a/crates/workspace2/src/workspace2.rs b/crates/workspace2/src/workspace2.rs index 90204f6038..ee6134e9e4 100644 --- a/crates/workspace2/src/workspace2.rs +++ b/crates/workspace2/src/workspace2.rs @@ -3710,10 +3710,10 @@ impl Render for Workspace { self.modal_layer .read(cx) .render(self, cx) + .relative() .flex_1() .w_full() .flex() - .flex_row() .overflow_hidden() .border_t() .border_b()