![](https://lemmy.world/pictrs/image/e303879c-c03c-4e47-a8ff-a1e121fee797.jpeg)
![](https://lemmy.world/pictrs/image/ac0c7ffa-b719-46fe-982f-2e09cd939760.png)
You can either return cosmic::Element<Message>
, impl Into<cosmic::Element<Message>>
, or cosmic::widget::Button<Message>
with your functions.
Every widget can .into()
or .apply(Element::from)
into a cosmic::Element
.
I’d recommend using the Grid widget so that your buttons can scale with the window.
cosmic::widget::grid()
.push(widget1())
.push(widget2())
.push(widget3())
.insert_row()
.push(widget4())
.push(widget5())
.push(widget6())
.row_spacing(12)
.column_spacing(12)
.justify_content(JustifyContent::Stretch)
.width(Length::Fill)
.height(Length::Fill)
.into()
I don’t think anyone has done this yet.