diff options
author | 2019-12-30 12:14:26 +0100 | |
---|---|---|
committer | 2019-12-30 12:14:26 +0100 | |
commit | 8caa66be2708b1c83e20d905d69902c2567c4692 (patch) | |
tree | ee18296fc3d32f24bca90f97fc6845d97f3e4c21 /native/src/renderer/null.rs | |
parent | 89a6b8a9a173e767753ec777fd83c912c1be5ea3 (diff) | |
download | iced-8caa66be2708b1c83e20d905d69902c2567c4692.tar.gz iced-8caa66be2708b1c83e20d905d69902c2567c4692.tar.bz2 iced-8caa66be2708b1c83e20d905d69902c2567c4692.zip |
Add `Renderer::Defaults` and style inheritance
Diffstat (limited to 'native/src/renderer/null.rs')
-rw-r--r-- | native/src/renderer/null.rs | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/native/src/renderer/null.rs b/native/src/renderer/null.rs index 1be669c2..56d7e472 100644 --- a/native/src/renderer/null.rs +++ b/native/src/renderer/null.rs @@ -5,16 +5,26 @@ use crate::{ }; /// A renderer that does nothing. +/// +/// It can be useful if you are writing tests! #[derive(Debug, Clone, Copy)] pub struct Null; +impl Null { + pub fn new() -> Null { + Null + } +} + impl Renderer for Null { type Output = (); + type Defaults = (); } impl column::Renderer for Null { fn draw<Message>( &mut self, + _defaults: &Self::Defaults, _content: &[Element<'_, Message, Self>], _layout: Layout<'_>, _cursor_position: Point, @@ -25,6 +35,7 @@ impl column::Renderer for Null { impl row::Renderer for Null { fn draw<Message>( &mut self, + _defaults: &Self::Defaults, _content: &[Element<'_, Message, Self>], _layout: Layout<'_>, _cursor_position: Point, @@ -49,6 +60,7 @@ impl text::Renderer for Null { fn draw( &mut self, + _defaults: &Self::Defaults, _bounds: Rectangle, _content: &str, _size: u16, @@ -119,13 +131,16 @@ impl text_input::Renderer for Null { impl button::Renderer for Null { type Style = (); - fn draw( + fn draw<Message>( &mut self, + _defaults: &Self::Defaults, _bounds: Rectangle, _cursor_position: Point, + _is_disabled: bool, _is_pressed: bool, _style: &Self::Style, - _content: Self::Output, + _content: &Element<'_, Message, Self>, + _content_layout: Layout<'_>, ) -> Self::Output { } } |