2023-06-19 16:18:17 +00:00
|
|
|
use bevy_reflect::{prelude::ReflectDefault, FromReflect, Reflect, ReflectFromReflect};
|
2023-01-19 00:38:28 +00:00
|
|
|
|
|
|
|
#[cfg(feature = "serialize")]
|
|
|
|
use bevy_reflect::{ReflectDeserialize, ReflectSerialize};
|
|
|
|
|
2022-06-16 13:20:37 +00:00
|
|
|
/// The icon to display for a window's cursor.
|
|
|
|
///
|
|
|
|
/// Examples of all of these cursors can be found [here](https://www.w3schools.com/cssref/playit.asp?filename=playcss_cursor).
|
|
|
|
/// This `enum` is simply a copy of a similar `enum` found in [`winit`](https://docs.rs/winit/latest/winit/window/enum.CursorIcon.html).
|
2022-07-21 20:46:54 +00:00
|
|
|
/// `winit`, in turn, mostly copied cursor types available in the browser.
|
2023-01-19 00:38:28 +00:00
|
|
|
#[derive(Default, Debug, Hash, PartialEq, Eq, Clone, Copy, Reflect, FromReflect)]
|
|
|
|
#[cfg_attr(
|
|
|
|
feature = "serialize",
|
|
|
|
derive(serde::Serialize, serde::Deserialize),
|
|
|
|
reflect(Serialize, Deserialize)
|
|
|
|
)]
|
2023-06-19 16:18:17 +00:00
|
|
|
#[reflect(Debug, PartialEq, Default, FromReflect)]
|
2021-12-20 22:04:45 +00:00
|
|
|
pub enum CursorIcon {
|
2022-06-16 13:20:37 +00:00
|
|
|
/// The platform-dependent default cursor.
|
2023-01-19 00:38:28 +00:00
|
|
|
#[default]
|
2021-12-20 22:04:45 +00:00
|
|
|
Default,
|
2022-06-16 13:20:37 +00:00
|
|
|
/// A simple crosshair.
|
2021-12-20 22:04:45 +00:00
|
|
|
Crosshair,
|
2022-06-16 13:20:37 +00:00
|
|
|
/// A hand (often used to indicate links in web browsers).
|
2021-12-20 22:04:45 +00:00
|
|
|
Hand,
|
2022-06-16 13:20:37 +00:00
|
|
|
/// An arrow. This is the default cursor on most systems.
|
2021-12-20 22:04:45 +00:00
|
|
|
Arrow,
|
2022-06-16 13:20:37 +00:00
|
|
|
/// Indicates something is to be moved.
|
2021-12-20 22:04:45 +00:00
|
|
|
Move,
|
2022-06-16 13:20:37 +00:00
|
|
|
/// Indicates text that may be selected or edited.
|
2021-12-20 22:04:45 +00:00
|
|
|
Text,
|
2022-06-16 13:20:37 +00:00
|
|
|
/// Program busy indicator.
|
2021-12-20 22:04:45 +00:00
|
|
|
Wait,
|
2022-06-16 13:20:37 +00:00
|
|
|
/// Help indicator (often rendered as a "?")
|
2021-12-20 22:04:45 +00:00
|
|
|
Help,
|
2022-06-16 13:20:37 +00:00
|
|
|
/// Progress indicator. Shows that processing is being done.
|
|
|
|
///
|
|
|
|
/// But in contrast with "Wait" the user may still interact with the program.
|
|
|
|
/// Often rendered as a spinning beach ball, or an arrow with a watch or hourglass.
|
2021-12-20 22:04:45 +00:00
|
|
|
Progress,
|
2022-06-16 13:20:37 +00:00
|
|
|
/// Cursor showing that something cannot be done.
|
2021-12-20 22:04:45 +00:00
|
|
|
NotAllowed,
|
2022-06-16 13:20:37 +00:00
|
|
|
/// Indicates that a context menu is available.
|
2021-12-20 22:04:45 +00:00
|
|
|
ContextMenu,
|
2022-06-16 13:20:37 +00:00
|
|
|
/// Indicates that a cell (or set of cells) may be selected.
|
2021-12-20 22:04:45 +00:00
|
|
|
Cell,
|
2022-06-16 13:20:37 +00:00
|
|
|
/// Indicates vertical text that may be selected or edited.
|
2021-12-20 22:04:45 +00:00
|
|
|
VerticalText,
|
2022-06-16 13:20:37 +00:00
|
|
|
/// Indicates that an alias of something is to be created.
|
2021-12-20 22:04:45 +00:00
|
|
|
Alias,
|
2022-06-16 13:20:37 +00:00
|
|
|
/// Indicates something is to be copied.
|
2021-12-20 22:04:45 +00:00
|
|
|
Copy,
|
2022-06-16 13:20:37 +00:00
|
|
|
/// Indicates that the dragged item cannot be dropped here.
|
2021-12-20 22:04:45 +00:00
|
|
|
NoDrop,
|
2022-06-16 13:20:37 +00:00
|
|
|
/// Indicates that something can be grabbed.
|
2021-12-20 22:04:45 +00:00
|
|
|
Grab,
|
2022-06-16 13:20:37 +00:00
|
|
|
/// Indicates that something is grabbed.
|
2021-12-20 22:04:45 +00:00
|
|
|
Grabbing,
|
2022-06-16 13:20:37 +00:00
|
|
|
/// Indicates that the user can scroll by dragging the mouse.
|
2021-12-20 22:04:45 +00:00
|
|
|
AllScroll,
|
2022-06-16 13:20:37 +00:00
|
|
|
/// Indicates that the user can zoom in.
|
2021-12-20 22:04:45 +00:00
|
|
|
ZoomIn,
|
2022-06-16 13:20:37 +00:00
|
|
|
/// Indicates that the user can zoom out.
|
2021-12-20 22:04:45 +00:00
|
|
|
ZoomOut,
|
2022-06-16 13:20:37 +00:00
|
|
|
/// Indicates that an edge of a box is to be moved right (east).
|
2021-12-20 22:04:45 +00:00
|
|
|
EResize,
|
2022-06-16 13:20:37 +00:00
|
|
|
/// Indicates that an edge of a box is to be moved up (north).
|
2021-12-20 22:04:45 +00:00
|
|
|
NResize,
|
2022-06-16 13:20:37 +00:00
|
|
|
/// Indicates that an edge of a box is to be moved up and right (north/east).
|
2021-12-20 22:04:45 +00:00
|
|
|
NeResize,
|
2022-06-16 13:20:37 +00:00
|
|
|
/// indicates that an edge of a box is to be moved up and left (north/west).
|
2021-12-20 22:04:45 +00:00
|
|
|
NwResize,
|
2022-06-16 13:20:37 +00:00
|
|
|
/// Indicates that an edge of a box is to be moved down (south).
|
2021-12-20 22:04:45 +00:00
|
|
|
SResize,
|
2022-06-16 13:20:37 +00:00
|
|
|
/// The cursor indicates that an edge of a box is to be moved down and right (south/east).
|
2021-12-20 22:04:45 +00:00
|
|
|
SeResize,
|
2022-06-16 13:20:37 +00:00
|
|
|
/// The cursor indicates that an edge of a box is to be moved down and left (south/west).
|
2021-12-20 22:04:45 +00:00
|
|
|
SwResize,
|
2022-06-16 13:20:37 +00:00
|
|
|
/// Indicates that an edge of a box is to be moved left (west).
|
2021-12-20 22:04:45 +00:00
|
|
|
WResize,
|
2022-06-16 13:20:37 +00:00
|
|
|
/// Indicates a bidirectional resize cursor.
|
2021-12-20 22:04:45 +00:00
|
|
|
EwResize,
|
2022-06-16 13:20:37 +00:00
|
|
|
/// Indicates a bidirectional resize cursor.
|
2021-12-20 22:04:45 +00:00
|
|
|
NsResize,
|
2022-06-16 13:20:37 +00:00
|
|
|
/// Indicates a bidirectional resize cursor.
|
2021-12-20 22:04:45 +00:00
|
|
|
NeswResize,
|
2022-06-16 13:20:37 +00:00
|
|
|
/// Indicates a bidirectional resize cursor.
|
2021-12-20 22:04:45 +00:00
|
|
|
NwseResize,
|
2022-06-16 13:20:37 +00:00
|
|
|
/// Indicates that a column can be resized horizontally.
|
2021-12-20 22:04:45 +00:00
|
|
|
ColResize,
|
2022-06-16 13:20:37 +00:00
|
|
|
/// Indicates that the row can be resized vertically.
|
2021-12-20 22:04:45 +00:00
|
|
|
RowResize,
|
|
|
|
}
|