Implements a theme animation with the iced_anim crate. This changes the Config to contain a Spring<Theme> and implements Animate for Palette and Theme so that theme changes will be animated when the user changes the theme. A new Theme::Custom case is what enables animations because it takes any custom palette and allows the app to use that palette for theming. This Custom case is what allows the animated theme state to update and isn't serialized to disk at any point.
I also created a new StoredConfig struct that represents the serialized config, which is distinct from the Config struct since the latter may contain an animated state. This guarantees that the animated state value won't be serialized to disk. If you want to test this yourself, you can add a long response time to a SpringMotion on the Spring::new in utils/config.rs and exit the app before the animation is complete - you'll see that the final theme value is serialized and not the intermediate state.
Feel free to rename Config now that it represents less of a configuration and more of an app state - I went with StoredConfig to represent the new serialized config format just to avoid changing more of your app than necessary. Let me know if you have any questions!
Implements a theme animation with the iced_anim crate. This changes the
Config
to contain aSpring<Theme>
and implementsAnimate
forPalette
andTheme
so that theme changes will be animated when the user changes the theme. A newTheme::Custom
case is what enables animations because it takes any custom palette and allows the app to use that palette for theming. ThisCustom
case is what allows the animated theme state to update and isn't serialized to disk at any point.I also created a new
StoredConfig
struct that represents the serialized config, which is distinct from theConfig
struct since the latter may contain an animated state. This guarantees that the animated state value won't be serialized to disk. If you want to test this yourself, you can add a long response time to aSpringMotion
on theSpring::new
inutils/config.rs
and exit the app before the animation is complete - you'll see that the final theme value is serialized and not the intermediate state.Feel free to rename
Config
now that it represents less of a configuration and more of an app state - I went withStoredConfig
to represent the new serialized config format just to avoid changing more of your app than necessary. Let me know if you have any questions!https://github.com/user-attachments/assets/fb60e3a5-87fb-45c0-90ec-b74ce219f33b