From 7f3b7075db68a215f4331b4bfba1c8ddd1c4d7f3 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Thu, 26 May 2022 19:02:15 +0200 Subject: Rename `theme::Definition` to `application::StyleSheet` --- style/src/application.rs | 7 +++++++ style/src/lib.rs | 1 + style/src/theme.rs | 9 ++------- 3 files changed, 10 insertions(+), 7 deletions(-) create mode 100644 style/src/application.rs (limited to 'style/src') diff --git a/style/src/application.rs b/style/src/application.rs new file mode 100644 index 00000000..4aa950fb --- /dev/null +++ b/style/src/application.rs @@ -0,0 +1,7 @@ +use iced_core::Color; + +pub trait StyleSheet { + fn background_color(&self) -> Color; + + fn text_color(&self) -> Color; +} diff --git a/style/src/lib.rs b/style/src/lib.rs index d9c3259e..4a0a6a14 100644 --- a/style/src/lib.rs +++ b/style/src/lib.rs @@ -9,6 +9,7 @@ )] pub use iced_core::{Background, Color}; +pub mod application; pub mod button; pub mod checkbox; pub mod container; diff --git a/style/src/theme.rs b/style/src/theme.rs index cf939824..9cfbd1d5 100644 --- a/style/src/theme.rs +++ b/style/src/theme.rs @@ -2,6 +2,7 @@ mod palette; pub use self::palette::Palette; +use crate::application; use crate::button; use crate::slider; @@ -35,13 +36,7 @@ impl Default for Theme { } } -pub trait Definition { - fn background_color(&self) -> Color; - - fn text_color(&self) -> Color; -} - -impl Definition for Theme { +impl application::StyleSheet for Theme { fn background_color(&self) -> Color { let palette = self.extended_palette(); -- cgit