From 522cc95fa0ffa9483134df80e4b85e9c273c967e Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Wed, 25 Sep 2013 02:14:24 +0200 Subject: First attemp for (bzr r12588.1.1) --- src/widgets/pencil-toolbar.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/widgets/pencil-toolbar.cpp') diff --git a/src/widgets/pencil-toolbar.cpp b/src/widgets/pencil-toolbar.cpp index f112a35fa..b16d55680 100644 --- a/src/widgets/pencil-toolbar.cpp +++ b/src/widgets/pencil-toolbar.cpp @@ -186,6 +186,8 @@ static GList * freehand_shape_dropdown_items_list() { glist = g_list_append (glist, _("Triangle out")); glist = g_list_append (glist, _("Ellipse")); glist = g_list_append (glist, _("From clipboard")); + glist = g_list_append (glist, _("Skeletal Stroke from clipboard")); + glist = g_list_append (glist, _("Last applied")); return glist; } -- cgit v1.2.3 From b59da03d20018c9e5aad70b6a356db3e6015cfae Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Wed, 25 Sep 2013 03:20:01 +0200 Subject: Some Fix (bzr r12588.1.4) --- src/widgets/pencil-toolbar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/widgets/pencil-toolbar.cpp') diff --git a/src/widgets/pencil-toolbar.cpp b/src/widgets/pencil-toolbar.cpp index b16d55680..783d8dd4d 100644 --- a/src/widgets/pencil-toolbar.cpp +++ b/src/widgets/pencil-toolbar.cpp @@ -186,7 +186,7 @@ static GList * freehand_shape_dropdown_items_list() { glist = g_list_append (glist, _("Triangle out")); glist = g_list_append (glist, _("Ellipse")); glist = g_list_append (glist, _("From clipboard")); - glist = g_list_append (glist, _("Skeletal Stroke from clipboard")); + glist = g_list_append (glist, _("Bend from clipboard")); glist = g_list_append (glist, _("Last applied")); return glist; -- cgit v1.2.3 From 2a0d24e61c826a9bf33cad4c8f6769d52d433b43 Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Sun, 8 Mar 2015 00:13:15 +0100 Subject: add interactive smooth to pen tool (bzr r13973.1.1) --- src/widgets/pencil-toolbar.cpp | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) (limited to 'src/widgets/pencil-toolbar.cpp') diff --git a/src/widgets/pencil-toolbar.cpp b/src/widgets/pencil-toolbar.cpp index 1214a378a..43d73dbc6 100644 --- a/src/widgets/pencil-toolbar.cpp +++ b/src/widgets/pencil-toolbar.cpp @@ -28,6 +28,7 @@ # include "config.h" #endif +#include #include #include "pencil-toolbar.h" @@ -43,6 +44,11 @@ #include "ui/tools/pen-tool.h" #include "ui/uxmanager.h" #include "widgets/spinbutton-events.h" +#include +#include "live_effects/lpe-simplify.h" +#include "live_effects/effect-enum.h" +#include "live_effects/lpeobject.h" +#include "sp-lpe-item.h" using Inkscape::UI::UXManager; using Inkscape::DocumentUndo; @@ -151,6 +157,12 @@ static void freehand_change_shape(EgeSelectOneAction* act, GObject *dataKludge) prefs->setInt(freehand_tool_name(dataKludge) + "/shape", shape); } +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); +} + /** * Generate the list of freehand advanced shape option entries. */ @@ -232,6 +244,24 @@ static void sp_pencil_tb_tolerance_value_changed(GtkAdjustment *adj, GObject *tb prefs->setDouble("/tools/freehand/pencil/tolerance", gtk_adjustment_get_value(adj)); g_object_set_data( tbl, "freeze", GINT_TO_POINTER(FALSE) ); + SPDesktop *desktop = static_cast(g_object_get_data(tbl, "desktop")); + SPItem * item = desktop->getSelection()->singleItem(); + if(item){ + SPLPEItem* lpeitem = dynamic_cast(item); + if (lpeitem && lpeitem->hasPathEffect()){ + Inkscape::LivePathEffect::Effect* thisEffect = lpeitem->getPathEffectOfType(Inkscape::LivePathEffect::SIMPLIFY); + if(thisEffect){ + Inkscape::LivePathEffect::LPESimplify *lpe = dynamic_cast(thisEffect->getLPEObj()->get_lpe()); + if (lpe) { + double tol = prefs->getDoubleLimited("/tools/freehand/pencil/tolerance", 10.0, 1.0, 100.0); + tol = tol/(100.0*(101.0-tol)); + std::ostringstream ss; + ss << tol; + lpe->getRepr()->setAttribute("threshold", ss.str()); + } + } + } + } } /* @@ -303,6 +333,18 @@ void sp_pencil_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GOb g_signal_connect_after( G_OBJECT(inky), "activate", G_CALLBACK(sp_pencil_tb_defaults), holder ); gtk_action_group_add_action( mainActions, GTK_ACTION(inky) ); } + /* 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"), + Inkscape::ICON_SIZE_DECORATION ); + gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(itact), prefs->getInt("/tools/freehand/pencil/simplify", 0) ); + g_signal_connect_after( G_OBJECT(itact), "toggled", G_CALLBACK(freehand_simplify_lpe), holder) ; + gtk_action_group_add_action( mainActions, GTK_ACTION(itact) ); + } g_signal_connect( holder, "destroy", G_CALLBACK(purge_repr_listener), holder ); -- cgit v1.2.3 From c4383f04d9a3cbe231a31662cb0b5358d512e2f1 Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Sun, 8 Mar 2015 16:36:57 +0100 Subject: allow use multiple lines, added new icon (bzr r13973.1.3) --- src/widgets/pencil-toolbar.cpp | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) (limited to 'src/widgets/pencil-toolbar.cpp') diff --git a/src/widgets/pencil-toolbar.cpp b/src/widgets/pencil-toolbar.cpp index 43d73dbc6..a06d76d01 100644 --- a/src/widgets/pencil-toolbar.cpp +++ b/src/widgets/pencil-toolbar.cpp @@ -49,6 +49,7 @@ #include "live_effects/effect-enum.h" #include "live_effects/lpeobject.h" #include "sp-lpe-item.h" +#include "util/glib-list-iterators.h" using Inkscape::UI::UXManager; using Inkscape::DocumentUndo; @@ -245,19 +246,22 @@ static void sp_pencil_tb_tolerance_value_changed(GtkAdjustment *adj, GObject *tb gtk_adjustment_get_value(adj)); g_object_set_data( tbl, "freeze", GINT_TO_POINTER(FALSE) ); SPDesktop *desktop = static_cast(g_object_get_data(tbl, "desktop")); - SPItem * item = desktop->getSelection()->singleItem(); - if(item){ - SPLPEItem* lpeitem = dynamic_cast(item); - if (lpeitem && lpeitem->hasPathEffect()){ - Inkscape::LivePathEffect::Effect* thisEffect = lpeitem->getPathEffectOfType(Inkscape::LivePathEffect::SIMPLIFY); - if(thisEffect){ - Inkscape::LivePathEffect::LPESimplify *lpe = dynamic_cast(thisEffect->getLPEObj()->get_lpe()); - if (lpe) { - double tol = prefs->getDoubleLimited("/tools/freehand/pencil/tolerance", 10.0, 1.0, 100.0); - tol = tol/(100.0*(101.0-tol)); - std::ostringstream ss; - ss << tol; - lpe->getRepr()->setAttribute("threshold", ss.str()); + std::list selected; + selected.insert >(selected.end(), desktop->getSelection()->itemList(), NULL); + if(!selected.empty()){ + for (std::list::iterator it(selected.begin()); it != selected.end(); ++it){ + SPLPEItem* lpeitem = dynamic_cast(*it); + if (lpeitem && lpeitem->hasPathEffect()){ + Inkscape::LivePathEffect::Effect* thisEffect = lpeitem->getPathEffectOfType(Inkscape::LivePathEffect::SIMPLIFY); + if(thisEffect){ + Inkscape::LivePathEffect::LPESimplify *lpe = dynamic_cast(thisEffect->getLPEObj()->get_lpe()); + if (lpe) { + double tol = prefs->getDoubleLimited("/tools/freehand/pencil/tolerance", 10.0, 1.0, 100.0); + tol = tol/(100.0*(101.0-tol)); + std::ostringstream ss; + ss << tol; + lpe->getRepr()->setAttribute("threshold", ss.str()); + } } } } @@ -340,7 +344,7 @@ void sp_pencil_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GOb _("LPE based interactive simplify"), _("LPE based interactive simplify"), INKSCAPE_ICON("interactive_simplify"), - Inkscape::ICON_SIZE_DECORATION ); + Inkscape::ICON_SIZE_SMALL_TOOLBAR ); gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(itact), prefs->getInt("/tools/freehand/pencil/simplify", 0) ); g_signal_connect_after( G_OBJECT(itact), "toggled", G_CALLBACK(freehand_simplify_lpe), holder) ; gtk_action_group_add_action( mainActions, GTK_ACTION(itact) ); -- cgit v1.2.3 From 6a65a35182b059890732c0ddc9be9d0a3a37b941 Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Sat, 25 Jul 2015 01:18:08 +0200 Subject: change from list to vector (bzr r13973.1.16) --- src/widgets/pencil-toolbar.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/widgets/pencil-toolbar.cpp') diff --git a/src/widgets/pencil-toolbar.cpp b/src/widgets/pencil-toolbar.cpp index a06d76d01..f2214bf49 100644 --- a/src/widgets/pencil-toolbar.cpp +++ b/src/widgets/pencil-toolbar.cpp @@ -246,10 +246,9 @@ static void sp_pencil_tb_tolerance_value_changed(GtkAdjustment *adj, GObject *tb gtk_adjustment_get_value(adj)); g_object_set_data( tbl, "freeze", GINT_TO_POINTER(FALSE) ); SPDesktop *desktop = static_cast(g_object_get_data(tbl, "desktop")); - std::list selected; - selected.insert >(selected.end(), desktop->getSelection()->itemList(), NULL); + std::vector selected = desktop->getSelection()->itemList(); if(!selected.empty()){ - for (std::list::iterator it(selected.begin()); it != selected.end(); ++it){ + for (std::vector::iterator it(selected.begin()); it != selected.end(); ++it){ SPLPEItem* lpeitem = dynamic_cast(*it); if (lpeitem && lpeitem->hasPathEffect()){ Inkscape::LivePathEffect::Effect* thisEffect = lpeitem->getPathEffectOfType(Inkscape::LivePathEffect::SIMPLIFY); -- cgit v1.2.3 From 2416766e3b71f22adb6943495458697b1b958a08 Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Sat, 25 Jul 2015 21:12:04 +0200 Subject: Removes extra unnecesary code pointed by Nathan Hurst (bzr r13973.1.19) --- src/widgets/pencil-toolbar.cpp | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) (limited to 'src/widgets/pencil-toolbar.cpp') diff --git a/src/widgets/pencil-toolbar.cpp b/src/widgets/pencil-toolbar.cpp index f2214bf49..4b177d3ad 100644 --- a/src/widgets/pencil-toolbar.cpp +++ b/src/widgets/pencil-toolbar.cpp @@ -247,20 +247,18 @@ static void sp_pencil_tb_tolerance_value_changed(GtkAdjustment *adj, GObject *tb g_object_set_data( tbl, "freeze", GINT_TO_POINTER(FALSE) ); SPDesktop *desktop = static_cast(g_object_get_data(tbl, "desktop")); std::vector selected = desktop->getSelection()->itemList(); - if(!selected.empty()){ - for (std::vector::iterator it(selected.begin()); it != selected.end(); ++it){ - SPLPEItem* lpeitem = dynamic_cast(*it); - if (lpeitem && lpeitem->hasPathEffect()){ - Inkscape::LivePathEffect::Effect* thisEffect = lpeitem->getPathEffectOfType(Inkscape::LivePathEffect::SIMPLIFY); - if(thisEffect){ - Inkscape::LivePathEffect::LPESimplify *lpe = dynamic_cast(thisEffect->getLPEObj()->get_lpe()); - if (lpe) { - double tol = prefs->getDoubleLimited("/tools/freehand/pencil/tolerance", 10.0, 1.0, 100.0); - tol = tol/(100.0*(101.0-tol)); - std::ostringstream ss; - ss << tol; - lpe->getRepr()->setAttribute("threshold", ss.str()); - } + for (std::vector::iterator it(selected.begin()); it != selected.end(); ++it){ + SPLPEItem* lpeitem = dynamic_cast(*it); + if (lpeitem && lpeitem->hasPathEffect()){ + Inkscape::LivePathEffect::Effect* thisEffect = lpeitem->getPathEffectOfType(Inkscape::LivePathEffect::SIMPLIFY); + if(thisEffect){ + Inkscape::LivePathEffect::LPESimplify *lpe = dynamic_cast(thisEffect->getLPEObj()->get_lpe()); + if (lpe) { + double tol = prefs->getDoubleLimited("/tools/freehand/pencil/tolerance", 10.0, 1.0, 100.0); + tol = tol/(100.0*(101.0-tol)); + std::ostringstream ss; + ss << tol; + lpe->getRepr()->setAttribute("threshold", ss.str()); } } } -- cgit v1.2.3 From 6fd1a081d166d88200a22a89928bdca9192b1491 Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Mon, 27 Jul 2015 02:04:29 +0200 Subject: add flattern button to interactive simplify (bzr r14261) --- src/widgets/pencil-toolbar.cpp | 50 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 49 insertions(+), 1 deletion(-) (limited to 'src/widgets/pencil-toolbar.cpp') diff --git a/src/widgets/pencil-toolbar.cpp b/src/widgets/pencil-toolbar.cpp index 4b177d3ad..c889436b9 100644 --- a/src/widgets/pencil-toolbar.cpp +++ b/src/widgets/pencil-toolbar.cpp @@ -30,6 +30,7 @@ #include #include +#include #include "pencil-toolbar.h" #include "desktop.h" @@ -45,9 +46,11 @@ #include "ui/uxmanager.h" #include "widgets/spinbutton-events.h" #include +#include "live_effects/effect.h" #include "live_effects/lpe-simplify.h" #include "live_effects/effect-enum.h" #include "live_effects/lpeobject.h" +#include "live_effects/lpeobject-reference.h" #include "sp-lpe-item.h" #include "util/glib-list-iterators.h" @@ -233,6 +236,41 @@ static void sp_pencil_tb_defaults(GtkWidget * /*widget*/, GObject *obj) spinbutton_defocus(tbl); } +static void sp_simplify_flatten(GtkWidget * /*widget*/, GObject *obj) +{ + SPDesktop *desktop = static_cast(g_object_get_data(obj, "desktop")); + std::vector selected = desktop->getSelection()->itemList(); + for (std::vector::iterator it(selected.begin()); it != selected.end(); ++it){ + SPLPEItem* lpeitem = dynamic_cast(*it); + if (lpeitem && lpeitem->hasPathEffect()){ + PathEffectList lpelist = lpeitem->getEffectList(); + std::list::iterator i; + for (i = lpelist.begin(); i != lpelist.end(); ++i) { + LivePathEffectObject *lpeobj = (*i)->lpeobject; + if (lpeobj) { + Inkscape::LivePathEffect::Effect *lpe = lpeobj->get_lpe(); + if (dynamic_cast(lpe)) { + SPShape * shape = dynamic_cast(lpeitem); + if(shape){ + SPCurve * c = shape->getCurveBeforeLPE(); + lpe->doEffect(c); + lpeitem->setCurrentPathEffect(*i); + if (lpelist.size() > 1){ + lpeitem->removeCurrentPathEffect(true); + shape->setCurveBeforeLPE(c); + } else { + lpeitem->removeCurrentPathEffect(false); + shape->setCurve(c,0); + } + break; + } + } + } + } + } + } +} + static void sp_pencil_tb_tolerance_value_changed(GtkAdjustment *adj, GObject *tbl) { // quit if run by the attr_changed listener @@ -255,7 +293,7 @@ static void sp_pencil_tb_tolerance_value_changed(GtkAdjustment *adj, GObject *tb Inkscape::LivePathEffect::LPESimplify *lpe = dynamic_cast(thisEffect->getLPEObj()->get_lpe()); if (lpe) { double tol = prefs->getDoubleLimited("/tools/freehand/pencil/tolerance", 10.0, 1.0, 100.0); - tol = tol/(100.0*(101.0-tol)); + tol = tol/(100.0*(102.0-tol)); std::ostringstream ss; ss << tol; lpe->getRepr()->setAttribute("threshold", ss.str()); @@ -346,6 +384,16 @@ void sp_pencil_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GOb g_signal_connect_after( G_OBJECT(itact), "toggled", G_CALLBACK(freehand_simplify_lpe), holder) ; gtk_action_group_add_action( mainActions, GTK_ACTION(itact) ); } + /* LPE simplify flatten */ + { + InkAction* inky = ink_action_new( "PencilLpeSimplifyFlatten", + _("LPE simplify flatten"), + _("LPE simplify flatten"), + INKSCAPE_ICON("flatten_simplify"), + 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_signal_connect( holder, "destroy", G_CALLBACK(purge_repr_listener), holder ); -- cgit v1.2.3 From aeedb1dda68d5529363a144c13d26f8804da4c64 Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Sat, 1 Aug 2015 16:27:30 +0200 Subject: Update simplify interactive to handle trinagle out powerstrokes, also fix it for Spiro paths. Updated toolbar slider to also update powerstroke points (bzr r14271) --- src/widgets/pencil-toolbar.cpp | 39 ++++++++++++++++++++++++++++++++++----- 1 file changed, 34 insertions(+), 5 deletions(-) (limited to 'src/widgets/pencil-toolbar.cpp') diff --git a/src/widgets/pencil-toolbar.cpp b/src/widgets/pencil-toolbar.cpp index aef9b4560..17c1d341d 100644 --- a/src/widgets/pencil-toolbar.cpp +++ b/src/widgets/pencil-toolbar.cpp @@ -46,8 +46,10 @@ #include "ui/uxmanager.h" #include "widgets/spinbutton-events.h" #include +#include "display/curve.h" #include "live_effects/effect.h" #include "live_effects/lpe-simplify.h" +#include "live_effects/lpe-powerstroke.h" #include "live_effects/effect-enum.h" #include "live_effects/lpeobject.h" #include "live_effects/lpeobject-reference.h" @@ -289,15 +291,42 @@ static void sp_pencil_tb_tolerance_value_changed(GtkAdjustment *adj, GObject *tb for (std::vector::iterator it(selected.begin()); it != selected.end(); ++it){ SPLPEItem* lpeitem = dynamic_cast(*it); if (lpeitem && lpeitem->hasPathEffect()){ - Inkscape::LivePathEffect::Effect* thisEffect = lpeitem->getPathEffectOfType(Inkscape::LivePathEffect::SIMPLIFY); - if(thisEffect){ - Inkscape::LivePathEffect::LPESimplify *lpe = dynamic_cast(thisEffect->getLPEObj()->get_lpe()); - if (lpe) { + Inkscape::LivePathEffect::Effect* simplify = lpeitem->getPathEffectOfType(Inkscape::LivePathEffect::SIMPLIFY); + if(simplify){ + Inkscape::LivePathEffect::LPESimplify *lpe_simplify = dynamic_cast(simplify->getLPEObj()->get_lpe()); + if (lpe_simplify) { double tol = prefs->getDoubleLimited("/tools/freehand/pencil/tolerance", 10.0, 1.0, 100.0); tol = tol/(100.0*(102.0-tol)); std::ostringstream ss; ss << tol; - lpe->getRepr()->setAttribute("threshold", ss.str()); + Inkscape::LivePathEffect::Effect* powerstroke = lpeitem->getPathEffectOfType(Inkscape::LivePathEffect::POWERSTROKE); + bool simplified = false; + if(powerstroke){ + Inkscape::LivePathEffect::LPEPowerStroke *lpe_powerstroke = dynamic_cast(powerstroke->getLPEObj()->get_lpe()); + if(lpe_powerstroke){ + lpe_powerstroke->getRepr()->setAttribute("is_visible", "false"); + sp_lpe_item_update_patheffect(lpeitem, false, false); + SPShape *sp_shape = dynamic_cast(lpeitem); + if (sp_shape) { + guint previous_curve_length = sp_shape->getCurve()->get_segment_count(); + lpe_simplify->getRepr()->setAttribute("threshold", ss.str()); + sp_lpe_item_update_patheffect(lpeitem, false, false); + simplified = true; + guint curve_length = sp_shape->getCurve()->get_segment_count(); + std::vector ts = lpe_powerstroke->offset_points.data(); + double factor = (double)curve_length/ (double)previous_curve_length; + for (size_t i = 0; i < ts.size(); i++) { + ts[i][Geom::X] = ts[i][Geom::X] * factor; + } + lpe_powerstroke->offset_points.param_setValue(ts); + } + lpe_powerstroke->getRepr()->setAttribute("is_visible", "true"); + sp_lpe_item_update_patheffect(lpeitem, false, false); + } + } + if(!simplified){ + lpe_simplify->getRepr()->setAttribute("threshold", ss.str()); + } } } } -- cgit v1.2.3 From a04c4d8187fcae59a6d3fe4bd215304dcfa15619 Mon Sep 17 00:00:00 2001 From: Tavmjong Bah Date: Wed, 25 Nov 2015 11:16:15 +0100 Subject: Remove unused headers. (bzr r14490) --- src/widgets/pencil-toolbar.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/widgets/pencil-toolbar.cpp') diff --git a/src/widgets/pencil-toolbar.cpp b/src/widgets/pencil-toolbar.cpp index 17c1d341d..aed80a66f 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" @@ -57,7 +56,6 @@ #include "util/glib-list-iterators.h" using Inkscape::UI::UXManager; -using Inkscape::DocumentUndo; using Inkscape::UI::ToolboxFactory; using Inkscape::UI::PrefPusher; -- cgit v1.2.3 From 97324d275423a8367fdd671cbdda8097f26b0b10 Mon Sep 17 00:00:00 2001 From: Tavmjong Bah Date: Wed, 9 Dec 2015 21:01:20 +0100 Subject: Remove unused header file. (bzr r14522) --- src/widgets/pencil-toolbar.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'src/widgets/pencil-toolbar.cpp') diff --git a/src/widgets/pencil-toolbar.cpp b/src/widgets/pencil-toolbar.cpp index aed80a66f..94875ecc1 100644 --- a/src/widgets/pencil-toolbar.cpp +++ b/src/widgets/pencil-toolbar.cpp @@ -53,7 +53,6 @@ #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::UI::ToolboxFactory; -- cgit v1.2.3 From 2aa15e993a5babe61f7af4358ddae43afc3dc6b6 Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Mon, 1 Feb 2016 19:04:28 +0100 Subject: Dinamic toolbar enlacements, now in clone mode on spray tool and in pencil toolbar (bzr r14628) --- src/widgets/pencil-toolbar.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/widgets/pencil-toolbar.cpp') diff --git a/src/widgets/pencil-toolbar.cpp b/src/widgets/pencil-toolbar.cpp index 94875ecc1..55127206c 100644 --- a/src/widgets/pencil-toolbar.cpp +++ b/src/widgets/pencil-toolbar.cpp @@ -164,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 ); } /** @@ -363,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 */ @@ -420,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 ); -- cgit v1.2.3