From a7d11944039a1b5ea5b72256e8d15367d99e6010 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Sat, 5 Oct 2019 03:56:18 +0200 Subject: Add `Renderer` and `Primitive` concepts --- native/src/widget/checkbox.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'native/src/widget/checkbox.rs') diff --git a/native/src/widget/checkbox.rs b/native/src/widget/checkbox.rs index 3e307f64..1954305a 100644 --- a/native/src/widget/checkbox.rs +++ b/native/src/widget/checkbox.rs @@ -2,7 +2,7 @@ use std::hash::Hash; use crate::input::{mouse, ButtonState}; -use crate::{Element, Event, Hasher, Layout, MouseCursor, Node, Point, Widget}; +use crate::{Element, Event, Hasher, Layout, Node, Point, Widget}; pub use iced_core::Checkbox; @@ -43,7 +43,7 @@ where renderer: &mut Renderer, layout: Layout<'_>, cursor_position: Point, - ) -> MouseCursor { + ) -> Renderer::Primitive { renderer.draw(&self, layout, cursor_position) } @@ -59,7 +59,7 @@ where /// /// [`Checkbox`]: struct.Checkbox.html /// [renderer]: ../../renderer/index.html -pub trait Renderer { +pub trait Renderer: crate::Renderer { /// Creates a [`Node`] for the provided [`Checkbox`]. /// /// [`Node`]: ../../struct.Node.html @@ -80,7 +80,7 @@ pub trait Renderer { checkbox: &Checkbox, layout: Layout<'_>, cursor_position: Point, - ) -> MouseCursor; + ) -> Self::Primitive; } impl<'a, Message, Renderer> From> -- cgit