diff --git a/crates/gpui/src/elements/container.rs b/crates/gpui/src/elements/container.rs index 026542989e..73a4349ba0 100644 --- a/crates/gpui/src/elements/container.rs +++ b/crates/gpui/src/elements/container.rs @@ -52,6 +52,11 @@ impl Container { self } + pub fn with_margin_bottom(mut self, margin: f32) -> Self { + self.style.margin.bottom = margin; + self + } + pub fn with_margin_left(mut self, margin: f32) -> Self { self.style.margin.left = margin; self diff --git a/crates/outline/src/outline.rs b/crates/outline/src/outline.rs index c4285a4552..774b765977 100644 --- a/crates/outline/src/outline.rs +++ b/crates/outline/src/outline.rs @@ -84,27 +84,21 @@ impl View for OutlineView { fn render(&mut self, _: &mut RenderContext) -> ElementBox { let settings = self.settings.borrow(); - Align::new( - ConstrainedBox::new( - Container::new( - Flex::new(Axis::Vertical) - .with_child( - Container::new(ChildView::new(self.query_editor.id()).boxed()) - .with_style(settings.theme.selector.input_editor.container) - .boxed(), - ) - .with_child(Flexible::new(1.0, false, self.render_matches()).boxed()) - .boxed(), - ) - .with_style(settings.theme.selector.container) - .boxed(), + Flex::new(Axis::Vertical) + .with_child( + Container::new(ChildView::new(self.query_editor.id()).boxed()) + .with_style(settings.theme.selector.input_editor.container) + .boxed(), ) + .with_child(Flexible::new(1.0, false, self.render_matches()).boxed()) + .contained() + .with_style(settings.theme.selector.container) + .constrained() .with_max_width(800.0) .with_max_height(1200.0) - .boxed(), - ) - .top() - .named("outline view") + .aligned() + .top() + .named("outline view") } fn on_focus(&mut self, cx: &mut ViewContext) { diff --git a/crates/zed/assets/themes/_base.toml b/crates/zed/assets/themes/_base.toml index 95dc7eee60..c4c3cf5125 100644 --- a/crates/zed/assets/themes/_base.toml +++ b/crates/zed/assets/themes/_base.toml @@ -211,7 +211,7 @@ text = { extends = "$text.0" } [selector] background = "$surface.0" padding = 8 -margin.top = 52 +margin = { top = 52, bottom = 52 } corner_radius = 6 shadow = { offset = [0, 2], blur = 16, color = "$shadow.0" } border = { width = 1, color = "$border.0" }