Fix styling of project search bar

This commit is contained in:
Antonio Scandurra 2022-04-01 09:40:49 +02:00
parent 903810f22e
commit 9f939bd007
4 changed files with 18 additions and 8 deletions

View file

@ -77,6 +77,8 @@ impl View for Breadcrumbs {
})) }))
.contained() .contained()
.with_style(theme.breadcrumbs.container) .with_style(theme.breadcrumbs.container)
.aligned()
.left()
.boxed() .boxed()
} }
} }

View file

@ -691,7 +691,13 @@ impl View for ProjectSearchBar {
Flex::row() Flex::row()
.with_child( .with_child(
Flex::row() Flex::row()
.with_child(ChildView::new(&search.query_editor).flex(1., true).boxed()) .with_child(
ChildView::new(&search.query_editor)
.aligned()
.left()
.flex(1., true)
.boxed(),
)
.with_children(search.active_match_index.map(|match_ix| { .with_children(search.active_match_index.map(|match_ix| {
Label::new( Label::new(
format!( format!(
@ -710,7 +716,9 @@ impl View for ProjectSearchBar {
.with_style(editor_container) .with_style(editor_container)
.aligned() .aligned()
.constrained() .constrained()
.with_min_width(theme.search.editor.min_width)
.with_max_width(theme.search.editor.max_width) .with_max_width(theme.search.editor.max_width)
.flex(1., false)
.boxed(), .boxed(),
) )
.with_child( .with_child(
@ -735,9 +743,9 @@ impl View for ProjectSearchBar {
.boxed(), .boxed(),
) )
.contained() .contained()
.with_style(theme.workspace.toolbar.container) .with_style(theme.search.container)
.constrained() .aligned()
.with_height(theme.workspace.toolbar.height) .left()
.named("project search") .named("project search")
} else { } else {
Empty::new().boxed() Empty::new().boxed()

View file

@ -76,6 +76,7 @@ impl View for Toolbar {
.aligned() .aligned()
.contained() .contained()
.with_margin_right(theme.item_spacing) .with_margin_right(theme.item_spacing)
.flex(1., false)
.boxed() .boxed()
})) }))
.with_children(primary_right_items.iter().map(|i| { .with_children(primary_right_items.iter().map(|i| {
@ -84,6 +85,7 @@ impl View for Toolbar {
.contained() .contained()
.with_margin_left(theme.item_spacing) .with_margin_left(theme.item_spacing)
.flex_float() .flex_float()
.flex(1., false)
.boxed() .boxed()
})) }))
.constrained() .constrained()

View file

@ -89,9 +89,7 @@ background = "$surface.1"
border = { color = "$border.0", width = 1, left = false, right = false, bottom = true, top = false } border = { color = "$border.0", width = 1, left = false, right = false, bottom = true, top = false }
height = 34 height = 34
item_spacing = 8 item_spacing = 8
padding.left = 16 padding = { left = 16, right = 8, top = 4, bottom = 4 }
padding.right = 8
padding.bottom = 4
[breadcrumbs] [breadcrumbs]
extends = "$text.1" extends = "$text.1"
@ -406,7 +404,7 @@ margin = { right = 5 }
text = "$text.0" text = "$text.0"
placeholder_text = "$text.2" placeholder_text = "$text.2"
selection = "$selection.host" selection = "$selection.host"
border = { width = 1, color = "$border.0", overlay = true } border = { width = 1, color = "$border.0" }
[search.invalid_editor] [search.invalid_editor]
extends = "$search.editor" extends = "$search.editor"