gpui_platform/cursor.rs
1//! Cursor vocabulary shared by `gpui` and its platform backends.
2
3use schemars::JsonSchema;
4use serde::{Deserialize, Serialize};
5
6/// The style of the cursor (pointer)
7#[derive(Copy, Clone, Default, Debug, PartialEq, Eq, Hash, Serialize, Deserialize, JsonSchema)]
8pub enum CursorStyle {
9 /// The default cursor
10 #[default]
11 Arrow,
12
13 /// A text input cursor
14 /// corresponds to the CSS cursor value `text`
15 IBeam,
16
17 /// A crosshair cursor
18 /// corresponds to the CSS cursor value `crosshair`
19 Crosshair,
20
21 /// A closed hand cursor
22 /// corresponds to the CSS cursor value `grabbing`
23 ClosedHand,
24
25 /// An open hand cursor
26 /// corresponds to the CSS cursor value `grab`
27 OpenHand,
28
29 /// A pointing hand cursor
30 /// corresponds to the CSS cursor value `pointer`
31 PointingHand,
32
33 /// A resize left cursor
34 /// corresponds to the CSS cursor value `w-resize`
35 ResizeLeft,
36
37 /// A resize right cursor
38 /// corresponds to the CSS cursor value `e-resize`
39 ResizeRight,
40
41 /// A resize cursor to the left and right
42 /// corresponds to the CSS cursor value `ew-resize`
43 ResizeLeftRight,
44
45 /// A resize up cursor
46 /// corresponds to the CSS cursor value `n-resize`
47 ResizeUp,
48
49 /// A resize down cursor
50 /// corresponds to the CSS cursor value `s-resize`
51 ResizeDown,
52
53 /// A resize cursor directing up and down
54 /// corresponds to the CSS cursor value `ns-resize`
55 ResizeUpDown,
56
57 /// A resize cursor directing up-left and down-right
58 /// corresponds to the CSS cursor value `nesw-resize`
59 ResizeUpLeftDownRight,
60
61 /// A resize cursor directing up-right and down-left
62 /// corresponds to the CSS cursor value `nwse-resize`
63 ResizeUpRightDownLeft,
64
65 /// A cursor indicating that the item/column can be resized horizontally.
66 /// corresponds to the CSS cursor value `col-resize`
67 ResizeColumn,
68
69 /// A cursor indicating that the item/row can be resized vertically.
70 /// corresponds to the CSS cursor value `row-resize`
71 ResizeRow,
72
73 /// A text input cursor for vertical layout
74 /// corresponds to the CSS cursor value `vertical-text`
75 IBeamCursorForVerticalLayout,
76
77 /// A cursor indicating that the operation is not allowed
78 /// corresponds to the CSS cursor value `not-allowed`
79 OperationNotAllowed,
80
81 /// A cursor indicating that the operation will result in a link
82 /// corresponds to the CSS cursor value `alias`
83 DragLink,
84
85 /// A cursor indicating that the operation will result in a copy
86 /// corresponds to the CSS cursor value `copy`
87 DragCopy,
88
89 /// A cursor indicating that the operation will result in a context menu
90 /// corresponds to the CSS cursor value `context-menu`
91 ContextualMenu,
92}