I have written a calculator in Rust and libcosmic, the design is copied from gnome-calculator; I discovered 2 things:
- I don't like working on UIs.
- I have no idea how to transform
cosmic::widget::button::Builder
to
cosmic::widget::Button;
this code would be so much cleaner if I could return a button::standard() from a function.

2 Comments
edfloreshz@lemmy.ml · 4 pts · 2y
Very nice work! Consider adding your project to COSMIC Project Collection.
https://github.com/edfloreshz/cosmic-project-collection
mmstick@lemmy.world · 3 pts · 2y
You can either return
cosmic::Element<Message>,impl Into<cosmic::Element<Message>>, orcosmic::widget::Button<Message>with your functions.Every widget can
.into()or.apply(Element::from)into acosmic::Element.I'd recommend using the Grid widget so that your buttons can scale with the window.