Prior to this change, the widgets that needed a `Clone` bound on `Message` to implement the `Widget` trait could be created with a non-cloneable `Message`. As a consequence, the compiler complained only when actually trying to use the `Widget` trait. Normally, this happens when trying to `push` the widget in a container or turn it into an `Element`. Furthermore, the compiler error in this case does not mention `Message` nor the `Clone` bound, but instead complains about a missing `From` implementation. Thus, it can easily cause confusion! This change introduces `Clone` bounds in the main implementation of the widgets that need it to properly implement the `Widget` trait. As a result, the compiler complains early when trying to create one of these widgets with a non-cloneable `Message` and explicitly mentions that the `Message` needs to implement `Clone`. |
||
|---|---|---|
| .. | ||
| images | ||
| src | ||
| Cargo.toml | ||
| README.md | ||
Tour
A simple UI tour that can run both on native platforms and the web! It showcases different widgets that can be built using Iced.
The main file contains all the code of the example! All the cross-platform GUI is defined in terms of state, messages, update logic and view logic.
You can run the native version with cargo run:
cargo run --package tour
The web version can be run by following the usage instructions of iced_web or by accessing iced.rs!