summaryrefslogtreecommitdiffstats
path: root/pure/src/widget.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2022-05-14 01:47:55 +0200
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2022-05-14 01:56:32 +0200
commit664251f3f5c7b76f69a97683af1468094bba887f (patch)
treef43a495036ed117ce5dbb479c62652d872a6d273 /pure/src/widget.rs
parent5de337f214530faab1d5fe47784afd7006c3f7f0 (diff)
downloadiced-664251f3f5c7b76f69a97683af1468094bba887f.tar.gz
iced-664251f3f5c7b76f69a97683af1468094bba887f.tar.bz2
iced-664251f3f5c7b76f69a97683af1468094bba887f.zip
Draft first-class `Theme` support
RFC: https://github.com/iced-rs/rfcs/pull/6
Diffstat (limited to 'pure/src/widget.rs')
-rw-r--r--pure/src/widget.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/pure/src/widget.rs b/pure/src/widget.rs
index cc04cc96..ab63f7cc 100644
--- a/pure/src/widget.rs
+++ b/pure/src/widget.rs
@@ -53,7 +53,10 @@ use iced_native::{Clipboard, Length, Point, Rectangle, Shell};
///
/// If you want to build your own widgets, you will need to implement this
/// trait.
-pub trait Widget<Message, Renderer> {
+pub trait Widget<Message, Renderer>
+where
+ Renderer: iced_native::Renderer,
+{
/// Returns the width of the [`Widget`].
fn width(&self) -> Length;
@@ -75,6 +78,7 @@ pub trait Widget<Message, Renderer> {
&self,
state: &Tree,
renderer: &mut Renderer,
+ theme: &Renderer::Theme,
style: &renderer::Style,
layout: Layout<'_>,
cursor_position: Point,