summaryrefslogtreecommitdiffstats
path: root/native/src/renderer
diff options
context:
space:
mode:
Diffstat (limited to 'native/src/renderer')
-rw-r--r--native/src/renderer/debugger.rs1
-rw-r--r--native/src/renderer/null.rs30
-rw-r--r--native/src/renderer/windowed.rs3
3 files changed, 26 insertions, 8 deletions
diff --git a/native/src/renderer/debugger.rs b/native/src/renderer/debugger.rs
index 4cc50661..30f3d9a0 100644
--- a/native/src/renderer/debugger.rs
+++ b/native/src/renderer/debugger.rs
@@ -17,6 +17,7 @@ pub trait Debugger: super::Renderer {
/// [`Element::explain`]: struct.Element.html#method.explain
fn explain<Message>(
&mut self,
+ defaults: &Self::Defaults,
widget: &dyn Widget<Message, Self>,
layout: Layout<'_>,
cursor_position: Point,
diff --git a/native/src/renderer/null.rs b/native/src/renderer/null.rs
index 43076d61..56d7e472 100644
--- a/native/src/renderer/null.rs
+++ b/native/src/renderer/null.rs
@@ -1,20 +1,30 @@
use crate::{
- button, checkbox, column, radio, row, scrollable, text, text_input,
- Background, Color, Element, Font, HorizontalAlignment, Layout, Point,
- Rectangle, Renderer, Size, VerticalAlignment,
+ button, checkbox, column, radio, row, scrollable, text, text_input, Color,
+ Element, Font, HorizontalAlignment, Layout, Point, Rectangle, Renderer,
+ Size, VerticalAlignment,
};
/// 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,
@@ -117,14 +129,18 @@ impl text_input::Renderer for Null {
}
impl button::Renderer for Null {
- fn draw(
+ type Style = ();
+
+ fn draw<Message>(
&mut self,
+ _defaults: &Self::Defaults,
_bounds: Rectangle,
_cursor_position: Point,
+ _is_disabled: bool,
_is_pressed: bool,
- _background: Option<Background>,
- _border_radius: u16,
- _content: Self::Output,
+ _style: &Self::Style,
+ _content: &Element<'_, Message, Self>,
+ _content_layout: Layout<'_>,
) -> Self::Output {
}
}
diff --git a/native/src/renderer/windowed.rs b/native/src/renderer/windowed.rs
index 813a03f2..89f80bbe 100644
--- a/native/src/renderer/windowed.rs
+++ b/native/src/renderer/windowed.rs
@@ -1,4 +1,4 @@
-use crate::MouseCursor;
+use crate::{Color, MouseCursor};
use raw_window_handle::HasRawWindowHandle;
@@ -19,6 +19,7 @@ pub trait Windowed: super::Renderer + Sized {
/// top of the GUI on most scenarios.
fn draw<T: AsRef<str>>(
&mut self,
+ clear_color: Color,
output: &Self::Output,
overlay: &[T],
target: &mut Self::Target,