summaryrefslogtreecommitdiffstats
path: root/style/src/text.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2022-06-29 10:51:01 +0200
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2022-06-29 10:51:01 +0200
commit1dd1a2f97fc747e15e12b5188dad6c41b0d052ea (patch)
treeba2b24b9c8dec02b9232068dee299ca27a4823ba /style/src/text.rs
parentc807abdfd70c49b0c93868c12f142a2fb4c08036 (diff)
downloadiced-1dd1a2f97fc747e15e12b5188dad6c41b0d052ea.tar.gz
iced-1dd1a2f97fc747e15e12b5188dad6c41b0d052ea.tar.bz2
iced-1dd1a2f97fc747e15e12b5188dad6c41b0d052ea.zip
Introduce `StyleSheet` for `Text` widget
Diffstat (limited to 'style/src/text.rs')
-rw-r--r--style/src/text.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/style/src/text.rs b/style/src/text.rs
new file mode 100644
index 00000000..69a4ed85
--- /dev/null
+++ b/style/src/text.rs
@@ -0,0 +1,18 @@
+use iced_core::Color;
+
+pub trait StyleSheet {
+ type Style: Default + Copy;
+
+ fn appearance(&self, style: Self::Style) -> Appearance;
+}
+
+#[derive(Debug, Clone, Copy)]
+pub struct Appearance {
+ pub color: Option<Color>,
+}
+
+impl Default for Appearance {
+ fn default() -> Self {
+ Self { color: None }
+ }
+}