pub enum CursorIcon {
Show 16 variants
Default,
Pointer,
Text,
Crosshair,
Wait,
Progress,
NotAllowed,
Grab,
Grabbing,
Move,
ResizeNorthSouth,
ResizeEastWest,
ResizeNorthEastSouthWest,
ResizeNorthWestSouthEast,
ResizeColumn,
ResizeRow,
}Expand description
A standard cursor shape, defined in crcbl_core::input so the UI can name
one without depending on the shell.
A standard cursor shape.
Names rather than pixels, because every platform already has themed,
correctly scaled, user-configured cursors; crcbl_shell::cursor
explains the rest.
Exhaustive on purpose. Every shell backend maps each shape to its own stock cursor, and a shape added later must fail to compile in each of them rather than fall to an arrow through a wildcard arm. That makes adding a shape a breaking change, which is the price.
Variants§
Default
The platform’s normal arrow.
Pointer
The “this is clickable” hand.
Text
I-beam, for text.
Crosshair
Crosshair, for precise placement.
Wait
Something is happening and input is blocked.
Progress
Something is happening but input still works.
NotAllowed
This action is not allowed here.
Grab
The thing under the pointer can be picked up.
Grabbing
The thing under the pointer is being dragged.
Move
Move in any direction.
ResizeNorthSouth
Resize vertically.
ResizeEastWest
Resize horizontally.
ResizeNorthEastSouthWest
Resize along the ↗↙ diagonal.
ResizeNorthWestSouthEast
Resize along the ↖↘ diagonal.
ResizeColumn
Split pane, vertical divider.
ResizeRow
Split pane, horizontal divider.
Implementations§
Source§impl CursorIcon
impl CursorIcon
Sourcepub const ALL: &'static [CursorIcon]
pub const ALL: &'static [CursorIcon]
Every shape, in declaration order.
Sourcepub const fn as_css_name(self) -> &'static str
pub const fn as_css_name(self) -> &'static str
The CSS/cursor-shape-v1 keyword for this shape.
Backends map from this rather than from the variant name, because the keyword is the string X11 cursor themes and the browser both index by.
Sourcepub fn from_css_name(name: &str) -> Option<CursorIcon>
pub fn from_css_name(name: &str) -> Option<CursorIcon>
The shape a CSS cursor keyword names, matched as CSS matches
keywords: ignoring ASCII case. None for a keyword with no shape
here, auto and none among them, which are not shapes.
Trait Implementations§
Source§impl Clone for CursorIcon
impl Clone for CursorIcon
Source§fn clone(&self) -> CursorIcon
fn clone(&self) -> CursorIcon
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more