From ed8a69ab2fa58e3f7b65d2aa957bf6025414cb9f Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Mon, 2 Nov 2020 17:40:05 +0100 Subject: [PATCH] [drag-and-drop] Add Grab and Grabbing CursorIcon:s --- egui/src/types.rs | 3 +++ egui_glium/src/lib.rs | 2 ++ egui_web/src/lib.rs | 4 +++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/egui/src/types.rs b/egui/src/types.rs index 3acb7cd5..47390aab 100644 --- a/egui/src/types.rs +++ b/egui/src/types.rs @@ -36,6 +36,9 @@ pub enum CursorIcon { ResizeNwSe, ResizeVertical, Text, + /// Used when moving + Grab, + Grabbing, } impl Default for CursorIcon { diff --git a/egui_glium/src/lib.rs b/egui_glium/src/lib.rs index c00825cd..56077945 100644 --- a/egui_glium/src/lib.rs +++ b/egui_glium/src/lib.rs @@ -153,6 +153,8 @@ pub fn translate_cursor(cursor_icon: egui::CursorIcon) -> glutin::window::Cursor CursorIcon::ResizeNwSe => glutin::window::CursorIcon::NwseResize, CursorIcon::ResizeVertical => glutin::window::CursorIcon::NsResize, CursorIcon::Text => glutin::window::CursorIcon::Text, + CursorIcon::Grab => glutin::window::CursorIcon::Grab, + CursorIcon::Grabbing => glutin::window::CursorIcon::Grabbing, } } diff --git a/egui_web/src/lib.rs b/egui_web/src/lib.rs index e4109d8c..6d6fc5ca 100644 --- a/egui_web/src/lib.rs +++ b/egui_web/src/lib.rs @@ -167,9 +167,11 @@ fn cursor_web_name(cursor: egui::CursorIcon) -> &'static str { ResizeNwSe => "nwse-resize", ResizeVertical => "ns-resize", Text => "text", + Grab => "grab", + Grabbing => "grabbing", // "no-drop" // "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 } }