diff options
| author | Maximilian Albert <maximilian.albert@gmail.com> | 2007-12-18 11:28:48 +0000 |
|---|---|---|
| committer | cilix42 <cilix42@users.sourceforge.net> | 2007-12-18 11:28:48 +0000 |
| commit | b5c79db6d7875feae5606da82f881e11a20f1a07 (patch) | |
| tree | 28d36a326156ace58c19f7eb6524d3913ffd92c2 /src/event-context.cpp | |
| parent | Renaming captions and labels in snapping preferences dialog, and inverting th... (diff) | |
| download | inkscape-b5c79db6d7875feae5606da82f881e11a20f1a07.tar.gz inkscape-b5c79db6d7875feae5606da82f881e11a20f1a07.zip | |
Use 'D' to toggle (not just switch to) the dropper tool; closes bug/RFE #170590
(bzr r4253)
Diffstat (limited to 'src/event-context.cpp')
| -rw-r--r-- | src/event-context.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/event-context.cpp b/src/event-context.cpp index 7fca5accb..6186bb36f 100644 --- a/src/event-context.cpp +++ b/src/event-context.cpp @@ -69,6 +69,10 @@ static GObjectClass *parent_class; static bool selector_toggled = FALSE; static int switch_selector_to = 0; +// globals for temporary switching to dropper by 'D' +static bool dropper_toggled = FALSE; +static int switch_dropper_to = 0; + static gint xp = 0, yp = 0; // where drag started static gint tolerance = 0; static bool within_tolerance = false; @@ -277,6 +281,27 @@ sp_toggle_selector(SPDesktop *dt) } /** + * Toggles current tool between active tool and selector tool. + * Subroutine of sp_event_context_private_root_handler(). + */ +static void +sp_toggle_dropper(SPDesktop *dt) +{ + if (!dt->event_context) return; + + if (tools_isactive(dt, TOOLS_DROPPER)) { + if (dropper_toggled) { + if (switch_dropper_to) tools_switch (dt, switch_dropper_to); + dropper_toggled = FALSE; + } else return; + } else { + dropper_toggled = TRUE; + switch_dropper_to = tools_active(dt); + tools_switch (dt, TOOLS_DROPPER); + } +} + +/** * Calculates and keeps track of scroll acceleration. * Subroutine of sp_event_context_private_root_handler(). */ @@ -495,6 +520,11 @@ static gint sp_event_context_private_root_handler(SPEventContext *event_context, ret = sp_shortcut_invoke(shortcut, desktop); break; + case GDK_D: + case GDK_d: + sp_toggle_dropper(desktop); + ret = TRUE; + break; case GDK_W: case GDK_w: case GDK_F4: |
