diff options
author | 2022-06-07 05:24:43 +0200 | |
---|---|---|
committer | 2022-06-07 05:24:43 +0200 | |
commit | fc13bb3d65c85cfad9f231c0776d3a45f4fbf480 (patch) | |
tree | 224bbe489cc8e90ab0824c2b745403958667077a /examples/game_of_life | |
parent | f92afa795062cf38f0f99d0a1545a990ed35b09c (diff) | |
download | iced-fc13bb3d65c85cfad9f231c0776d3a45f4fbf480.tar.gz iced-fc13bb3d65c85cfad9f231c0776d3a45f4fbf480.tar.bz2 iced-fc13bb3d65c85cfad9f231c0776d3a45f4fbf480.zip |
Implement theme styling for `Canvas`
Diffstat (limited to 'examples/game_of_life')
-rw-r--r-- | examples/game_of_life/src/main.rs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/examples/game_of_life/src/main.rs b/examples/game_of_life/src/main.rs index b2ae6953..35399584 100644 --- a/examples/game_of_life/src/main.rs +++ b/examples/game_of_life/src/main.rs @@ -163,7 +163,7 @@ mod grid { alignment, canvas::event::{self, Event}, canvas::{self, Cache, Canvas, Cursor, Frame, Geometry, Path, Text}, - mouse, Color, Element, Length, Point, Rectangle, Size, Vector, + mouse, Color, Element, Length, Point, Rectangle, Size, Theme, Vector, }; use rustc_hash::{FxHashMap, FxHashSet}; use std::future::Future; @@ -445,7 +445,12 @@ mod grid { } } - fn draw(&self, bounds: Rectangle, cursor: Cursor) -> Vec<Geometry> { + fn draw( + &self, + _theme: &Theme, + bounds: Rectangle, + cursor: Cursor, + ) -> Vec<Geometry> { let center = Vector::new(bounds.width / 2.0, bounds.height / 2.0); let life = self.life_cache.draw(bounds.size(), |frame| { |