summaryrefslogtreecommitdiffstats
path: root/native/src/renderer.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2021-10-18 15:19:04 +0700
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2021-10-18 15:19:04 +0700
commitedea093350e1b576e2b7db50c525e7fa5c3bea9f (patch)
treebcc93c11a804d04e5842cef6c2088911fd4ef822 /native/src/renderer.rs
parent54a9a232f8110364972a8eef966b7b7477573f4f (diff)
downloadiced-edea093350e1b576e2b7db50c525e7fa5c3bea9f.tar.gz
iced-edea093350e1b576e2b7db50c525e7fa5c3bea9f.tar.bz2
iced-edea093350e1b576e2b7db50c525e7fa5c3bea9f.zip
Move `Defaults` from `iced_graphics` to `iced_native`
Diffstat (limited to '')
-rw-r--r--native/src/renderer.rs20
1 files changed, 15 insertions, 5 deletions
diff --git a/native/src/renderer.rs b/native/src/renderer.rs
index 382edb61..e48c701d 100644
--- a/native/src/renderer.rs
+++ b/native/src/renderer.rs
@@ -34,11 +34,6 @@ use crate::{Background, Color, Element, Rectangle, Vector};
/// A component that can take the state of a user interface and produce an
/// output for its users.
pub trait Renderer: Sized {
- /// The default styling attributes of the [`Renderer`].
- ///
- /// This type can be leveraged to implement style inheritance.
- type Defaults: Default;
-
/// Lays out the elements of a user interface.
///
/// You should override this if you need to perform any operations before or
@@ -71,3 +66,18 @@ pub struct Quad {
pub border_width: f32,
pub border_color: Color,
}
+
+/// The styling attributes of a [`Renderer`].
+#[derive(Debug, Clone, Copy, PartialEq)]
+pub struct Style {
+ /// The text color
+ pub text_color: Color,
+}
+
+impl Default for Style {
+ fn default() -> Self {
+ Style {
+ text_color: Color::BLACK,
+ }
+ }
+}