Make horizontal_space and vertical_space fill by default
This commit is contained in:
parent
9dd20ead08
commit
e8049af23d
16 changed files with 54 additions and 46 deletions
|
|
@ -85,7 +85,7 @@ impl Application for Layout {
|
|||
fn view(&self) -> Element<Message> {
|
||||
let header = row![
|
||||
text(self.example.title).size(20).font(Font::MONOSPACE),
|
||||
horizontal_space(Length::Fill),
|
||||
horizontal_space(),
|
||||
checkbox("Explain", self.explain)
|
||||
.on_toggle(Message::ExplainToggled),
|
||||
pick_list(Theme::ALL, Some(&self.theme), Message::ThemeSelected),
|
||||
|
|
@ -117,7 +117,7 @@ impl Application for Layout {
|
|||
.on_press(Message::Previous)
|
||||
.into(),
|
||||
),
|
||||
Some(horizontal_space(Length::Fill).into()),
|
||||
Some(horizontal_space().into()),
|
||||
(!self.example.is_last()).then_some(
|
||||
button("Next →")
|
||||
.padding([5, 10])
|
||||
|
|
@ -251,16 +251,16 @@ fn row_<'a>() -> Element<'a, Message> {
|
|||
}
|
||||
|
||||
fn space<'a>() -> Element<'a, Message> {
|
||||
row!["Left!", horizontal_space(Length::Fill), "Right!"].into()
|
||||
row!["Left!", horizontal_space(), "Right!"].into()
|
||||
}
|
||||
|
||||
fn application<'a>() -> Element<'a, Message> {
|
||||
let header = container(
|
||||
row![
|
||||
square(40),
|
||||
horizontal_space(Length::Fill),
|
||||
horizontal_space(),
|
||||
"Header!",
|
||||
horizontal_space(Length::Fill),
|
||||
horizontal_space(),
|
||||
square(40),
|
||||
]
|
||||
.padding(10)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue