Add bottom margin to the outline view
This commit is contained in:
parent
5de5e4b6f2
commit
dd8e5ee543
3 changed files with 18 additions and 19 deletions
|
@ -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
|
||||
|
|
|
@ -84,27 +84,21 @@ impl View for OutlineView {
|
|||
fn render(&mut self, _: &mut RenderContext<Self>) -> 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<Self>) {
|
||||
|
|
|
@ -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" }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue