diff options
Diffstat (limited to 'src/widgets/pencil-toolbar.cpp')
| -rw-r--r-- | src/widgets/pencil-toolbar.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/widgets/pencil-toolbar.cpp b/src/widgets/pencil-toolbar.cpp index 17c1d341d..55127206c 100644 --- a/src/widgets/pencil-toolbar.cpp +++ b/src/widgets/pencil-toolbar.cpp @@ -34,7 +34,6 @@ #include "pencil-toolbar.h" #include "desktop.h" -#include "document-undo.h" #include "widgets/ege-adjustment-action.h" #include "widgets/ege-select-one-action.h" #include "widgets/ink-action.h" @@ -54,10 +53,8 @@ #include "live_effects/lpeobject.h" #include "live_effects/lpeobject-reference.h" #include "sp-lpe-item.h" -#include "util/glib-list-iterators.h" using Inkscape::UI::UXManager; -using Inkscape::DocumentUndo; using Inkscape::UI::ToolboxFactory; using Inkscape::UI::PrefPusher; @@ -167,6 +164,7 @@ static void freehand_simplify_lpe(InkToggleAction* itact, GObject *dataKludge) { gint simplify = gtk_toggle_action_get_active( GTK_TOGGLE_ACTION(itact) ); Inkscape::Preferences *prefs = Inkscape::Preferences::get(); prefs->setInt(freehand_tool_name(dataKludge) + "/simplify", simplify); + gtk_action_set_visible( GTK_ACTION( g_object_get_data(dataKludge, "flatten_simplify") ), simplify ); } /** @@ -366,7 +364,7 @@ private: void sp_pencil_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GObject* holder) { sp_add_freehand_mode_toggle(mainActions, holder, true); - + Inkscape::Preferences *prefs = Inkscape::Preferences::get(); EgeAdjustmentAction* eact = 0; /* Tolerance */ @@ -423,6 +421,10 @@ void sp_pencil_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GOb Inkscape::ICON_SIZE_SMALL_TOOLBAR ); 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)) { + gtk_action_set_visible( GTK_ACTION( g_object_get_data(holder, "flatten_simplify") ), false ); + } } g_signal_connect( holder, "destroy", G_CALLBACK(purge_repr_listener), holder ); |
