summaryrefslogtreecommitdiffstats
path: root/examples/game_of_life
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-04-30 08:16:38 +0200
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-04-30 08:16:38 +0200
commit98bc8cf2a7c4944d762a0148ca9f615d6ccc0d6e (patch)
tree9e22665e41793517b7ba0b48d7315d3283dfde91 /examples/game_of_life
parentd4c4198f7242f168de65146e0ca339e0c1cbfe9b (diff)
downloadiced-98bc8cf2a7c4944d762a0148ca9f615d6ccc0d6e.tar.gz
iced-98bc8cf2a7c4944d762a0148ca9f615d6ccc0d6e.tar.bz2
iced-98bc8cf2a7c4944d762a0148ca9f615d6ccc0d6e.zip
Rename `MouseCursor` to `mouse::Interaction`
Diffstat (limited to 'examples/game_of_life')
-rw-r--r--examples/game_of_life/src/main.rs19
1 files changed, 11 insertions, 8 deletions
diff --git a/examples/game_of_life/src/main.rs b/examples/game_of_life/src/main.rs
index 5a58a8cb..f0891db1 100644
--- a/examples/game_of_life/src/main.rs
+++ b/examples/game_of_life/src/main.rs
@@ -157,8 +157,7 @@ impl Application for GameOfLife {
mod grid {
use iced::{
canvas::{self, Canvas, Cursor, Event, Frame, Geometry, Path},
- mouse, Color, Element, Length, MouseCursor, Point, Rectangle, Size,
- Vector,
+ mouse, Color, Element, Length, Point, Rectangle, Size, Vector,
};
use std::collections::{HashMap, HashSet};
@@ -397,16 +396,20 @@ mod grid {
vec![life, hovered_cell]
}
- fn mouse_cursor(
+ fn mouse_interaction(
&self,
bounds: Rectangle,
cursor: Cursor,
- ) -> MouseCursor {
+ ) -> mouse::Interaction {
match self.interaction {
- Some(Interaction::Drawing) => MouseCursor::Crosshair,
- Some(Interaction::Panning { .. }) => MouseCursor::Grabbing,
- None if cursor.is_over(&bounds) => MouseCursor::Crosshair,
- _ => MouseCursor::default(),
+ Some(Interaction::Drawing) => mouse::Interaction::Crosshair,
+ Some(Interaction::Panning { .. }) => {
+ mouse::Interaction::Grabbing
+ }
+ None if cursor.is_over(&bounds) => {
+ mouse::Interaction::Crosshair
+ }
+ _ => mouse::Interaction::default(),
}
}
}