summaryrefslogtreecommitdiffstats
path: root/native/src/renderer
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--native/src/renderer.rs3
-rw-r--r--native/src/renderer/null.rs4
2 files changed, 6 insertions, 1 deletions
diff --git a/native/src/renderer.rs b/native/src/renderer.rs
index 73d2f401..a7305a55 100644
--- a/native/src/renderer.rs
+++ b/native/src/renderer.rs
@@ -9,6 +9,9 @@ use crate::{Background, Color, Element, Rectangle, Vector};
/// A component that can be used by widgets to draw themselves on a screen.
pub trait Renderer: Sized {
+ /// The supported theme of the [`Renderer`].
+ type Theme;
+
/// Lays out the elements of a user interface.
///
/// You should override this if you need to perform any operations before or
diff --git a/native/src/renderer/null.rs b/native/src/renderer/null.rs
index a5b2f277..c591f4e2 100644
--- a/native/src/renderer/null.rs
+++ b/native/src/renderer/null.rs
@@ -1,6 +1,6 @@
use crate::renderer::{self, Renderer};
use crate::text::{self, Text};
-use crate::{Background, Font, Point, Rectangle, Size, Vector};
+use crate::{Background, Font, Point, Rectangle, Size, Theme, Vector};
/// A renderer that does nothing.
///
@@ -16,6 +16,8 @@ impl Null {
}
impl Renderer for Null {
+ type Theme = Theme;
+
fn with_layer(&mut self, _bounds: Rectangle, _f: impl FnOnce(&mut Self)) {}
fn with_translation(