summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorbulia byak <buliabyak@gmail.com>2006-11-06 06:50:58 +0000
committerbuliabyak <buliabyak@users.sourceforge.net>2006-11-06 06:50:58 +0000
commitd4e49cf974f418557543599316c5f2e246856df2 (patch)
treebbc1a10710feeefef95d9690a1edc0369392fda3 /src
parentimplement select next/prev as verbs (diff)
downloadinkscape-d4e49cf974f418557543599316c5f2e246856df2.tar.gz
inkscape-d4e49cf974f418557543599316c5f2e246856df2.zip
implement select next/prev in gradient tool as well
(bzr r1919)
Diffstat (limited to 'src')
-rw-r--r--src/gradient-context.cpp31
-rw-r--r--src/gradient-context.h4
-rw-r--r--src/verbs.cpp5
3 files changed, 26 insertions, 14 deletions
diff --git a/src/gradient-context.cpp b/src/gradient-context.cpp
index f97bd93c8..ad1dd8730 100644
--- a/src/gradient-context.cpp
+++ b/src/gradient-context.cpp
@@ -124,6 +124,24 @@ static void sp_gradient_context_setup(SPEventContext *ec)
rc->_message_context = new Inkscape::MessageContext(sp_desktop_message_stack(ec->desktop));
}
+void
+sp_gradient_context_select_next (SPEventContext *event_context)
+{
+ GrDrag *drag = event_context->_grdrag;
+ g_assert (drag);
+
+ drag->select_next();
+}
+
+void
+sp_gradient_context_select_prev (SPEventContext *event_context)
+{
+ GrDrag *drag = event_context->_grdrag;
+ g_assert (drag);
+
+ drag->select_prev();
+}
+
static gint sp_gradient_context_root_handler(SPEventContext *event_context, GdkEvent *event)
{
static bool dragging;
@@ -274,19 +292,6 @@ static gint sp_gradient_context_root_handler(SPEventContext *event_context, GdkE
//TODO: make dragging escapable by Esc
break;
- case GDK_Tab: // Tab - cycle selection forward
- if (!(MOD__CTRL_ONLY || (MOD__CTRL && MOD__SHIFT))) {
- drag->select_next();
- ret = TRUE;
- }
- break;
- case GDK_ISO_Left_Tab: // Shift Tab - cycle selection backward
- if (!(MOD__CTRL_ONLY || (MOD__CTRL && MOD__SHIFT))) {
- drag->select_prev();
- ret = TRUE;
- }
- break;
-
case GDK_Left: // move handle left
case GDK_KP_Left:
case GDK_KP_4:
diff --git a/src/gradient-context.h b/src/gradient-context.h
index 3eb7910f8..80dfecd3a 100644
--- a/src/gradient-context.h
+++ b/src/gradient-context.h
@@ -38,9 +38,11 @@ struct SPGradientContextClass {
};
/* Standard Gtk function */
-
GtkType sp_gradient_context_get_type();
+void sp_gradient_context_select_next (SPEventContext *event_context);
+void sp_gradient_context_select_prev (SPEventContext *event_context);
+
#endif
diff --git a/src/verbs.cpp b/src/verbs.cpp
index 1495c1f9e..4721de9d5 100644
--- a/src/verbs.cpp
+++ b/src/verbs.cpp
@@ -76,6 +76,7 @@
#include "sp-flowtext.h"
#include "layer-fns.h"
#include "node-context.h"
+#include "gradient-context.h"
/**
@@ -944,6 +945,8 @@ EditVerb::perform(SPAction *action, void *data, void *pdata)
case SP_VERB_EDIT_SELECT_NEXT:
if (tools_isactive(dt, TOOLS_NODES)) {
sp_nodepath_select_next(SP_NODE_CONTEXT(ec)->nodepath);
+ } else if (tools_isactive(dt, TOOLS_GRADIENT)) {
+ sp_gradient_context_select_next (ec);
} else {
sp_selection_item_next();
}
@@ -951,6 +954,8 @@ EditVerb::perform(SPAction *action, void *data, void *pdata)
case SP_VERB_EDIT_SELECT_PREV:
if (tools_isactive(dt, TOOLS_NODES)) {
sp_nodepath_select_prev(SP_NODE_CONTEXT(ec)->nodepath);
+ } else if (tools_isactive(dt, TOOLS_GRADIENT)) {
+ sp_gradient_context_select_prev (ec);
} else {
sp_selection_item_prev();
}