diff options
author | 2022-05-25 05:01:18 +0200 | |
---|---|---|
committer | 2022-05-25 05:01:18 +0200 | |
commit | 03eda9b162012c503ead649e5ccb95b7ef1d10ed (patch) | |
tree | a134dbab97011c0a465f4527d2ae0bb771f51554 /src/application.rs | |
parent | 2cfb307f8c3927a0876c6b754a5d7d673b9edfee (diff) | |
download | iced-03eda9b162012c503ead649e5ccb95b7ef1d10ed.tar.gz iced-03eda9b162012c503ead649e5ccb95b7ef1d10ed.tar.bz2 iced-03eda9b162012c503ead649e5ccb95b7ef1d10ed.zip |
Let a `Theme` control the background color of an application
... and remove `Application::background_color`
Diffstat (limited to 'src/application.rs')
-rw-r--r-- | src/application.rs | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/src/application.rs b/src/application.rs index f05d2c4b..01571b56 100644 --- a/src/application.rs +++ b/src/application.rs @@ -1,5 +1,6 @@ +use crate::theme; use crate::window; -use crate::{Color, Command, Element, Executor, Settings, Subscription}; +use crate::{Command, Element, Executor, Settings, Subscription}; /// An interactive cross-platform application. /// @@ -101,7 +102,7 @@ pub trait Application: Sized { type Message: std::fmt::Debug + Send; /// The theme of your [`Application`]. - type Theme: Default; + type Theme: Default + theme::Definition; /// The data needed to initialize your [`Application`]. type Flags; @@ -167,13 +168,6 @@ pub trait Application: Sized { window::Mode::Windowed } - /// Returns the background color of the [`Application`]. - /// - /// By default, it returns [`Color::WHITE`]. - fn background_color(&self) -> Color { - Color::WHITE - } - /// Returns the scale factor of the [`Application`]. /// /// It can be used to dynamically control the size of the UI at runtime @@ -277,10 +271,6 @@ where self.0.subscription() } - fn background_color(&self) -> Color { - self.0.background_color() - } - fn scale_factor(&self) -> f64 { self.0.scale_factor() } |