CursorShape

Enum CursorShape 

Source
#[non_exhaustive]
#[repr(u32)]
pub enum CursorShape {
Show 36 variants Default = 1, ContextMenu = 2, Help = 3, Pointer = 4, Progress = 5, Wait = 6, Cell = 7, Crosshair = 8, Text = 9, VerticalText = 10, Alias = 11, Copy = 12, Move = 13, NoDrop = 14, NotAllowed = 15, Grab = 16, Grabbing = 17, EResize = 18, NResize = 19, NeResize = 20, NwResize = 21, SResize = 22, SeResize = 23, SwResize = 24, WResize = 25, EwResize = 26, NsResize = 27, NeswResize = 28, NwseResize = 29, ColResize = 30, RowResize = 31, AllScroll = 32, ZoomIn = 33, ZoomOut = 34, DndAsk = 35, AllResize = 36,
}
Available on crate feature cursor only.
Expand description

cursor shapes

This enum describes cursor shapes.

The names are taken from the CSS W3C specification: https://w3c.github.io/csswg-drafts/css-ui/#cursor with a few additions.

Note that there are some groups of cursor shapes that are related: The first group is drag-and-drop cursors which are used to indicate the selected action during dnd operations. The second group is resize cursors which are used to indicate resizing and moving possibilities on window borders. It is recommended that the shapes in these groups should use visually compatible images and metaphors.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Default = 1

default cursor

Since version 1.

§

ContextMenu = 2

a context menu is available for the object under the cursor

Since version 1.

§

Help = 3

help is available for the object under the cursor

Since version 1.

§

Pointer = 4

pointer that indicates a link or another interactive element

Since version 1.

§

Progress = 5

progress indicator

Since version 1.

§

Wait = 6

program is busy, user should wait

Since version 1.

§

Cell = 7

a cell or set of cells may be selected

Since version 1.

§

Crosshair = 8

simple crosshair

Since version 1.

§

Text = 9

text may be selected

Since version 1.

§

VerticalText = 10

vertical text may be selected

Since version 1.

§

Alias = 11

drag-and-drop: alias of/shortcut to something is to be created

Since version 1.

§

Copy = 12

drag-and-drop: something is to be copied

Since version 1.

§

Move = 13

drag-and-drop: something is to be moved

Since version 1.

§

NoDrop = 14

drag-and-drop: the dragged item cannot be dropped at the current cursor location

Since version 1.

§

NotAllowed = 15

drag-and-drop: the requested action will not be carried out

Since version 1.

§

Grab = 16

drag-and-drop: something can be grabbed

Since version 1.

§

Grabbing = 17

drag-and-drop: something is being grabbed

Since version 1.

§

EResize = 18

resizing: the east border is to be moved

Since version 1.

§

NResize = 19

resizing: the north border is to be moved

Since version 1.

§

NeResize = 20

resizing: the north-east corner is to be moved

Since version 1.

§

NwResize = 21

resizing: the north-west corner is to be moved

Since version 1.

§

SResize = 22

resizing: the south border is to be moved

Since version 1.

§

SeResize = 23

resizing: the south-east corner is to be moved

Since version 1.

§

SwResize = 24

resizing: the south-west corner is to be moved

Since version 1.

§

WResize = 25

resizing: the west border is to be moved

Since version 1.

§

EwResize = 26

resizing: the east and west borders are to be moved

Since version 1.

§

NsResize = 27

resizing: the north and south borders are to be moved

Since version 1.

§

NeswResize = 28

resizing: the north-east and south-west corners are to be moved

Since version 1.

§

NwseResize = 29

resizing: the north-west and south-east corners are to be moved

Since version 1.

§

ColResize = 30

resizing: that the item/column can be resized horizontally

Since version 1.

§

RowResize = 31

resizing: that the item/row can be resized vertically

Since version 1.

§

AllScroll = 32

something can be scrolled in any direction

Since version 1.

§

ZoomIn = 33

something can be zoomed in

Since version 1.

§

ZoomOut = 34

something can be zoomed out

Since version 1.

§

DndAsk = 35

drag-and-drop: the user will select which action will be carried out (non-css value)

Since version 2.

§

AllResize = 36

resizing: something can be moved or resized in any direction (non-css value)

Since version 2.

Trait Implementations§

Source§

impl Clone for Shape

Source§

fn clone(&self) -> Shape

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Shape

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Hash for Shape

Source§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for Shape

Source§

fn eq(&self, other: &Shape) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl TryFrom<u32> for Shape

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(val: u32) -> Result<Shape, ()>

Performs the conversion.
Source§

impl Copy for Shape

Source§

impl Eq for Shape

Source§

impl StructuralPartialEq for Shape

Auto Trait Implementations§

§

impl Freeze for Shape

§

impl RefUnwindSafe for Shape

§

impl Send for Shape

§

impl Sync for Shape

§

impl Unpin for Shape

§

impl UnwindSafe for Shape

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.