diff options
author | 2020-04-30 08:16:38 +0200 | |
---|---|---|
committer | 2020-04-30 08:16:38 +0200 | |
commit | 98bc8cf2a7c4944d762a0148ca9f615d6ccc0d6e (patch) | |
tree | 9e22665e41793517b7ba0b48d7315d3283dfde91 /core | |
parent | d4c4198f7242f168de65146e0ca339e0c1cbfe9b (diff) | |
download | iced-98bc8cf2a7c4944d762a0148ca9f615d6ccc0d6e.tar.gz iced-98bc8cf2a7c4944d762a0148ca9f615d6ccc0d6e.tar.bz2 iced-98bc8cf2a7c4944d762a0148ca9f615d6ccc0d6e.zip |
Rename `MouseCursor` to `mouse::Interaction`
Diffstat (limited to 'core')
-rw-r--r-- | core/src/lib.rs | 2 | ||||
-rw-r--r-- | core/src/mouse.rs | 2 | ||||
-rw-r--r-- | core/src/mouse/interaction.rs | 20 | ||||
-rw-r--r-- | core/src/mouse_cursor.rs | 36 |
4 files changed, 22 insertions, 38 deletions
diff --git a/core/src/lib.rs b/core/src/lib.rs index ec1e185a..6b9e612e 100644 --- a/core/src/lib.rs +++ b/core/src/lib.rs @@ -22,7 +22,6 @@ mod background; mod color; mod font; mod length; -mod mouse_cursor; mod point; mod rectangle; mod size; @@ -33,7 +32,6 @@ pub use background::Background; 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.rs b/core/src/mouse.rs index 101e04d5..25ce6ac3 100644 --- a/core/src/mouse.rs +++ b/core/src/mouse.rs @@ -1,6 +1,8 @@ //! Reuse basic mouse types. mod button; mod event; +mod interaction; pub use button::Button; pub use event::{Event, ScrollDelta}; +pub use interaction::Interaction; diff --git a/core/src/mouse/interaction.rs b/core/src/mouse/interaction.rs new file mode 100644 index 00000000..664147a7 --- /dev/null +++ b/core/src/mouse/interaction.rs @@ -0,0 +1,20 @@ +/// The interaction of a mouse cursor. +#[derive(Debug, Eq, PartialEq, Clone, Copy, PartialOrd, Ord)] +#[allow(missing_docs)] +pub enum Interaction { + Idle, + Pointer, + Grab, + Text, + Crosshair, + Working, + Grabbing, + ResizingHorizontally, + ResizingVertically, +} + +impl Default for Interaction { + fn default() -> Interaction { + Interaction::Idle + } +} diff --git a/core/src/mouse_cursor.rs b/core/src/mouse_cursor.rs deleted file mode 100644 index 78ddb0ae..00000000 --- a/core/src/mouse_cursor.rs +++ /dev/null @@ -1,36 +0,0 @@ -/// 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 - } -} |