diff options
| author | Jabiertxo Arraiza Cenoz <jtx@jtx-desktop.markerlab.es> | 2017-08-29 08:16:30 +0000 |
|---|---|---|
| committer | Jabiertxo Arraiza Cenoz <jtx@jtx-desktop.markerlab.es> | 2017-08-29 08:16:30 +0000 |
| commit | ab42a100bc099fff74e8b25f9b04c21594c6f119 (patch) | |
| tree | d5fde20d471766773993f24b1df5b21de9cc5f0a /src/widgets | |
| parent | Parametrice into preferences magic numbers and other staff (diff) | |
| parent | Remove LPE Simplify from spiro and BSpline mode because made uncontrolable pa... (diff) | |
| download | inkscape-ab42a100bc099fff74e8b25f9b04c21594c6f119.tar.gz inkscape-ab42a100bc099fff74e8b25f9b04c21594c6f119.zip | |
Merge from master
Diffstat (limited to 'src/widgets')
| -rw-r--r-- | src/widgets/pencil-toolbar.cpp | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/widgets/pencil-toolbar.cpp b/src/widgets/pencil-toolbar.cpp index 936b75d75..dca0fcf01 100644 --- a/src/widgets/pencil-toolbar.cpp +++ b/src/widgets/pencil-toolbar.cpp @@ -80,8 +80,12 @@ static void freehand_mode_changed(EgeSelectOneAction* act, GObject* tbl) if (mode == 1 || mode == 2) { gtk_action_set_visible( GTK_ACTION( g_object_get_data(tbl, "flatten_spiro_bspline") ), true ); + gtk_action_set_visible( GTK_ACTION( g_object_get_data(tbl, "flatten_simplify") ), false ); + gtk_action_set_visible( GTK_ACTION( g_object_get_data(tbl, "simplify") ), false ); } else { gtk_action_set_visible( GTK_ACTION( g_object_get_data(tbl, "flatten_spiro_bspline") ), false ); + gtk_action_set_visible( GTK_ACTION( g_object_get_data(tbl, "flatten_simplify") ), true ); + gtk_action_set_visible( GTK_ACTION( g_object_get_data(tbl, "simplify") ), true ); } } @@ -562,15 +566,21 @@ void sp_pencil_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GOb } /* LPE simplify based tolerance */ { - Inkscape::Preferences *prefs = Inkscape::Preferences::get(); InkToggleAction* itact = ink_toggle_action_new( "PencilLpeSimplify", _("LPE based interactive simplify"), _("LPE based interactive simplify"), INKSCAPE_ICON("interactive_simplify"), GTK_ICON_SIZE_SMALL_TOOLBAR ); - gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(itact), prefs->getBool("/tools/freehand/pencil/simplify", false) ); + gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(itact), prefs->getInt("/tools/freehand/pencil/simplify", 0) ); + g_object_set_data( holder, "simplify", itact ); g_signal_connect_after( G_OBJECT(itact), "toggled", G_CALLBACK(freehand_simplify_lpe), holder) ; gtk_action_group_add_action( mainActions, GTK_ACTION(itact) ); + guint freehandMode = prefs->getInt("/tools/freehand/pencil/freehand-mode", 0); + if (freehandMode == 1 || freehandMode == 2) { + gtk_action_set_visible( GTK_ACTION( g_object_get_data(holder, "simplify") ), false ); + } else { + gtk_action_set_visible( GTK_ACTION( g_object_get_data(holder, "simplify") ), true ); + } } /* LPE simplify flatten */ { @@ -582,7 +592,10 @@ void sp_pencil_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GOb g_signal_connect_after( G_OBJECT(inky), "activate", G_CALLBACK(sp_simplify_flatten), holder ); gtk_action_group_add_action( mainActions, GTK_ACTION(inky) ); g_object_set_data( holder, "flatten_simplify", inky ); - if (!prefs->getInt("/tools/freehand/pencil/simplify", 0)) { + guint freehandMode = prefs->getInt("/tools/freehand/pencil/freehand-mode", 0); + if (freehandMode == 1 || freehandMode == 2 || !prefs->getInt("/tools/freehand/pencil/simplify", 0)) { + gtk_action_set_visible( GTK_ACTION( g_object_get_data(holder, "flatten_simplify") ), false ); + } else { gtk_action_set_visible( GTK_ACTION( g_object_get_data(holder, "flatten_simplify") ), true ); } } |
