iced-mobile/examples/color_palette
Héctor Ramón Jiménez d7a5e54455 Require `Clone` for `Message` early when needed
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`.
2020-10-17 08:10:30 +02:00
..
src Require `Clone` for `Message` early when needed 2020-10-17 08:10:30 +02:00
Cargo.toml Use only `iced` dependency for `color_palette` 2020-05-04 22:55:10 +02:00
README.md Add screenshot to `README` of `color_palette` 2020-05-04 22:53:07 +02:00
screenshot.png Add screenshot of `color_palette` example 2020-05-04 22:51:20 +02:00

README.md

Color palette

A color palette generator, based on a user-defined root color.

You can run it with cargo run:

cargo run --package color_palette