diff options
author | 2022-07-08 20:07:33 +0200 | |
---|---|---|
committer | 2022-07-08 20:07:33 +0200 | |
commit | bb07d017e8c8e43ac74f66bf649643bebdc5f71d (patch) | |
tree | 6e780f78ef4eae7dbe590a82ceef11e47289d953 /examples/solar_system/src | |
parent | fa55dff61db47197a961152285c6a6abfab0b217 (diff) | |
download | iced-bb07d017e8c8e43ac74f66bf649643bebdc5f71d.tar.gz iced-bb07d017e8c8e43ac74f66bf649643bebdc5f71d.tar.bz2 iced-bb07d017e8c8e43ac74f66bf649643bebdc5f71d.zip |
Add `Style` variant support to `application::StyleSheet`
Diffstat (limited to 'examples/solar_system/src')
-rw-r--r-- | examples/solar_system/src/main.rs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/examples/solar_system/src/main.rs b/examples/solar_system/src/main.rs index 7e0e06b0..cee9a02f 100644 --- a/examples/solar_system/src/main.rs +++ b/examples/solar_system/src/main.rs @@ -6,13 +6,15 @@ //! Inspired by the example found in the MDN docs[1]. //! //! [1]: https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Tutorial/Basic_animations#An_animated_solar_system +use iced::application; use iced::canvas::{self, Cursor, Path, Stroke}; use iced::executor; +use iced::theme::{self, Theme}; use iced::time; use iced::window; use iced::{ Application, Canvas, Color, Command, Element, Length, Point, Rectangle, - Settings, Size, Subscription, Theme, Vector, + Settings, Size, Subscription, Vector, }; use std::time::Instant; @@ -77,6 +79,13 @@ impl Application for SolarSystem { fn theme(&self) -> Theme { Theme::Dark } + + fn style(&self) -> theme::Application { + theme::Application::Custom(|_theme| application::Appearance { + background_color: Color::BLACK, + text_color: Color::WHITE, + }) + } } #[derive(Debug)] |