From: johanengelen Date: Sun, 17 Sep 2006 10:08:21 +0000 (+0000) Subject: When an object is selected and Alt is pressed: now the cursor changes to the move... X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=f1b3640fb56573906f1cf41ff79a6bef6dc75eb4;p=inkscape.git When an object is selected and Alt is pressed: now the cursor changes to the move-cursor. Handy for newcomers :) --- diff --git a/src/select-context.cpp b/src/select-context.cpp index 6cffdc076..7efd013ec 100644 --- a/src/select-context.cpp +++ b/src/select-context.cpp @@ -627,6 +627,19 @@ sp_select_context_root_handler(SPEventContext *event_context, GdkEvent *event) _("Ctrl: select in groups, move hor/vert"), _("Shift: toggle select, force rubberband, disable snapping"), _("Alt: select under, move selected")); + // if Alt then change cursor to moving cursor: + guint keyval = get_group0_keyval(&event->key); + bool alt = ( MOD__ALT + || (keyval == GDK_Alt_L) + || (keyval == GDK_Alt_R) + || (keyval == GDK_Meta_L) + || (keyval == GDK_Meta_R)); + if (alt) { + GdkCursor *cursor = gdk_cursor_new(GDK_FLEUR); + gdk_window_set_cursor(GTK_WIDGET(sp_desktop_canvas(desktop))->window, cursor); + gdk_cursor_destroy(cursor); + } + //*/ break; } @@ -799,6 +812,8 @@ sp_select_context_root_handler(SPEventContext *event_context, GdkEvent *event) case GDK_KEY_RELEASE: if (key_is_a_modifier (get_group0_keyval (&event->key))) event_context->defaultMessageContext()->clear(); + // set cursor to default. + gdk_window_set_cursor(GTK_WIDGET(sp_desktop_canvas(desktop))->window, event_context->cursor); break; default: break;