summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/attributes.cpp1
-rw-r--r--src/attributes.h1
-rw-r--r--src/sp-item.cpp17
-rw-r--r--src/ui/tool/multi-path-manipulator.cpp6
-rw-r--r--src/ui/tool/multi-path-manipulator.h2
-rw-r--r--src/ui/tools/node-tool.cpp3
6 files changed, 25 insertions, 5 deletions
diff --git a/src/attributes.cpp b/src/attributes.cpp
index ee2a80fd3..4e39b648e 100644
--- a/src/attributes.cpp
+++ b/src/attributes.cpp
@@ -41,6 +41,7 @@ static SPStyleProp const props[] = {
{SP_ATTR_TRANSFORM_CENTER_X, "inkscape:transform-center-x"},
{SP_ATTR_TRANSFORM_CENTER_Y, "inkscape:transform-center-y"},
{SP_ATTR_INKSCAPE_PATH_EFFECT, "inkscape:path-effect"},
+ {SP_ATTR_INKSCAPE_HIGHLIGHT_COLOR, "inkscape:highlight-color"},
/* SPAnchor */
{SP_ATTR_XLINK_HREF, "xlink:href"},
{SP_ATTR_XLINK_TYPE, "xlink:type"},
diff --git a/src/attributes.h b/src/attributes.h
index b8843fcb7..d1c93b819 100644
--- a/src/attributes.h
+++ b/src/attributes.h
@@ -40,6 +40,7 @@ enum SPAttributeEnum {
SP_ATTR_TRANSFORM_CENTER_X,
SP_ATTR_TRANSFORM_CENTER_Y,
SP_ATTR_INKSCAPE_PATH_EFFECT,
+ SP_ATTR_INKSCAPE_HIGHLIGHT_COLOR,
/* SPAnchor */
SP_ATTR_XLINK_HREF,
SP_ATTR_XLINK_TYPE,
diff --git a/src/sp-item.cpp b/src/sp-item.cpp
index 79d8cc37d..ff3e3a31c 100644
--- a/src/sp-item.cpp
+++ b/src/sp-item.cpp
@@ -493,11 +493,23 @@ void SPItem::set(unsigned int key, gchar const* value) {
break;
}
case SP_ATTR_SODIPODI_INSENSITIVE:
+ {
item->sensitive = !value;
for (SPItemView *v = item->display; v != NULL; v = v->next) {
v->arenaitem->setSensitive(item->sensitive);
}
break;
+ }
+ case SP_ATTR_INKSCAPE_HIGHLIGHT_COLOR:
+ {
+ g_free(item->_highlightColor);
+ if (value) {
+ item->_highlightColor = g_strdup(value);
+ } else {
+ item->_highlightColor = NULL;
+ }
+ break;
+ }
case SP_ATTR_CONNECTOR_AVOID:
item->avoidRef->setAvoid(value);
break;
@@ -706,6 +718,11 @@ Inkscape::XML::Node* SPItem::write(Inkscape::XML::Document *xml_doc, Inkscape::X
g_free ((void *) uri);
}
}
+ if (item->_highlightColor){
+ repr->setAttribute("inkscape:highlight-color", item->_highlightColor);
+ } else {
+ repr->setAttribute("inkscape:highlight-color", NULL);
+ }
SPObject::write(xml_doc, repr, flags);
diff --git a/src/ui/tool/multi-path-manipulator.cpp b/src/ui/tool/multi-path-manipulator.cpp
index 65987ad52..b54b5ad07 100644
--- a/src/ui/tool/multi-path-manipulator.cpp
+++ b/src/ui/tool/multi-path-manipulator.cpp
@@ -182,7 +182,7 @@ void MultiPathManipulator::setItems(std::set<ShapeRecord> const &s)
ShapeRecord const &r = *i;
if (!SP_IS_PATH(r.item) && !IS_LIVEPATHEFFECT(r.item)) continue;
boost::shared_ptr<PathManipulator> newpm(new PathManipulator(*this, (SPPath*) r.item,
- r.edit_transform, _getOutlineColor(r.role), r.lpe_key));
+ r.edit_transform, _getOutlineColor(r.role, r.item), r.lpe_key));
newpm->showHandles(_show_handles);
// always show outlines for clips and masks
newpm->showOutline(_show_outline || r.role != SHAPE_ROLE_NORMAL);
@@ -833,7 +833,7 @@ void MultiPathManipulator::_doneWithCleanup(gchar const *reason, bool alert_LPE)
}
/** Get an outline color based on the shape's role (normal, mask, LPE parameter, etc.). */
-guint32 MultiPathManipulator::_getOutlineColor(ShapeRole role)
+guint32 MultiPathManipulator::_getOutlineColor(ShapeRole role, SPItem *item)
{
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
switch(role) {
@@ -845,7 +845,7 @@ guint32 MultiPathManipulator::_getOutlineColor(ShapeRole role)
return prefs->getColor("/tools/nodes/lpe_param_color", 0x009000ff);
case SHAPE_ROLE_NORMAL:
default:
- return prefs->getColor("/tools/nodes/outline_color", 0xff0000ff);
+ return item->highlight_color();
}
}
diff --git a/src/ui/tool/multi-path-manipulator.h b/src/ui/tool/multi-path-manipulator.h
index 1328372c6..d3746b878 100644
--- a/src/ui/tool/multi-path-manipulator.h
+++ b/src/ui/tool/multi-path-manipulator.h
@@ -106,7 +106,7 @@ private:
void _commit(CommitEvent cps);
void _done(gchar const *reason, bool alert_LPE = false);
void _doneWithCleanup(gchar const *reason, bool alert_LPE = false);
- guint32 _getOutlineColor(ShapeRole role);
+ guint32 _getOutlineColor(ShapeRole role, SPItem *item);
MapType _mmap;
public:
diff --git a/src/ui/tools/node-tool.cpp b/src/ui/tools/node-tool.cpp
index b1e11bd66..719b67108 100644
--- a/src/ui/tools/node-tool.cpp
+++ b/src/ui/tools/node-tool.cpp
@@ -473,7 +473,8 @@ bool NodeTool::root_handler(GdkEvent* event) {
SPCanvasItem *flash = sp_canvas_bpath_new(sp_desktop_tempgroup(desktop), c);
sp_canvas_bpath_set_stroke(SP_CANVAS_BPATH(flash),
- prefs->getInt("/tools/nodes/highlight_color", 0xff0000ff), 1.0,
+ //prefs->getInt("/tools/nodes/highlight_color", 0xff0000ff), 1.0,
+ over_item->highlight_color(), 1.0,
SP_STROKE_LINEJOIN_MITER, SP_STROKE_LINECAP_BUTT);
sp_canvas_bpath_set_fill(SP_CANVAS_BPATH(flash), 0, SP_WIND_RULE_NONZERO);