summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--AUTHORS1
-rw-r--r--share/keys/default.xml18
-rw-r--r--share/keys/inkscape.xml24
-rw-r--r--share/keys/xara.xml8
-rw-r--r--src/ui/tools/select-tool.cpp32
-rw-r--r--src/verbs.cpp46
-rw-r--r--src/verbs.h6
7 files changed, 98 insertions, 37 deletions
diff --git a/AUTHORS b/AUTHORS
index 975705433..f5f3a4069 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -148,6 +148,7 @@ Abhishek Sharma
Shivaken
Michael Sloan
John Smith
+Sandra Snan
Boštjan Špetič
Aaron Spike
Kaushik Sridharan
diff --git a/share/keys/default.xml b/share/keys/default.xml
index f16be0689..581716d12 100644
--- a/share/keys/default.xml
+++ b/share/keys/default.xml
@@ -405,6 +405,24 @@ override) the bindings in the main default.xml.
<bind key="Page_Down" action="SelectionLower" display="true" />
<bind key="KP_Page_Down" action="SelectionLower" />
+
+ <bind key="comma" action="SelectionShrink" display="true" />
+ <bind key="less" action="SelectionShrink" />
+
+ <bind key="comma" modifiers="Alt" action="SelectionShrinkScreen" />
+ <bind key="less" modifiers="Alt" action="SelectionShrinkScreen" />
+
+ <bind key="comma" modifiers="Ctrl" action="SelectionShrinkHalve" />
+ <bind key="less" modifiers="Ctrl" action="SelectionShrinkHalve" />
+
+ <bind key="period" action="SelectionGrow" display="true" />
+ <bind key="greater" action="SelectionGrow" />
+
+ <bind key="period" modifiers="Alt" action="SelectionGrowScreen" />
+ <bind key="greater" modifiers="Alt" action="SelectionGrowScreen" />
+
+ <bind key="period" modifiers="Ctrl" action="SelectionGrowDouble" />
+ <bind key="greater" modifiers="Ctrl" action="SelectionGrowDouble" />
<bind key="g" modifiers="Ctrl" action="SelectionGroup" display="true" />
<bind key="G" modifiers="Ctrl" action="SelectionGroup" />
diff --git a/share/keys/inkscape.xml b/share/keys/inkscape.xml
index 07192cb37..581716d12 100644
--- a/share/keys/inkscape.xml
+++ b/share/keys/inkscape.xml
@@ -297,8 +297,7 @@ override) the bindings in the main default.xml.
<bind key="z" modifiers="Ctrl" action="EditUndo" display="true" />
<bind key="Z" modifiers="Ctrl" action="EditUndo" />
- <bind key="y" modifiers="Ctrl,Shift" action="EditUndo" />
- <bind key="Y" modifiers="Ctrl,Shift" action="EditUndo" />
+ <!--Do not put in Ctrl,Shift+Y, already used-->
<bind key="z" modifiers="Ctrl,Shift" action="EditRedo" display="true" />
<bind key="Z" modifiers="Ctrl,Shift" action="EditRedo" />
@@ -384,6 +383,9 @@ override) the bindings in the main default.xml.
<bind key="7" action="EditNextPathEffectParameter" display="true" />
+ <bind key="r" modifiers="Ctrl,Shift" action="FitCanvasToSelectionOrDrawing" display="true" />
+ <bind key="R" modifiers="Ctrl,Shift" action="FitCanvasToSelectionOrDrawing" display="true" />
+
<!-- Objects/selection -->
<bind key="h" action="ObjectFlipHorizontally" display="true" />
@@ -403,6 +405,24 @@ override) the bindings in the main default.xml.
<bind key="Page_Down" action="SelectionLower" display="true" />
<bind key="KP_Page_Down" action="SelectionLower" />
+
+ <bind key="comma" action="SelectionShrink" display="true" />
+ <bind key="less" action="SelectionShrink" />
+
+ <bind key="comma" modifiers="Alt" action="SelectionShrinkScreen" />
+ <bind key="less" modifiers="Alt" action="SelectionShrinkScreen" />
+
+ <bind key="comma" modifiers="Ctrl" action="SelectionShrinkHalve" />
+ <bind key="less" modifiers="Ctrl" action="SelectionShrinkHalve" />
+
+ <bind key="period" action="SelectionGrow" display="true" />
+ <bind key="greater" action="SelectionGrow" />
+
+ <bind key="period" modifiers="Alt" action="SelectionGrowScreen" />
+ <bind key="greater" modifiers="Alt" action="SelectionGrowScreen" />
+
+ <bind key="period" modifiers="Ctrl" action="SelectionGrowDouble" />
+ <bind key="greater" modifiers="Ctrl" action="SelectionGrowDouble" />
<bind key="g" modifiers="Ctrl" action="SelectionGroup" display="true" />
<bind key="G" modifiers="Ctrl" action="SelectionGroup" />
diff --git a/share/keys/xara.xml b/share/keys/xara.xml
index 25ebfcb48..92a84d33e 100644
--- a/share/keys/xara.xml
+++ b/share/keys/xara.xml
@@ -263,13 +263,13 @@ Hom/end keys-select minimum or maximum feather values
<bind key="Z" modifiers="Ctrl" action="EditUndo" display="true"/>
<bind key="y" modifiers="Ctrl,Shift" action="EditUndo" />
<bind key="Y" modifiers="Ctrl,Shift" action="EditUndo" />
- <bind key="less" modifiers="Ctrl" action="EditUndo" /> <!-- FIXME: stolen by scaling, redirect that through a verb -->
- <bind key="comma" modifiers="Ctrl" action="EditUndo" /> <!-- FIXME: stolen by scaling, redirect that through a verb -->
+ <bind key="less" modifiers="Ctrl" action="EditUndo" />
+ <bind key="comma" modifiers="Ctrl" action="EditUndo" />
<bind key="y" modifiers="Ctrl" action="EditRedo" display="true"/>
<bind key="Y" modifiers="Ctrl" action="EditRedo" />
- <bind key="greater" modifiers="Ctrl" action="EditRedo" /> <!-- FIXME: stolen by scaling, redirect that through a verb -->
- <bind key="period" modifiers="Ctrl" action="EditRedo" /> <!-- FIXME: stolen by scaling, redirect that through a verb -->
+ <bind key="greater" modifiers="Ctrl" action="EditRedo" />
+ <bind key="period" modifiers="Ctrl" action="EditRedo" />
<bind key="x" modifiers="Ctrl" action="EditCut" display="true"/>
<bind key="X" modifiers="Ctrl" action="EditCut" />
diff --git a/src/ui/tools/select-tool.cpp b/src/ui/tools/select-tool.cpp
index 86a2dbed3..0cdeda0b6 100644
--- a/src/ui/tools/select-tool.cpp
+++ b/src/ui/tools/select-tool.cpp
@@ -1045,37 +1045,7 @@ bool SelectTool::root_handler(GdkEvent* event) {
ret = TRUE;
break;
-
- case GDK_KEY_less:
- case GDK_KEY_comma:
- if (MOD__ALT(event)) {
- gint mul = 1 + gobble_key_events(get_group0_keyval(&event->key), 0); // with any mask
- sp_selection_scale_screen(selection, -2*mul);
- } else if (MOD__CTRL(event)) {
- sp_selection_scale_times(selection, 0.5);
- } else {
- gint mul = 1 + gobble_key_events(get_group0_keyval(&event->key), 0); // with any mask
- sp_selection_scale(selection, -offset*mul);
- }
-
- ret = TRUE;
- break;
-
- case GDK_KEY_greater:
- case GDK_KEY_period:
- if (MOD__ALT(event)) {
- gint mul = 1 + gobble_key_events(get_group0_keyval(&event->key), 0); // with any mask
- sp_selection_scale_screen(selection, 2*mul);
- } else if (MOD__CTRL(event)) {
- sp_selection_scale_times(selection, 2);
- } else {
- gint mul = 1 + gobble_key_events(get_group0_keyval(&event->key), 0); // with any mask
- sp_selection_scale(selection, offset*mul);
- }
-
- ret = TRUE;
- break;
-
+
case GDK_KEY_Return:
if (MOD__CTRL_ONLY(event)) {
if (selection->singleItem()) {
diff --git a/src/verbs.cpp b/src/verbs.cpp
index 72708a7c0..e061eaab6 100644
--- a/src/verbs.cpp
+++ b/src/verbs.cpp
@@ -1101,6 +1101,7 @@ void SelectionVerb::perform(SPAction *action, void *data)
{
Inkscape::Selection *selection = sp_action_get_selection(action);
SPDesktop *dt = sp_action_get_desktop(action);
+ Inkscape::Preferences *prefs = Inkscape::Preferences::get();
// Some of these operations have been modified so they work in command-line mode!
// In this case, all we need is a selection
@@ -1128,6 +1129,38 @@ void SelectionVerb::perform(SPAction *action, void *data)
case SP_VERB_SELECTION_SLICE:
sp_selected_path_slice(selection, dt);
break;
+ case SP_VERB_SELECTION_GROW:
+ {
+ // FIXME these and the other grow/shrink they should use gobble_key_events.
+ // the problem is how to get access to which key, if any, to gobble.
+ sp_selection_scale(selection, prefs->getDoubleLimited("/options/defaultscale/value", 2, 0, 1000));
+ break;
+ }
+ case SP_VERB_SELECTION_GROW_SCREEN:
+ {
+ sp_selection_scale_screen(selection, 2);
+ break;
+ }
+ case SP_VERB_SELECTION_GROW_DOUBLE:
+ {
+ sp_selection_scale_times(selection, 2);
+ break;
+ }
+ case SP_VERB_SELECTION_SHRINK:
+ {
+ sp_selection_scale(selection, -prefs->getDoubleLimited("/options/defaultscale/value", 2, 0, 1000));
+ break;
+ }
+ case SP_VERB_SELECTION_SHRINK_SCREEN:
+ {
+ sp_selection_scale_screen(selection, -2);
+ break;
+ }
+ case SP_VERB_SELECTION_SHRINK_HALVE:
+ {
+ sp_selection_scale_times(selection, 0.5);
+ break;
+ }
case SP_VERB_SELECTION_TO_FRONT:
sp_selection_raise_to_top(selection, dt);
break;
@@ -1858,6 +1891,7 @@ void ZoomVerb::perform(SPAction *action, void *data)
{
gint mul = 1 + Inkscape::UI::Tools::gobble_key_events(
GDK_KEY_KP_Add, 0); // with any mask
+ // FIXME what if zoom out is bound to something other than subtract?
// While drawing with the pen/pencil tool, zoom towards the end of the unfinished path
if (tools_isactive(dt, TOOLS_FREEHAND_PENCIL) || tools_isactive(dt, TOOLS_FREEHAND_PEN)) {
SPCurve *rc = SP_DRAW_CONTEXT(ec)->red_curve;
@@ -2587,6 +2621,18 @@ Verb *Verb::_base_verbs[] = {
// Advanced tutorial for more info
new SelectionVerb(SP_VERB_SELECTION_SLICE, "SelectionCutPath", N_("Cut _Path"),
N_("Cut the bottom path's stroke into pieces, removing fill"), INKSCAPE_ICON("path-cut")),
+ new SelectionVerb(SP_VERB_SELECTION_GROW, "SelectionGrow", N_("_Grow"),
+ N_("Make selected objects bigger"), INKSCAPE_ICON("selection-grow")),
+ new SelectionVerb(SP_VERB_SELECTION_GROW_SCREEN, "SelectionGrowScreen", N_("_Grow on screen"),
+ N_("Make selected objects bigger relative to screen"), INKSCAPE_ICON("selection-grow-screen")),
+ new SelectionVerb(SP_VERB_SELECTION_GROW_DOUBLE, "SelectionGrowDouble", N_("_Double size"),
+ N_("Double the size of selected objects"), INKSCAPE_ICON("selection-grow-double")),
+ new SelectionVerb(SP_VERB_SELECTION_SHRINK, "SelectionShrink", N_("_Shrink"),
+ N_("Make selected objects smaller"), INKSCAPE_ICON("selection-shrink")),
+ new SelectionVerb(SP_VERB_SELECTION_SHRINK_SCREEN, "SelectionShrinkScreen", N_("_Shrink on screen"),
+ N_("Make selected objects smaller relative to screen"), INKSCAPE_ICON("selection-shrink-screen")),
+ new SelectionVerb(SP_VERB_SELECTION_SHRINK_HALVE, "SelectionShrinkHalve", N_("_Halve size"),
+ N_("Halve the size of selected objects"), INKSCAPE_ICON("selection-shrink-halve")),
// TRANSLATORS: "outset": expand a shape by offsetting the object's path,
// i.e. by displacing it perpendicular to the path in each point.
// See also the Advanced Tutorial for explanation.
diff --git a/src/verbs.h b/src/verbs.h
index a273fe76e..1780e0ebf 100644
--- a/src/verbs.h
+++ b/src/verbs.h
@@ -126,6 +126,12 @@ enum {
SP_VERB_SELECTION_SYMDIFF,
SP_VERB_SELECTION_CUT,
SP_VERB_SELECTION_SLICE,
+ SP_VERB_SELECTION_GROW,
+ SP_VERB_SELECTION_GROW_SCREEN,
+ SP_VERB_SELECTION_GROW_DOUBLE,
+ SP_VERB_SELECTION_SHRINK,
+ SP_VERB_SELECTION_SHRINK_SCREEN,
+ SP_VERB_SELECTION_SHRINK_HALVE,
SP_VERB_SELECTION_OFFSET,
SP_VERB_SELECTION_OFFSET_SCREEN,
SP_VERB_SELECTION_OFFSET_SCREEN_10,