Skip to main content

Cursor

Enum Cursor 

Source
pub enum Cursor {
Show 26 variants Default, Pointer, Text, VerticalText, Crosshair, Move, Grab, Grabbing, NotAllowed, Wait, Progress, Help, ContextMenu, Copy, Alias, Cell, ZoomIn, ZoomOut, None, NsResize, EwResize, NeswResize, NwseResize, ColResize, RowResize, Native(Cow<'static, str>),
}
Expand description

The pointer’s shape over a piece (the .cursor() decorator, docs/cursor.md).

The named variants are the CSS cursor vocabulary: the largest set any toolkit accepts as it is (GTK and the DOM take the names verbatim), and every other toolkit’s set is a subset of it or maps onto it. A backend draws its own shape for each name, or the nearest one it has, and answers Cap::Cursor with how faithful that is. Cursor::Native reaches a shape only one toolkit names; the day::cursor::<toolkit> modules carry those as constants, gated on that toolkit’s feature, and every other backend ignores a name it does not know.

A cursor applies to the node and its descendants until a descendant sets its own. Cursor::Default hands the shape back to the platform rather than pinning an arrow, so a reactive cursor can release what it took.

Variants§

§

Default

The platform default (an arrow), and the value that releases a node’s cursor.

§

Pointer

A pointing hand: links and other tap-to-activate content.

§

Text

An I-beam over editable or selectable text.

§

VerticalText

An I-beam for vertical text.

§

Crosshair

§

Move

Four-way move.

§

Grab

An open hand: content that can be dragged.

§

Grabbing

A closed hand: content being dragged.

§

NotAllowed

§

Wait

The app is busy and cannot take input.

§

Progress

The app is busy but still takes input.

§

Help

§

ContextMenu

§

Copy

A drop will copy.

§

Alias

A drop will link.

§

Cell

A table cell.

§

ZoomIn

§

ZoomOut

§

None

No pointer at all.

§

NsResize

Vertical (north–south) resize.

§

EwResize

Horizontal (east–west) resize.

§

NeswResize

Diagonal resize, north-east to south-west.

§

NwseResize

Diagonal resize, north-west to south-east.

§

ColResize

§

RowResize

§

Native(Cow<'static, str>)

A toolkit’s own named cursor, resolved by that backend’s lookup and ignored by every other. Prefer the day::cursor::<toolkit> constants, which are gated on the toolkit.

Implementations§

Source§

impl Cursor

Source

pub const NAMED: [Cursor; 25]

Every named cursor, in declaration order, what a gallery or a test walks.

Source

pub const fn native(name: &'static str) -> Self

A toolkit-specific cursor by its native name (see Cursor::Native).

Source

pub fn css_name(&self) -> &str

The CSS keyword for a named cursor, which GTK and the DOM take as it is. A native cursor answers its own name, so a backend keyed on CSS names may still recognize it.

Trait Implementations§

Source§

impl Clone for Cursor

Source§

fn clone(&self) -> Cursor

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Cursor

Source§

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

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

impl Default for Cursor

Source§

fn default() -> Cursor

Returns the “default value” for a type. Read more
Source§

impl Eq for Cursor

Source§

impl Hash for Cursor

Source§

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

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 Cursor

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Cursor

Auto Trait Implementations§

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.
Day API ↩ Guides· daybrite.dev