diff options
Diffstat (limited to 'native/src/renderer')
-rw-r--r-- | native/src/renderer/null.rs | 36 |
1 files changed, 32 insertions, 4 deletions
diff --git a/native/src/renderer/null.rs b/native/src/renderer/null.rs index 9e91d29f..b1a26c41 100644 --- a/native/src/renderer/null.rs +++ b/native/src/renderer/null.rs @@ -1,8 +1,8 @@ use crate::{ button, checkbox, column, container, pane_grid, progress_bar, radio, row, - scrollable, slider, text, text_input, Color, Element, Font, - HorizontalAlignment, Layout, Point, Rectangle, Renderer, Size, - VerticalAlignment, + scrollable, slider, text, text_input, toggler, Color, Element, Font, + HorizontalAlignment, Layout, Padding, Point, Rectangle, Renderer, Size, + Vector, VerticalAlignment, }; /// A renderer that does nothing. @@ -67,6 +67,18 @@ impl text::Renderer for Null { (0.0, 20.0) } + fn hit_test( + &self, + _contents: &str, + _size: f32, + _font: Self::Font, + _bounds: Size, + _point: Point, + _nearest_only: bool, + ) -> text::Hit { + text::Hit::NearestCharOffset(0, Vector::new(0., 0.)) + } + fn draw( &mut self, _defaults: &Self::Defaults, @@ -145,7 +157,7 @@ impl text_input::Renderer for Null { } impl button::Renderer for Null { - const DEFAULT_PADDING: u16 = 0; + const DEFAULT_PADDING: Padding = Padding::ZERO; type Style = (); @@ -288,3 +300,19 @@ impl pane_grid::Renderer for Null { ) { } } + +impl toggler::Renderer for Null { + type Style = (); + + const DEFAULT_SIZE: u16 = 20; + + fn draw( + &mut self, + _bounds: Rectangle, + _is_checked: bool, + _is_mouse_over: bool, + _label: Option<Self::Output>, + _style: &Self::Style, + ) { + } +} |