From da9cf410675cdc6d534eee54c9aef472e50f81d4 Mon Sep 17 00:00:00 2001 From: Tavmjong Bah Date: Thu, 8 Oct 2015 10:47:24 +0200 Subject: Add 'mesh' and 'hatch' related attributes. (bzr r14399) --- share/attributes/genMapDataSVG.pl | 19 +++++++++++++++++++ share/attributes/svgprops | 38 +++++++++++++++++++++++++++++--------- 2 files changed, 48 insertions(+), 9 deletions(-) diff --git a/share/attributes/genMapDataSVG.pl b/share/attributes/genMapDataSVG.pl index f3d84d2c5..beb06dc04 100755 --- a/share/attributes/genMapDataSVG.pl +++ b/share/attributes/genMapDataSVG.pl @@ -84,6 +84,25 @@ push @{$attributes{ "style" }->{elements}}, "flowRoot","flowPara","flowSpan","fl push @{$attributes{ "xml:space" }->{elements}}, "flowRoot","flowPara","flowSpan"; push @{$attributes{ "transform" }->{elements}}, "flowRoot","flowPara","flowSpan"; +# Mesh gradients +push @{$attributes{ "id" }->{elements}}, "mesh","meshrow","meshpatch"; +push @{$attributes{ "path" }->{elements}}, "stop"; +push @{$attributes{ "gradientUnits" }->{elements}}, "mesh"; +push @{$attributes{ "transform" }->{elements}}, "mesh"; +push @{$attributes{ "href" }->{elements}}, "mesh"; +push @{$attributes{ "type" }->{elements}}, "mesh"; + +# Hatches +push @{$attributes{ "id" }->{elements}}, "hatch","hatchpath"; +push @{$attributes{ "pitch" }->{elements}}, "hatch"; +push @{$attributes{ "rotate" }->{elements}}, "hatch"; +push @{$attributes{ "hatchUnits" }->{elements}}, "hatch"; +push @{$attributes{ "hatchContentUnits" }->{elements}}, "hatch"; +push @{$attributes{ "transform" }->{elements}}, "hatch"; +push @{$attributes{ "href" }->{elements}}, "hatch"; +push @{$attributes{ "d" }->{elements}}, "hatchpath"; +push @{$attributes{ "offset" }->{elements}}, "hatchpath"; + # Output diff --git a/share/attributes/svgprops b/share/attributes/svgprops index af55671c9..c3948b8da 100644 --- a/share/attributes/svgprops +++ b/share/attributes/svgprops @@ -46,7 +46,7 @@ "cy" - "circle","ellipse","radialGradient" -"d" - "path","glyph","missing-glyph" +"d" - "path","glyph","missing-glyph","hatchpath" "descent" - "font-face" @@ -106,10 +106,14 @@ "gradientTransform" - "linearGradient","radialGradient" -"gradientUnits" - "linearGradient","radialGradient" +"gradientUnits" - "linearGradient","radialGradient","mesh" "hanging" - "font-face" +"hatchContentUnits" - "hatch" + +"hatchUnits" - "hatch" + "height" - "filter","foreignObject","image","pattern","rect","svg","use","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","mask" "horiz-adv-x" - "font","glyph","missing-glyph" @@ -118,7 +122,9 @@ "horiz-origin-y" - "font" -"id" - "a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern","flowRoot","flowPara","flowSpan","flowRect","flowRegion","solidColor" +"href" - "mesh","hatch" + +"id" - "a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern","flowRoot","flowPara","flowSpan","flowRect","flowRegion","solidColor","mesh","meshrow","meshpatch","hatch","hatchpath" "ideographic" - "font-face" @@ -182,7 +188,7 @@ "numOctaves" - "feTurbulence" -"offset" - "stop","feFuncA","feFuncB","feFuncG","feFuncR" +"offset" - "stop","feFuncA","feFuncB","feFuncG","feFuncR","hatchpath" "onabort" - "svg" @@ -238,7 +244,7 @@ "panose-1" - "font-face" -"path" - "animateMotion" +"path" - "animateMotion","stop" "pathLength" - "path" @@ -248,6 +254,8 @@ "patternUnits" - "pattern" +"pitch" - "hatch" + "points" - "polygon","polyline" "pointsAtX" - "feSpotLight" @@ -284,7 +292,7 @@ "result" - "feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence" -"rotate" - "altGlyph","animateMotion","text","tref","tspan" +"rotate" - "altGlyph","animateMotion","text","tref","tspan","hatch" "rx" - "ellipse","rect" @@ -334,15 +342,13 @@ "targetY" - "feConvolveMatrix" -"tensor" - "meshpatch" - "textLength" - "text","textPath","tref","tspan" "title" - "style" "to" - "set","animate","animateColor","animateMotion","animateTransform" -"transform" - "a","circle","clipPath","defs","ellipse","foreignObject","g","image","line","path","polygon","polyline","rect","switch","text","use","flowRoot","flowPara","flowSpan" +"transform" - "a","circle","clipPath","defs","ellipse","foreignObject","g","image","line","path","polygon","polyline","rect","switch","text","use","flowRoot","flowPara","flowSpan","mesh","hatch" "type" - "animateTransform","feColorMatrix","feTurbulence","script","style","feFuncA","feFuncB","feFuncG","feFuncR","mesh" @@ -524,6 +530,10 @@ "shape-rendering" - "path","rect","circle","ellipse","line","polyline","polygon","a","defs","glyph","g","marker","mask","missing-glyph","pattern","svg","switch","symbol","use" +"solid-color" - "a","defs","glyph","g","marker","mask","missing-glyph","pattern","svg","switch","symbol","use","circle","ellipse","image","line","path","polygon","polyline","rect","text","use" + +"solid-opacity" - "a","defs","glyph","g","marker","mask","missing-glyph","pattern","svg","switch","symbol","use","circle","ellipse","image","line","path","polygon","polyline","rect","text","use" + "stop-color" - "stop" "stop-opacity" - "stop" @@ -550,6 +560,16 @@ "text-decoration" - "altGlyph","textPath","text","tref","tspan","flowRoot","flowPara","flowSpan" +"text-decoration-color" - "a","defs","glyph","g","marker","mask","missing-glyph","pattern","svg","switch","symbol","use","altGlyph","textPath","text","tref","tspan","flowRoot","flowPara","flowSpan" + +"text-decoration-fill" - "a","defs","glyph","g","marker","mask","missing-glyph","pattern","svg","switch","symbol","use","altGlyph","textPath","text","tref","tspan","flowRoot","flowPara","flowSpan" + +"text-decoration-line" - "a","defs","glyph","g","marker","mask","missing-glyph","pattern","svg","switch","symbol","use","altGlyph","textPath","text","tref","tspan","flowRoot","flowPara","flowSpan" + +"text-decoration-stroke" - "a","defs","glyph","g","marker","mask","missing-glyph","pattern","svg","switch","symbol","use","altGlyph","textPath","text","tref","tspan","flowRoot","flowPara","flowSpan" + +"text-decoration-style" - "a","defs","glyph","g","marker","mask","missing-glyph","pattern","svg","switch","symbol","use","altGlyph","textPath","text","tref","tspan","flowRoot","flowPara","flowSpan" + "text-rendering" - "text","a","defs","glyph","g","marker","mask","missing-glyph","pattern","svg","switch","symbol","use" "title" - "circle","ellipse","image","line","path","polygon","polyline","rect","text","use","g" -- cgit v1.2.3 From 91a6389c70d24a5d1d58bb946bfa36e05b3f0d57 Mon Sep 17 00:00:00 2001 From: Tavmjong Bah Date: Thu, 8 Oct 2015 11:03:11 +0200 Subject: More additions for 'mesh' attributes. (bzr r14400) --- share/attributes/genMapDataSVG.pl | 6 +++++- share/attributes/svgprops | 10 +++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/share/attributes/genMapDataSVG.pl b/share/attributes/genMapDataSVG.pl index beb06dc04..d64b1c01d 100755 --- a/share/attributes/genMapDataSVG.pl +++ b/share/attributes/genMapDataSVG.pl @@ -88,9 +88,13 @@ push @{$attributes{ "transform" }->{elements}}, "flowRoot","flowPara","flowSpan" push @{$attributes{ "id" }->{elements}}, "mesh","meshrow","meshpatch"; push @{$attributes{ "path" }->{elements}}, "stop"; push @{$attributes{ "gradientUnits" }->{elements}}, "mesh"; -push @{$attributes{ "transform" }->{elements}}, "mesh"; +push @{$attributes{ "gradientTransform" }->{elements}}, "mesh"; +#push @{$attributes{ "transform" }->{elements}}, "mesh"; push @{$attributes{ "href" }->{elements}}, "mesh"; push @{$attributes{ "type" }->{elements}}, "mesh"; +push @{$attributes{ "x" }->{elements}}, "mesh"; +push @{$attributes{ "y" }->{elements}}, "mesh"; +push @{$attributes{ "xlink:href" }->{elements}}, "mesh"; # Hatches push @{$attributes{ "id" }->{elements}}, "hatch","hatchpath"; diff --git a/share/attributes/svgprops b/share/attributes/svgprops index c3948b8da..ba84836da 100644 --- a/share/attributes/svgprops +++ b/share/attributes/svgprops @@ -104,7 +104,7 @@ "glyphRef" - "altGlyph","glyphRef" -"gradientTransform" - "linearGradient","radialGradient" +"gradientTransform" - "linearGradient","radialGradient","mesh" "gradientUnits" - "linearGradient","radialGradient","mesh" @@ -348,7 +348,7 @@ "to" - "set","animate","animateColor","animateMotion","animateTransform" -"transform" - "a","circle","clipPath","defs","ellipse","foreignObject","g","image","line","path","polygon","polyline","rect","switch","text","use","flowRoot","flowPara","flowSpan","mesh","hatch" +"transform" - "a","circle","clipPath","defs","ellipse","foreignObject","g","image","line","path","polygon","polyline","rect","switch","text","use","flowRoot","flowPara","flowSpan","hatch" "type" - "animateTransform","feColorMatrix","feTurbulence","script","style","feFuncA","feFuncB","feFuncG","feFuncR","mesh" @@ -392,7 +392,7 @@ "widths" - "font-face" -"x" - "altGlyph","cursor","fePointLight","feSpotLight","filter","foreignObject","glyphRef","image","pattern","rect","svg","text","use","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","mask","tref","tspan" +"x" - "altGlyph","cursor","fePointLight","feSpotLight","filter","foreignObject","glyphRef","image","pattern","rect","svg","text","use","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","mask","tref","tspan","mesh" "x-height" - "font-face" @@ -406,7 +406,7 @@ "xlink:arcrole" - "a","altGlyph","animate","animateColor","animateMotion","animateTransform","color-profile","cursor","feImage","filter","font-face-uri","glyphRef","image","linearGradient","mpath","pattern","radialGradient","script","set","textPath","tref","use" -"xlink:href" - "a","altGlyph","color-profile","cursor","feImage","filter","font-face-uri","glyphRef","image","linearGradient","mpath","pattern","radialGradient","script","textPath","use","animate","animateColor","animateMotion","animateTransform","set","tref" +"xlink:href" - "a","altGlyph","color-profile","cursor","feImage","filter","font-face-uri","glyphRef","image","linearGradient","mpath","pattern","radialGradient","script","textPath","use","animate","animateColor","animateMotion","animateTransform","set","tref","mesh" "xlink:role" - "a","altGlyph","animate","animateColor","animateMotion","animateTransform","color-profile","cursor","feImage","filter","font-face-uri","glyphRef","image","linearGradient","mpath","pattern","radialGradient","script","set","textPath","tref","use" @@ -422,7 +422,7 @@ "xml:space" - "a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern","flowRoot","flowPara","flowSpan" -"y" - "altGlyph","cursor","fePointLight","feSpotLight","filter","foreignObject","glyphRef","image","pattern","rect","svg","text","use","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","mask","tref","tspan" +"y" - "altGlyph","cursor","fePointLight","feSpotLight","filter","foreignObject","glyphRef","image","pattern","rect","svg","text","use","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","mask","tref","tspan","mesh" "y1" - "line","linearGradient" -- cgit v1.2.3 From 6ec542b8becf1a402c3109f44d2b028a8c87a26c Mon Sep 17 00:00:00 2001 From: Tavmjong Bah Date: Thu, 8 Oct 2015 12:15:34 +0200 Subject: Correct transform when picking colors under mesh. (bzr r14401) --- src/sp-mesh-array.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/sp-mesh-array.cpp b/src/sp-mesh-array.cpp index 445c9a8f6..d76b884ae 100644 --- a/src/sp-mesh-array.cpp +++ b/src/sp-mesh-array.cpp @@ -313,7 +313,7 @@ bool SPMeshPatchI::tensorIsSet( unsigned int i ) { /** Return tensor control point for "corner" i. - If not sest, returns calculated (Coons) point. + If not set, returns calculated (Coons) point. */ Geom::Point SPMeshPatchI::getTensorPoint( guint k ) { @@ -1058,11 +1058,11 @@ void SPMeshNodeArray::create( SPMesh *mg, SPItem *item, Geom::OptRect bbox ) { Geom::Point center = bbox->midpoint(); // Must keep repr and array in sync. We have two choices: - // Build the repr first and the "read" it. - // Construct the array and the "write" it. + // Build the repr first and then "read" it. + // Construct the array and then "write" it. // We'll do the second. - // Remove any existing mesh. We could chose to simply scale an existing mesh... + // Remove any existing mesh. We could choose to simply scale an existing mesh... //clear(); // We get called twice when a new mesh is created...WHY? @@ -2265,10 +2265,12 @@ guint SPMeshNodeArray::color_pick( std::vector icorners, SPItem* item ) { // Region to average over Geom::Point p = n->p; - // std::cout << " p: " << p << std::endl; + // std::cout << " before transform: p: " << p << std::endl; p *= gr->gradientTransform; - // std::cout << " p: " << p << std::endl; - + // std::cout << " after transform: p: " << p << std::endl; + p *= item->i2doc_affine(); + // std::cout << " after transform: p: " << p << std::endl; + // If on edge, move inward guint cols = patch_columns()+1; guint rows = patch_rows()+1; @@ -2277,7 +2279,7 @@ guint SPMeshNodeArray::color_pick( std::vector icorners, SPItem* item ) { guint ncol = col * 3; guint nrow = row * 3; - double size = 3.0; + const double size = 3.0; // Top edge if( row == 0 ) { -- cgit v1.2.3 From 92d48dff17928ec1f964e5671383a9ebb32f3a6b Mon Sep 17 00:00:00 2001 From: Tavmjong Bah Date: Thu, 8 Oct 2015 12:25:06 +0200 Subject: Add buttons for some side/corner mesh opeartions. (bzr r14402) --- src/ui/tools/mesh-tool.cpp | 2 +- src/ui/tools/mesh-tool.h | 2 ++ src/widgets/mesh-toolbar.cpp | 78 +++++++++++++++++++++++++++++++++++++++++++- src/widgets/toolbox.cpp | 5 ++- 4 files changed, 84 insertions(+), 3 deletions(-) diff --git a/src/ui/tools/mesh-tool.cpp b/src/ui/tools/mesh-tool.cpp index 813d6ae5b..303757493 100644 --- a/src/ui/tools/mesh-tool.cpp +++ b/src/ui/tools/mesh-tool.cpp @@ -316,7 +316,7 @@ static void sp_mesh_context_split_near_point(MeshTool *rc, SPItem *item, Geom:: /** Wrapper for various mesh operations that require a list of selected corner nodes. */ -static void +void sp_mesh_context_corner_operation (MeshTool *rc, MeshCornerOperation operation ) { diff --git a/src/ui/tools/mesh-tool.h b/src/ui/tools/mesh-tool.h index d952c9010..91b35b3af 100644 --- a/src/ui/tools/mesh-tool.h +++ b/src/ui/tools/mesh-tool.h @@ -20,6 +20,7 @@ #include #include #include "ui/tools/tool-base.h" +#include "sp-mesh-array.h" #define SP_MESH_CONTEXT(obj) (dynamic_cast((Inkscape::UI::Tools::ToolBase*)obj)) #define SP_IS_MESH_CONTEXT(obj) (dynamic_cast((const Inkscape::UI::Tools::ToolBase*)obj) != NULL) @@ -57,6 +58,7 @@ private: void sp_mesh_context_select_next(ToolBase *event_context); void sp_mesh_context_select_prev(ToolBase *event_context); +void sp_mesh_context_corner_operation(MeshTool *event_context, MeshCornerOperation operation ); } } diff --git a/src/widgets/mesh-toolbar.cpp b/src/widgets/mesh-toolbar.cpp index 1af55d9cd..bef9129b9 100644 --- a/src/widgets/mesh-toolbar.cpp +++ b/src/widgets/mesh-toolbar.cpp @@ -34,6 +34,7 @@ #include "widgets/gradient-image.h" #include "style.h" +#include "inkscape.h" #include "preferences.h" #include "document-private.h" #include "document-undo.h" @@ -66,6 +67,7 @@ using Inkscape::DocumentUndo; using Inkscape::UI::ToolboxFactory; using Inkscape::UI::PrefPusher; +using Inkscape::UI::Tools::MeshTool; static bool blocked = false; @@ -314,10 +316,49 @@ static void ms_type_changed(EgeSelectOneAction *act, GtkWidget *widget) } } +/** Temporary hack: Returns the mesh tool in the active desktop. + * Will go away during tool refactoring. */ +static MeshTool *get_mesh_tool() +{ + MeshTool *tool = 0; + if (SP_ACTIVE_DESKTOP ) { + Inkscape::UI::Tools::ToolBase *ec = SP_ACTIVE_DESKTOP->event_context; + if (SP_IS_MESH_CONTEXT(ec)) { + tool = static_cast(ec); + } + } + return tool; +} + +static void ms_toggle_sides(void) +{ + MeshTool *mt = get_mesh_tool(); + if (mt) { + sp_mesh_context_corner_operation( mt, MG_CORNER_SIDE_TOGGLE ); + } +} + +static void ms_make_elliptical(void) +{ + MeshTool *mt = get_mesh_tool(); + if (mt) { + sp_mesh_context_corner_operation( mt, MG_CORNER_SIDE_ARC ); + } +} + +static void ms_pick_colors(void) +{ + MeshTool *mt = get_mesh_tool(); + if (mt) { + sp_mesh_context_corner_operation( mt, MG_CORNER_COLOR_PICK ); + } +} + static void mesh_toolbox_watch_ec(SPDesktop* dt, Inkscape::UI::Tools::ToolBase* ec, GObject* holder); /** * Mesh auxiliary toolbar construction and setup. + * Don't forget to add to XML in widgets/toolbox.cpp! * */ void sp_mesh_toolbox_prep(SPDesktop * desktop, GtkActionGroup* mainActions, GObject* holder) @@ -466,7 +507,7 @@ void sp_mesh_toolbox_prep(SPDesktop * desktop, GtkActionGroup* mainActions, GObj gtk_action_group_add_action( mainActions, GTK_ACTION(act) ); } - /* Typeing method */ + /* Type */ { GtkListStore* model = gtk_list_store_new( 2, G_TYPE_STRING, G_TYPE_INT ); @@ -487,6 +528,41 @@ void sp_mesh_toolbox_prep(SPDesktop * desktop, GtkActionGroup* mainActions, GObj gtk_action_group_add_action( mainActions, GTK_ACTION(act) ); g_object_set_data( holder, "mesh_select_type_action", act ); } + + { + InkAction* act = ink_action_new( "MeshToggleSidesAction", + _("Toggle Sides"), + _("Toggle selected sides between Beziers and lines."), + INKSCAPE_ICON("node-segment-line"), + secondarySize ); + g_object_set( act, "short_label", _("Toggle side:"), NULL ); + g_signal_connect_after( G_OBJECT(act), "activate", G_CALLBACK(ms_toggle_sides), 0 ); + gtk_action_group_add_action( mainActions, GTK_ACTION(act) ); + } + + { + InkAction* act = ink_action_new( "MeshMakeEllipticalAction", + _("Make elliptical"), + _("Make selected sides elliptical by changing length of handles. Works best if handles already approximate ellipse."), + INKSCAPE_ICON("node-segment-curve"), + secondarySize ); + g_object_set( act, "short_label", _("Make elliptical:"), NULL ); + g_signal_connect_after( G_OBJECT(act), "activate", G_CALLBACK(ms_make_elliptical), 0 ); + gtk_action_group_add_action( mainActions, GTK_ACTION(act) ); + } + + { + InkAction* act = ink_action_new( "MeshPickColorsAction", + _("Pick colors:"), + _("Pick colors for selected corner nodes from underneath mesh."), + INKSCAPE_ICON("color-picker"), + secondarySize ); + g_object_set( act, "short_label", _("Pick Color"), NULL ); + g_signal_connect_after( G_OBJECT(act), "activate", G_CALLBACK(ms_pick_colors), 0 ); + gtk_action_group_add_action( mainActions, GTK_ACTION(act) ); + } + + } static void mesh_toolbox_watch_ec(SPDesktop* desktop, Inkscape::UI::Tools::ToolBase* ec, GObject* holder) diff --git a/src/widgets/toolbox.cpp b/src/widgets/toolbox.cpp index cdf39e9ef..a1c32352c 100644 --- a/src/widgets/toolbox.cpp +++ b/src/widgets/toolbox.cpp @@ -519,9 +519,12 @@ static gchar const * ui_descr = // " " // " " // " " + " " + " " + " " + " " " " " " - " " " " " " -- cgit v1.2.3