From 8caa66be2708b1c83e20d905d69902c2567c4692 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Mon, 30 Dec 2019 12:14:26 +0100 Subject: Add `Renderer::Defaults` and style inheritance --- wgpu/src/defaults.rs | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 wgpu/src/defaults.rs (limited to 'wgpu/src/defaults.rs') diff --git a/wgpu/src/defaults.rs b/wgpu/src/defaults.rs new file mode 100644 index 00000000..8de8258b --- /dev/null +++ b/wgpu/src/defaults.rs @@ -0,0 +1,27 @@ +use iced_native::Color; + +#[derive(Debug, Clone, Copy)] +pub struct Defaults { + pub text: Text, +} + +impl Default for Defaults { + fn default() -> Defaults { + Defaults { + text: Text::default(), + } + } +} + +#[derive(Debug, Clone, Copy)] +pub struct Text { + pub color: Color, +} + +impl Default for Text { + fn default() -> Text { + Text { + color: Color::BLACK, + } + } +} -- cgit From 7b278755fc7929633b5771824beac4d39b16e82e Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Thu, 9 Jan 2020 18:31:07 +0100 Subject: Write missing docs and reenable deny statements --- wgpu/src/defaults.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'wgpu/src/defaults.rs') diff --git a/wgpu/src/defaults.rs b/wgpu/src/defaults.rs index 8de8258b..11718a87 100644 --- a/wgpu/src/defaults.rs +++ b/wgpu/src/defaults.rs @@ -1,7 +1,10 @@ +//! Use default styling attributes to inherit styles. use iced_native::Color; +/// Some default styling attributes. #[derive(Debug, Clone, Copy)] pub struct Defaults { + /// Text styling pub text: Text, } @@ -13,8 +16,10 @@ impl Default for Defaults { } } +/// Some default text styling attributes. #[derive(Debug, Clone, Copy)] pub struct Text { + /// The default color of text pub color: Color, } -- cgit