diff --git a/crates/gpui/src/elements/stack.rs b/crates/gpui/src/elements/stack.rs index b81749787e..3b5c19505d 100644 --- a/crates/gpui/src/elements/stack.rs +++ b/crates/gpui/src/elements/stack.rs @@ -7,6 +7,8 @@ use crate::{ DebugContext, Element, ElementBox, LayoutContext, PaintContext, SizeConstraint, }; +/// Element which renders it's children in a stack on top of each other. +/// The first child determines the size of the others. #[derive(Default)] pub struct Stack { children: Vec, @@ -28,10 +30,16 @@ impl Element for Stack { cx: &mut LayoutContext, ) -> (Vector2F, Self::LayoutState) { let mut size = constraint.min; - for child in &mut self.children { - size = size.max(child.layout(constraint, cx)); - constraint.min = size; + let mut children = self.children.iter_mut(); + if let Some(bottom_child) = children.next() { + size = bottom_child.layout(constraint, cx); + constraint = SizeConstraint::strict(size); } + + for child in children { + child.layout(constraint, cx); + } + (size, ()) } diff --git a/crates/workspace/src/workspace.rs b/crates/workspace/src/workspace.rs index 4263f83ef1..349217985c 100644 --- a/crates/workspace/src/workspace.rs +++ b/crates/workspace/src/workspace.rs @@ -126,6 +126,7 @@ pub struct OpenSharedScreen { pub peer_id: PeerId, } +#[derive(Clone, PartialEq)] pub struct SplitWithItem { from: WeakViewHandle, pane_to_split: WeakViewHandle, diff --git a/styles/src/styleTree/workspace.ts b/styles/src/styleTree/workspace.ts index fea7df4313..50ee0c26da 100644 --- a/styles/src/styleTree/workspace.ts +++ b/styles/src/styleTree/workspace.ts @@ -228,8 +228,8 @@ export default function workspace(colorScheme: ColorScheme) { }, }, dropTargetOverlayColor: withOpacity( - foreground(layer), - 0.6 + foreground(layer, "variant"), + 0.5 ), }; }