diff options
| author | Marc Jeanmougin <marc@jeanmougin.fr> | 2015-09-17 00:24:19 +0000 |
|---|---|---|
| committer | Marc Jeanmougin <marcjeanmougin@free.fr> | 2015-09-17 00:24:19 +0000 |
| commit | ab9ef493fa3a752c5e16da7f3e187b4c00031442 (patch) | |
| tree | 3160bc53fa9144d1edab1c37fe80158d265da661 /src | |
| parent | Extensions. Interpolate: optionally use z-order instead of selection order (w... (diff) | |
| download | inkscape-ab9ef493fa3a752c5e16da7f3e187b4c00031442.tar.gz inkscape-ab9ef493fa3a752c5e16da7f3e187b4c00031442.zip | |
Added a pref option to disable "spacebar panning". (default:enabled)
Fixed bugs:
- https://launchpad.net/bugs/1401593
(bzr r14372)
Diffstat (limited to 'src')
| -rw-r--r-- | src/preferences-skeleton.h | 2 | ||||
| -rw-r--r-- | src/ui/dialog/inkscape-preferences.cpp | 8 | ||||
| -rw-r--r-- | src/ui/tools/tool-base.cpp | 9 |
3 files changed, 8 insertions, 11 deletions
diff --git a/src/preferences-skeleton.h b/src/preferences-skeleton.h index f4a08b928..b428cbe7a 100644 --- a/src/preferences-skeleton.h +++ b/src/preferences-skeleton.h @@ -269,7 +269,7 @@ static char const preferences_skeleton[] = " <group id=\"zoomcorrection\" value=\"1.0\" unit=\"mm\"/>\n" " <group id=\"keyscroll\" value=\"15\"/>\n" " <group id=\"wheelscroll\" value=\"40\"/>\n" -" <group id=\"spacepans\" value=\"0\"/>\n" +" <group id=\"spacebarpans\" value=\"1\"/>\n" " <group id=\"wheelzooms\" value=\"0\"/>\n" " <group id=\"transientpolicy\" value=\"1\"/>\n" " <group id=\"scrollingacceleration\" value=\"0.4\"/>\n" diff --git a/src/ui/dialog/inkscape-preferences.cpp b/src/ui/dialog/inkscape-preferences.cpp index 49864ccbb..14eaa65aa 100644 --- a/src/ui/dialog/inkscape-preferences.cpp +++ b/src/ui/dialog/inkscape-preferences.cpp @@ -1250,11 +1250,9 @@ void InkscapePreferences::initPageBehavior() _scroll_auto_thres.init ( "/options/autoscrolldistance/value", -600.0, 600.0, 1.0, 1.0, -10.0, true, false); _page_scrolling.add_line( true, _("_Threshold:"), _scroll_auto_thres, _("pixels"), _("How far (in screen pixels) you need to be from the canvas edge to trigger autoscroll; positive is outside the canvas, negative is within the canvas"), false); -/* - _scroll_space.init ( _("Left mouse button pans when Space is pressed"), "/options/spacepans/value", false); - _page_scrolling.add_line( false, "", _scroll_space, "", - _("When on, pressing and holding Space and dragging with left mouse button pans canvas (as in Adobe Illustrator); when off, Space temporarily switches to Selector tool (default)")); -*/ + _scroll_space.init ( _("Mouse move pans when Space is pressed"), "/options/spacebarpans/value", true); + _page_scrolling.add_line( true, "", _scroll_space, "", + _("When on, pressing and holding Space and dragging pans canvas")); _wheel_zoom.init ( _("Mouse wheel zooms by default"), "/options/wheelzooms/value", false); _page_scrolling.add_line( false, "", _wheel_zoom, "", _("When on, mouse wheel zooms without Ctrl and scrolls canvas with Ctrl; when off, it zooms with Ctrl and scrolls without Ctrl")); diff --git a/src/ui/tools/tool-base.cpp b/src/ui/tools/tool-base.cpp index 0f9b3ee7a..b5ffb9e7a 100644 --- a/src/ui/tools/tool-base.cpp +++ b/src/ui/tools/tool-base.cpp @@ -358,7 +358,7 @@ bool ToolBase::root_handler(GdkEvent* event) { /// @todo REmove redundant /value in preference keys tolerance = prefs->getIntLimited("/options/dragtolerance/value", 0, 0, 100); - + bool allow_panning = prefs->getBool("/options/spacebarpans/value"); gint ret = FALSE; switch (event->type) { @@ -582,7 +582,6 @@ bool ToolBase::root_handler(GdkEvent* event) { case GDK_KEY_PRESS: { double const acceleration = prefs->getDoubleLimited( "/options/scrollingacceleration/value", 0, 0, 6); - int const key_scroll = prefs->getIntLimited("/options/keyscroll/value", 10, 0, 1000); @@ -692,10 +691,10 @@ bool ToolBase::root_handler(GdkEvent* event) { break; case GDK_KEY_space: - xp = yp = 0; within_tolerance = true; + xp = yp = 0; + if (!allow_panning) break; panning = 4; - this->space_panning = true; this->message_context->set(Inkscape::INFORMATION_MESSAGE, _("<b>Space+mouse move</b> to pan canvas")); @@ -742,7 +741,7 @@ bool ToolBase::root_handler(GdkEvent* event) { switch (get_group0_keyval(&event->key)) { case GDK_KEY_space: - if (within_tolerance == true) { + if (within_tolerance || !allow_panning) { // Space was pressed, but not panned sp_toggle_selector(desktop); |
