[drag-and-drop] Add Grab and Grabbing CursorIcon:s

This commit is contained in:
Emil Ernerfeldt 2020-11-02 17:40:05 +01:00
parent c9c12f2d79
commit ed8a69ab2f
3 changed files with 8 additions and 1 deletions

View file

@ -36,6 +36,9 @@ pub enum CursorIcon {
ResizeNwSe, ResizeNwSe,
ResizeVertical, ResizeVertical,
Text, Text,
/// Used when moving
Grab,
Grabbing,
} }
impl Default for CursorIcon { impl Default for CursorIcon {

View file

@ -153,6 +153,8 @@ pub fn translate_cursor(cursor_icon: egui::CursorIcon) -> glutin::window::Cursor
CursorIcon::ResizeNwSe => glutin::window::CursorIcon::NwseResize, CursorIcon::ResizeNwSe => glutin::window::CursorIcon::NwseResize,
CursorIcon::ResizeVertical => glutin::window::CursorIcon::NsResize, CursorIcon::ResizeVertical => glutin::window::CursorIcon::NsResize,
CursorIcon::Text => glutin::window::CursorIcon::Text, CursorIcon::Text => glutin::window::CursorIcon::Text,
CursorIcon::Grab => glutin::window::CursorIcon::Grab,
CursorIcon::Grabbing => glutin::window::CursorIcon::Grabbing,
} }
} }

View file

@ -167,9 +167,11 @@ fn cursor_web_name(cursor: egui::CursorIcon) -> &'static str {
ResizeNwSe => "nwse-resize", ResizeNwSe => "nwse-resize",
ResizeVertical => "ns-resize", ResizeVertical => "ns-resize",
Text => "text", Text => "text",
Grab => "grab",
Grabbing => "grabbing",
// "no-drop" // "no-drop"
// "not-allowed" // "not-allowed"
// default, help, pointer, progress, wait, cell, crosshair, text, alias, copy, move, grab, grabbing, // default, help, pointer, progress, wait, cell, crosshair, text, alias, copy, move
} }
} }