Add bottom margin to the outline view

This commit is contained in:
Max Brunsfeld 2022-01-14 11:01:20 -08:00
parent 5de5e4b6f2
commit dd8e5ee543
3 changed files with 18 additions and 19 deletions

View file

@ -52,6 +52,11 @@ impl Container {
self 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 { pub fn with_margin_left(mut self, margin: f32) -> Self {
self.style.margin.left = margin; self.style.margin.left = margin;
self self

View file

@ -84,9 +84,6 @@ impl View for OutlineView {
fn render(&mut self, _: &mut RenderContext<Self>) -> ElementBox { fn render(&mut self, _: &mut RenderContext<Self>) -> ElementBox {
let settings = self.settings.borrow(); let settings = self.settings.borrow();
Align::new(
ConstrainedBox::new(
Container::new(
Flex::new(Axis::Vertical) Flex::new(Axis::Vertical)
.with_child( .with_child(
Container::new(ChildView::new(self.query_editor.id()).boxed()) Container::new(ChildView::new(self.query_editor.id()).boxed())
@ -94,15 +91,12 @@ impl View for OutlineView {
.boxed(), .boxed(),
) )
.with_child(Flexible::new(1.0, false, self.render_matches()).boxed()) .with_child(Flexible::new(1.0, false, self.render_matches()).boxed())
.boxed(), .contained()
)
.with_style(settings.theme.selector.container) .with_style(settings.theme.selector.container)
.boxed(), .constrained()
)
.with_max_width(800.0) .with_max_width(800.0)
.with_max_height(1200.0) .with_max_height(1200.0)
.boxed(), .aligned()
)
.top() .top()
.named("outline view") .named("outline view")
} }

View file

@ -211,7 +211,7 @@ text = { extends = "$text.0" }
[selector] [selector]
background = "$surface.0" background = "$surface.0"
padding = 8 padding = 8
margin.top = 52 margin = { top = 52, bottom = 52 }
corner_radius = 6 corner_radius = 6
shadow = { offset = [0, 2], blur = 16, color = "$shadow.0" } shadow = { offset = [0, 2], blur = 16, color = "$shadow.0" }
border = { width = 1, color = "$border.0" } border = { width = 1, color = "$border.0" }