makepad_render/
cursor.rs

1use crate::cx::*;
2
3#[derive(Clone, Debug, Hash, PartialEq)]
4pub enum MouseCursor {
5    // don't show the cursor
6    Hidden,
7    
8    //  * 
9    //  *  *
10    //  *    *
11    //  *      *
12    //  *   *
13    //  *    *
14    //        *
15    Default,
16    
17    //     |
18    //     |
19    //  ---+---
20    //     |
21    //     |
22    Crosshair,
23    
24    //    * 
25    //    *
26    //    * * * *
27    // *  * * * * 
28    // *  *     *
29    //  * *     * 
30    //  *      *
31    Hand,
32    
33    //  * 
34    //  *  *
35    //  *    *
36    //  *      *
37    //  *   *
38    //  *    *
39    //        *
40    Arrow,
41    
42    //     ^
43    //     |
44    //  <--+-->
45    //     |
46    //     v
47    Move,
48    
49    //   --+--
50    //     |
51    //     |
52    //   __|__
53    Text,
54    
55    //  |******|
56    //   \****/
57    //    \**/ 
58    //    /**\ 
59    //   /****\
60    //  |******|
61    Wait,
62    
63    //  * 
64    //  *  *
65    //  *    *
66    //  *      *
67    //  *   *  
68    //  *    *   ?
69    //        *
70    Help,
71    
72    
73    //    _____
74    //   / \   \
75    //  |   \  |
76    //   \___\/
77    NotAllowed,
78    
79    /*
80    
81    //  * 
82    //  *  *
83    //  *    *
84    //  *      * |----|
85    //  *   *     \--/
86    //  *    *    /--\
87    //        *  |----|
88    Progress,
89
90    //  * 
91    //  *  *
92    //  *    *
93    //  *      *
94    //  *   *   |----|
95    //  *    *  |----|
96    //        * |----|
97    ContextMenu,
98    
99    //     | | 
100    //     | |
101    //  ---+ +---
102    //  ---+ +---
103    //     | |
104    //     | |
105    
106    Cell,
107    //   |     |
108    //   |-----|
109    //   |     |
110    VerticalText,
111    
112    //  * 
113    //  *  *
114    //  *    *
115    //  *      *
116    //  *   *    |  ^ |
117    //  *    *   | /  |
118    //        *      
119    Alias,
120    
121    //  * 
122    //  *  *
123    //  *    *
124    //  *      *
125    //  *   *   
126    //  *    *   |+|
127    //        *       
128    Copy,
129    
130    //    * 
131    //    *
132    //    * * * *
133    // *  * * * *    _____
134    // *  *     *   / \   \
135    //  * *     *  |   \  |
136    //  *      *    \___\/
137    NoDrop,
138    
139    //     
140    //    * * * *
141    //    * * * *
142    // *  * * * * 
143    // *  *     *
144    //  * *     * 
145    //  *      *
146    Grab,
147    
148    //      
149    //    
150    //    * * * *
151    //  * * * * * 
152    // *  *     *
153    //  * *     * 
154    //  *      *
155    Grabbing,
156    
157    //     ^
158    //   < * >
159    //     v 	
160    AllScroll,
161    
162    //   _____
163    //  /  |  \
164    //  | -+- |
165    //  \__|__/
166    //     |
167    //     |
168    ZoomIn,
169    
170    //   _____
171    //  /     \
172    //  | --- |
173    //  \_____/
174    //     |
175    //     |
176    ZoomOut,
177    */
178    
179    
180    //     ^
181    //     |
182    NResize,
183    
184    //     ^
185    //    / 
186    NeResize,
187    
188    //    -->
189    EResize,
190    
191    //    \
192    //     v
193    SeResize,
194    
195    //     |
196    //     v
197    SResize,
198    
199    //    /
200    //   v 
201    SwResize,
202    
203    //    <--
204    WResize,
205    
206    //   ^
207    //    \
208    NwResize,
209    
210    //     ^
211    //     |
212    //     v 	
213    NsResize,
214    
215    //     ^
216    //    / 
217    //   v
218    NeswResize,
219    
220    //  <--->
221    EwResize,
222    
223    //   ^
224    //    \ 
225    //     v
226    NwseResize,
227    
228    //     ||
229    //   <-||->
230    //     ||
231    ColResize,
232    
233    //     ^
234    //     |
235    //   =====
236    //     |
237    //     v 	
238    RowResize,
239}
240
241impl Cx {
242    pub fn set_down_mouse_cursor(&mut self, mouse_cursor: MouseCursor) {
243        // ok so lets set the down mouse cursor
244        self.down_mouse_cursor = Some(mouse_cursor);
245    }
246    pub fn set_hover_mouse_cursor(&mut self, mouse_cursor: MouseCursor) {
247        // the down mouse cursor gets removed when there are no captured fingers
248        self.hover_mouse_cursor = Some(mouse_cursor);
249    }
250}
251
252impl Eq for MouseCursor {}
253impl Default for MouseCursor {
254    fn default() -> MouseCursor {
255        MouseCursor::Default
256    }
257}