summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-04-29 03:21:46 +0200
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-04-29 03:23:02 +0200
commitec712c8032a25c5dc65152c3ab39bddaecbdce77 (patch)
treed84fa3a12f506eec26c2ffb71f508432bac473a4 /core
parent52719c7076cafb7b01967edf4df11ea72ae45aff (diff)
downloadiced-ec712c8032a25c5dc65152c3ab39bddaecbdce77.tar.gz
iced-ec712c8032a25c5dc65152c3ab39bddaecbdce77.tar.bz2
iced-ec712c8032a25c5dc65152c3ab39bddaecbdce77.zip
Move `MouseCursor` to `iced_core`
Diffstat (limited to 'core')
-rw-r--r--core/src/lib.rs2
-rw-r--r--core/src/mouse_cursor.rs36
2 files changed, 38 insertions, 0 deletions
diff --git a/core/src/lib.rs b/core/src/lib.rs
index 606c1b8b..f0072f61 100644
--- a/core/src/lib.rs
+++ b/core/src/lib.rs
@@ -23,6 +23,7 @@ mod button_state;
mod color;
mod font;
mod length;
+mod mouse_cursor;
mod point;
mod rectangle;
mod size;
@@ -34,6 +35,7 @@ pub use button_state::ButtonState;
pub use color::Color;
pub use font::Font;
pub use length::Length;
+pub use mouse_cursor::MouseCursor;
pub use point::Point;
pub use rectangle::Rectangle;
pub use size::Size;
diff --git a/core/src/mouse_cursor.rs b/core/src/mouse_cursor.rs
new file mode 100644
index 00000000..78ddb0ae
--- /dev/null
+++ b/core/src/mouse_cursor.rs
@@ -0,0 +1,36 @@
+/// The state of the mouse cursor.
+#[derive(Debug, Eq, PartialEq, Clone, Copy, PartialOrd, Ord)]
+pub enum MouseCursor {
+ /// The cursor is over a non-interactive widget.
+ Idle,
+
+ /// The cursor is over a clickable widget.
+ Pointer,
+
+ /// The cursor is over a busy widget.
+ Working,
+
+ /// The cursor is over a grabbable widget.
+ Grab,
+
+ /// The cursor is over a text widget.
+ Text,
+
+ /// The cursor is over a widget that requires precision.
+ Crosshair,
+
+ /// The cursor is grabbing a widget.
+ Grabbing,
+
+ /// The cursor is resizing a widget horizontally.
+ ResizingHorizontally,
+
+ /// The cursor is resizing a widget vertically.
+ ResizingVertically,
+}
+
+impl Default for MouseCursor {
+ fn default() -> MouseCursor {
+ MouseCursor::Idle
+ }
+}