From 03eda9b162012c503ead649e5ccb95b7ef1d10ed Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Wed, 25 May 2022 05:01:18 +0200 Subject: Let a `Theme` control the background color of an application ... and remove `Application::background_color` --- src/pure/application.rs | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) (limited to 'src/pure/application.rs') diff --git a/src/pure/application.rs b/src/pure/application.rs index 77f68c9e..1306ab6c 100644 --- a/src/pure/application.rs +++ b/src/pure/application.rs @@ -1,6 +1,7 @@ use crate::pure::{self, Pure}; +use crate::theme; use crate::window; -use crate::{Color, Command, Executor, Settings, Subscription}; +use crate::{Command, Executor, Settings, Subscription}; /// A pure version of [`Application`]. /// @@ -22,7 +23,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; @@ -88,13 +89,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 @@ -185,10 +179,6 @@ where A::mode(&self.application) } - fn background_color(&self) -> Color { - A::background_color(&self.application) - } - fn scale_factor(&self) -> f64 { A::scale_factor(&self.application) } -- cgit