diff options
author | 2022-11-09 04:05:31 +0100 | |
---|---|---|
committer | 2022-11-09 04:05:31 +0100 | |
commit | 18fb74f20092b2703a90afdb01f39754445998da (patch) | |
tree | f178b11be114717059c36248c45f8a005dbe5a38 /examples | |
parent | 8102f96f12e6cb22dd2a23accea2c70490c8c532 (diff) | |
download | iced-18fb74f20092b2703a90afdb01f39754445998da.tar.gz iced-18fb74f20092b2703a90afdb01f39754445998da.tar.bz2 iced-18fb74f20092b2703a90afdb01f39754445998da.zip |
Introduce `Custom` variants for every style in the built-in `Theme`
Diffstat (limited to 'examples')
-rw-r--r-- | examples/solar_system/src/main.rs | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/examples/solar_system/src/main.rs b/examples/solar_system/src/main.rs index 56787a99..9e303576 100644 --- a/examples/solar_system/src/main.rs +++ b/examples/solar_system/src/main.rs @@ -79,10 +79,14 @@ impl Application for SolarSystem { } fn style(&self) -> theme::Application { - theme::Application::Custom(|_theme| application::Appearance { - background_color: Color::BLACK, - text_color: Color::WHITE, - }) + fn dark_background(_theme: &Theme) -> application::Appearance { + application::Appearance { + background_color: Color::BLACK, + text_color: Color::WHITE, + } + } + + theme::Application::from(dark_background as fn(&Theme) -> _) } fn subscription(&self) -> Subscription<Message> { |