diff options
| author | Maximilian Albert <maximilian.albert@gmail.com> | 2008-07-31 12:43:10 +0000 |
|---|---|---|
| committer | cilix42 <cilix42@users.sourceforge.net> | 2008-07-31 12:43:10 +0000 |
| commit | 26288df8eb283c526aa8459e6779d780d8813a2e (patch) | |
| tree | 84cdbbd51732f88f506cf7492450cb0e63b1ae1a /src/widgets/toolbox.cpp | |
| parent | Fix wrong toggle activation in pen/pencil toolbar after startup (diff) | |
| download | inkscape-26288df8eb283c526aa8459e6779d780d8813a2e.tar.gz inkscape-26288df8eb283c526aa8459e6779d780d8813a2e.zip | |
New 'zigzag' (polylines) mode in pen tool
(bzr r6485)
Diffstat (limited to 'src/widgets/toolbox.cpp')
| -rw-r--r-- | src/widgets/toolbox.cpp | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/src/widgets/toolbox.cpp b/src/widgets/toolbox.cpp index b62ecb0b2..9dfb0c249 100644 --- a/src/widgets/toolbox.cpp +++ b/src/widgets/toolbox.cpp @@ -66,7 +66,7 @@ #include "connector-context.h" #include "node-context.h" -#include "draw-context.h" +#include "pen-context.h" #include "shape-editor.h" #include "tweak-context.h" #include "sp-rect.h" @@ -3279,7 +3279,15 @@ freehand_tool_name(GObject *dataKludge) static void sp_pc_freehand_mode_changed(EgeSelectOneAction* act, GObject* tbl) { - prefs_set_int_attribute(freehand_tool_name(tbl), "freehand-mode", ege_select_one_action_get_active(act)); + gint mode = ege_select_one_action_get_active(act); + + prefs_set_int_attribute(freehand_tool_name(tbl), "freehand-mode", mode); + + SPDesktop *desktop = (SPDesktop *) g_object_get_data(tbl, "desktop"); + if (SP_IS_PEN_CONTEXT(desktop->event_context)) { + SPPenContext *pc = SP_PEN_CONTEXT(desktop->event_context); + pc->polylines_only = (mode == 2); + } } static void sp_add_freehand_mode_toggle(GtkActionGroup* mainActions, GObject* holder, bool tool_is_pencil) @@ -3307,6 +3315,15 @@ static void sp_add_freehand_mode_toggle(GtkActionGroup* mainActions, GObject* ho 2, "spiro_splines_mode", -1 ); + if (!tool_is_pencil) { + gtk_list_store_append( model, &iter ); + gtk_list_store_set( model, &iter, + 0, _("Zigzag"), + 1, _("Create a sequence of straight line segments"), + 2, "polylines_mode", + -1 ); + } + EgeSelectOneAction* act = ege_select_one_action_new(tool_is_pencil ? "FreehandModeActionPencil" : "FreehandModeActionPen", |
