diff options
author | 2022-11-09 18:24:14 +0100 | |
---|---|---|
committer | 2022-11-09 18:24:14 +0100 | |
commit | af6f7945a905a04ae0335fdc295678ff95eff5f9 (patch) | |
tree | d44ac78a6200feb90e0359fa9ff62b24c0c64738 /examples | |
parent | 8102f96f12e6cb22dd2a23accea2c70490c8c532 (diff) | |
parent | 925b78a75ddf8e37e70babe4dae78a9970a181f0 (diff) | |
download | iced-af6f7945a905a04ae0335fdc295678ff95eff5f9.tar.gz iced-af6f7945a905a04ae0335fdc295678ff95eff5f9.tar.bz2 iced-af6f7945a905a04ae0335fdc295678ff95eff5f9.zip |
Merge pull request #1519 from iced-rs/customizable-theme
Built-in `Theme` customization
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> { |