Allow flex items to float to the end of the flex axis

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
Antonio Scandurra
2022-03-30 16:46:14 +02:00
co-authored by Nathan Sobo
parent 621e67bca7
commit 0453dd1101
16 changed files with 138 additions and 104 deletions
+1 -5
View File
@@ -82,11 +82,7 @@ impl View for BufferSearchBar {
Flex::row()
.with_child(
Flex::row()
.with_child(
ChildView::new(&self.query_editor)
.flexible(1., true)
.boxed(),
)
.with_child(ChildView::new(&self.query_editor).flex(1., true).boxed())
.with_children(self.active_editor.as_ref().and_then(|editor| {
let matches = self.editors_with_matches.get(&editor.downgrade())?;
let message = if let Some(match_ix) = self.active_match_index {
+3 -9
View File
@@ -164,12 +164,10 @@ impl View for ProjectSearchView {
.aligned()
.contained()
.with_background_color(theme.editor.background)
.flexible(1., true)
.flex(1., true)
.boxed()
} else {
ChildView::new(&self.results_editor)
.flexible(1., true)
.boxed()
ChildView::new(&self.results_editor).flex(1., true).boxed()
}
}
@@ -691,11 +689,7 @@ impl View for ProjectSearchBar {
Flex::row()
.with_child(
Flex::row()
.with_child(
ChildView::new(&search.query_editor)
.flexible(1., true)
.boxed(),
)
.with_child(ChildView::new(&search.query_editor).flex(1., true).boxed())
.with_children(search.active_match_index.map(|match_ix| {
Label::new(
format!(