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 +++++++ 1 file changed, 7 insertions(+) create mode 100644 style/src/application.rs (limited to 'style/src/application.rs') 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; +} -- cgit From bb07d017e8c8e43ac74f66bf649643bebdc5f71d Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Fri, 8 Jul 2022 20:07:33 +0200 Subject: Add `Style` variant support to `application::StyleSheet` --- style/src/application.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'style/src/application.rs') diff --git a/style/src/application.rs b/style/src/application.rs index 4aa950fb..d48c6a34 100644 --- a/style/src/application.rs +++ b/style/src/application.rs @@ -1,7 +1,13 @@ use iced_core::Color; pub trait StyleSheet { - fn background_color(&self) -> Color; + type Style: Default + Copy; - fn text_color(&self) -> Color; + fn appearance(&self, style: Self::Style) -> Appearance; +} + +#[derive(Debug, Clone, Copy, PartialEq)] +pub struct Appearance { + pub background_color: Color, + pub text_color: Color, } -- cgit