From: dvlierop2 Date: Thu, 20 Dec 2007 19:47:40 +0000 (+0000) Subject: Use "%"-key for toggling the snapper, and modify the related sp-desktop code X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=2bb70aaa8103b173defd3968d926a95e6155db0a;p=inkscape.git Use "%"-key for toggling the snapper, and modify the related sp-desktop code --- diff --git a/share/keys/default.xml b/share/keys/default.xml index 74f7682ed..a519be542 100644 --- a/share/keys/default.xml +++ b/share/keys/default.xml @@ -121,7 +121,10 @@ override) the bindings in the main default.xml. - + + + + @@ -230,9 +233,8 @@ override) the bindings in the main default.xml. - - - + + diff --git a/share/keys/inkscape.xml b/share/keys/inkscape.xml index b39b02e9f..437cb7d7a 100644 --- a/share/keys/inkscape.xml +++ b/share/keys/inkscape.xml @@ -121,7 +121,10 @@ override) the bindings in the main default.xml. - + + + + @@ -230,9 +233,8 @@ override) the bindings in the main default.xml. - - - + + diff --git a/src/desktop.cpp b/src/desktop.cpp index d31babf87..feb3f5cb0 100644 --- a/src/desktop.cpp +++ b/src/desktop.cpp @@ -1212,6 +1212,12 @@ void SPDesktop::showGrids(bool show, bool dirty_document) } } +void SPDesktop::toggleSnapping() +{ + bool v = namedview->snap_manager.getSnapEnabledGlobally(); + Inkscape::XML::Node *repr = SP_OBJECT_REPR(namedview); + sp_repr_set_boolean(repr, "inkscape:snap-global", !v); +} //---------------------------------------------------------------------- // Callback implementations. The virtual ones are connected by the view. diff --git a/src/desktop.h b/src/desktop.h index 4c9d1ece8..0a3732d56 100644 --- a/src/desktop.h +++ b/src/desktop.h @@ -263,6 +263,7 @@ struct SPDesktop : public Inkscape::UI::View::View void toggleColorProfAdjust(); void toggleGrids(); + void toggleSnapping(); bool gridsEnabled() { return grids_visible; } void showGrids(bool show, bool dirty_document = true); diff --git a/src/interface.cpp b/src/interface.cpp index 114f9b34a..f7a2bc47f 100644 --- a/src/interface.cpp +++ b/src/interface.cpp @@ -467,9 +467,10 @@ sp_key_name(guint keyval) else if (!strcmp(n, "Page_Down" )) return "PgDn"; else if (!strcmp(n, "grave" )) return "`"; else if (!strcmp(n, "numbersign" )) return "#"; - else if (!strcmp(n, "bar" )) return "|"; - else if (!strcmp(n, "slash" )) return "/"; - else if (!strcmp(n, "exclam" )) return "!"; + else if (!strcmp(n, "bar" )) return "|"; + else if (!strcmp(n, "slash" )) return "/"; + else if (!strcmp(n, "exclam" )) return "!"; + else if (!strcmp(n, "percent" )) return "%"; else return n; } diff --git a/src/verbs.cpp b/src/verbs.cpp index 2c2da7093..78dd8bee8 100644 --- a/src/verbs.cpp +++ b/src/verbs.cpp @@ -1612,7 +1612,7 @@ ZoomVerb::perform(SPAction *action, void *data, void */*pdata*/) sp_namedview_toggle_guides(doc, repr); break; case SP_VERB_TOGGLE_SNAPPING: - dt->namedview->snap_manager.toggleSnapEnabledGlobally(); + dt->toggleSnapping(); break; case SP_VERB_TOGGLE_GRID: dt->toggleGrids();