Rename Drawable::boxed to into_element and make containers generic

Multi-element are now generic over any drawable child, which can be converted
into an element.

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
Co-Authored-By: Max Brunsfeld <max@zed.dev>
This commit is contained in:
Antonio Scandurra
2023-04-21 12:43:19 -06:00
committed by Nathan Sobo
co-authored by Nathan Sobo Max Brunsfeld
parent 4d433663bd
commit 03619dfa55
80 changed files with 1132 additions and 1434 deletions
+4 -7
View File
@@ -89,10 +89,9 @@ impl View for SharedScreen {
})
.contained()
.with_style(cx.global::<Settings>().theme.shared_screen)
.boxed()
})
.on_down(MouseButton::Left, |_, _, cx| cx.focus_parent_view())
.boxed()
.into_element()
}
}
@@ -120,18 +119,16 @@ impl Item for SharedScreen {
.with_width(style.type_icon_width)
.aligned()
.contained()
.with_margin_right(style.spacing)
.boxed(),
.with_margin_right(style.spacing),
)
.with_child(
Label::new(
format!("{}'s screen", self.user.github_login),
style.label.clone(),
)
.aligned()
.boxed(),
.aligned(),
)
.boxed()
.into_element()
}
fn set_nav_history(&mut self, history: ItemNavHistory, _: &mut ViewContext<Self>) {