feat: move "add element" button into the scrollable
This commit is contained in:
parent
05ee2fc381
commit
52b83efc2c
1 changed files with 44 additions and 41 deletions
13
src/main.rs
13
src/main.rs
|
|
@ -86,7 +86,8 @@ impl State {
|
||||||
])
|
])
|
||||||
.align_y(Vertical::Center)
|
.align_y(Vertical::Center)
|
||||||
.into(),
|
.into(),
|
||||||
widget::scrollable(widget::column(category.elements.iter().enumerate().map(
|
widget::scrollable(
|
||||||
|
widget::column(category.elements.iter().enumerate().map(
|
||||||
|(i_element, element)| {
|
|(i_element, element)| {
|
||||||
widget::row([
|
widget::row([
|
||||||
widget::text_input("content", &element)
|
widget::text_input("content", &element)
|
||||||
|
|
@ -128,13 +129,15 @@ impl State {
|
||||||
])
|
])
|
||||||
.into()
|
.into()
|
||||||
},
|
},
|
||||||
)))
|
))
|
||||||
.into(),
|
.align_x(Horizontal::Center)
|
||||||
|
.push(
|
||||||
widget::button("add element")
|
widget::button("add element")
|
||||||
.on_press(Message::AddElement { i_category })
|
.on_press(Message::AddElement { i_category }),
|
||||||
|
),
|
||||||
|
)
|
||||||
.into(),
|
.into(),
|
||||||
])
|
])
|
||||||
.align_x(Horizontal::Center)
|
|
||||||
.into()
|
.into()
|
||||||
}))
|
}))
|
||||||
.spacing(15)
|
.spacing(15)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue