From fc13bb3d65c85cfad9f231c0776d3a45f4fbf480 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Tue, 7 Jun 2022 05:24:43 +0200 Subject: Implement theme styling for `Canvas` --- graphics/src/widget/pure/canvas/program.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'graphics/src/widget/pure/canvas/program.rs') diff --git a/graphics/src/widget/pure/canvas/program.rs b/graphics/src/widget/pure/canvas/program.rs index 058b364b..20c6406e 100644 --- a/graphics/src/widget/pure/canvas/program.rs +++ b/graphics/src/widget/pure/canvas/program.rs @@ -9,7 +9,7 @@ use crate::Rectangle; /// application. /// /// [`Canvas`]: crate::widget::Canvas -pub trait Program { +pub trait Program { /// The internal state mutated by the [`Program`]. type State: Default + 'static; @@ -44,6 +44,7 @@ pub trait Program { fn draw( &self, state: &Self::State, + theme: &Theme, bounds: Rectangle, cursor: Cursor, ) -> Vec; @@ -64,9 +65,9 @@ pub trait Program { } } -impl Program for &T +impl Program for &T where - T: Program, + T: Program, { type State = T::State; @@ -83,10 +84,11 @@ where fn draw( &self, state: &Self::State, + theme: &Theme, bounds: Rectangle, cursor: Cursor, ) -> Vec { - T::draw(self, state, bounds, cursor) + T::draw(self, state, theme, bounds, cursor) } fn mouse_interaction( -- cgit