summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a321903)
raw | patch | inline | side by side (parent: a321903)
author | buliabyak <buliabyak@users.sourceforge.net> | |
Tue, 16 May 2006 02:39:05 +0000 (02:39 +0000) | ||
committer | buliabyak <buliabyak@users.sourceforge.net> | |
Tue, 16 May 2006 02:39:05 +0000 (02:39 +0000) |
diff --git a/share/icons/icons.svg b/share/icons/icons.svg
index 2d7504f445c7329181582376a10d9ac216d6b85f..c4f49248a3452180a674a6cfd207a691556bc6e5 100644 (file)
--- a/share/icons/icons.svg
+++ b/share/icons/icons.svg
inkscape:window-x="0"
inkscape:window-height="998"
inkscape:window-width="1235"
- inkscape:cy="766.53747"
- inkscape:cx="477.92614"
- inkscape:zoom="6.39741"
+ inkscape:cy="1191.7808"
+ inkscape:cx="779.0784"
+ inkscape:zoom="8.2983948"
gridtolerance="1.0000000px"
snaptogrid="false"
showgrid="true"
xlink:href="#g3813"
y="0"
x="0" />
+ <g
+ transform="translate(64.4787,-188)"
+ id="nodes_show_handles">
+ <path
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#646464;stroke-width:1.00000024;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:0;stroke-dasharray:none;stroke-opacity:1"
+ d="M 679.0213,257.89258 L 679.0213,247"
+ id="path3726"
+ sodipodi:nodetypes="cc" />
+ <rect
+ y="-260.44827"
+ x="-681.52057"
+ height="4.9501772"
+ width="4.9663944"
+ id="rect3728"
+ style="opacity:1;color:black;fill:#6464ff;fill-opacity:0.39215686;fill-rule:evenodd;stroke:blue;stroke-width:1.00000155;stroke-linecap:round;stroke-linejoin:round;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:0;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;display:inline"
+ transform="matrix(-1,-2.790265e-6,-2.867107e-6,-1,0,0)" />
+ <rect
+ style="opacity:1;color:black;fill:#6464ff;fill-opacity:0.39215686;fill-rule:evenodd;stroke:blue;stroke-width:1.00000072;stroke-linecap:round;stroke-linejoin:round;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:0;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;display:inline"
+ id="rect3730"
+ width="2.022052"
+ height="2.0266623"
+ x="-248.02205"
+ y="678.01025"
+ transform="matrix(0,-1,1,0,0,0)"
+ ry="1.011026" />
+ </g>
</svg>
diff --git a/src/node-context.cpp b/src/node-context.cpp
index 67511ea30e83c3e0a4f4445e3c9da1fdc5084608..d7848e3bb58ba7cc0e4b3cd9d682c618fdf6abbd 100644 (file)
--- a/src/node-context.cpp
+++ b/src/node-context.cpp
nc->added_node = false;
if (item) {
- nc->nodepath = sp_nodepath_new(ec->desktop, item);
+ nc->nodepath = sp_nodepath_new(ec->desktop, item, (prefs_get_int_attribute("tools.nodes", "show_handles", 1) != 0));
if ( nc->nodepath) {
//point pack to parent in case nodepath is deleted
nc->nodepath->nodeContext = nc;
@@ -241,7 +241,7 @@ sp_node_context_selection_changed(Inkscape::Selection *selection, gpointer data)
nc->nodepath = NULL;
ec->shape_knot_holder = NULL;
if (item) {
- nc->nodepath = sp_nodepath_new(desktop, item);
+ nc->nodepath = sp_nodepath_new(desktop, item, (prefs_get_int_attribute("tools.nodes", "show_handles", 1) != 0));
if (nc->nodepath) {
nc->nodepath->nodeContext = nc;
}
item = selection->singleItem();
if (item) {
- nc->nodepath = sp_nodepath_new(desktop, item);
+ nc->nodepath = sp_nodepath_new(desktop, item, (prefs_get_int_attribute("tools.nodes", "show_handles", 1) != 0));
if (nc->nodepath) {
nc->nodepath->nodeContext = nc;
}
diff --git a/src/nodepath.cpp b/src/nodepath.cpp
index 4b955973774d27f44ed34e55a167441e9a011d12..1ffef1880c68b0f6c4110e7c64322adad9fc167e 100644 (file)
--- a/src/nodepath.cpp
+++ b/src/nodepath.cpp
/**
* \brief Creates new nodepath from item
*/
-Inkscape::NodePath::Path *sp_nodepath_new(SPDesktop *desktop, SPItem *item)
+Inkscape::NodePath::Path *sp_nodepath_new(SPDesktop *desktop, SPItem *item, bool show_handles)
{
Inkscape::XML::Node *repr = SP_OBJECT(item)->repr;
np->nodeContext = NULL; //Let the context that makes this set it
np->livarot_path = NULL;
np->local_change = 0;
+ np->show_handles = show_handles;
// we need to update item's transform from the repr here,
// because they may be out of sync when we respond
@@ -1336,6 +1337,9 @@ static void sp_node_update_handles(Inkscape::NodePath::Node *node, bool fire_mov
if (node->n.other->selected) show_handles = TRUE;
}
+ if (node->subpath->nodepath->show_handles == false)
+ show_handles = FALSE;
+
sp_node_update_handle(node, -1, show_handles, fire_move_signals);
sp_node_update_handle(node, 1, show_handles, fire_move_signals);
}
}
}
+void
+sp_nodepath_show_handles(bool show)
+{
+ Inkscape::NodePath::Path *nodepath = sp_nodepath_current();
+ if (nodepath == NULL) return;
+
+ nodepath->show_handles = show;
+ sp_nodepath_update_handles(nodepath);
+}
+
/**
* Adds all selected nodes in nodepath to list.
*/
diff --git a/src/nodepath.h b/src/nodepath.h
index 2b6131684cb1ce8c27730780ab804fe4ad1852b6..2b8243f5b612b693055428b87da84df62f65641e 100644 (file)
--- a/src/nodepath.h
+++ b/src/nodepath.h
/// true if we changed repr, to tell this change from an external one such as from undo, simplify, or another desktop
unsigned int local_change;
+
+ /// true if we're showing selected nodes' handles
+ bool show_handles;
};
} // namespace Inkscape
// Do function documentation in nodepath.cpp
-Inkscape::NodePath::Path * sp_nodepath_new (SPDesktop * desktop, SPItem * item);
+Inkscape::NodePath::Path * sp_nodepath_new (SPDesktop * desktop, SPItem * item, bool show_handles);
void sp_nodepath_destroy (Inkscape::NodePath::Path * nodepath);
void sp_nodepath_deselect (Inkscape::NodePath::Path *nodepath);
void sp_nodepath_select_all (Inkscape::NodePath::Path *nodepath, bool invert);
void sp_node_selected_move (gdouble dx, gdouble dy);
void sp_node_selected_move_screen (gdouble dx, gdouble dy);
+void sp_nodepath_show_handles(bool show);
+
void sp_nodepath_selected_nodes_rotate (Inkscape::NodePath::Path * nodepath, gdouble angle, int which, bool screen);
void sp_nodepath_selected_nodes_scale (Inkscape::NodePath::Path * nodepath, gdouble grow, int which);
index 27cc68e25a3e1d02e19f37188cc6c205e51fb7a0..3d6434bf2f6de97f031e3da4fcc0d3e46564f6a8 100644 (file)
--- a/src/widgets/toolbox.cpp
+++ b/src/widgets/toolbox.cpp
sp_node_selected_set_type(Inkscape::NodePath::NODE_SYMM);
}
-
+static void toggle_show_handles (GtkWidget *button, gpointer data) {
+ bool show = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button));
+ prefs_set_int_attribute ("tools.nodes", "show_handles", show ? 1 : 0);
+ sp_nodepath_show_handles(show);
+}
//################################
//## Node Editing Toolbox ##
sp_toolbox_button_normal_new_from_verb(tb, Inkscape::ICON_SIZE_SMALL_TOOLBAR, Inkscape::Verb::get(SP_VERB_SELECTION_OUTLINE), view, tt);
+ aux_toolbox_space(tb, AUX_BETWEEN_BUTTON_GROUPS);
+
+ GtkWidget *cvbox = gtk_vbox_new (FALSE, 0);
+ GtkWidget *cbox = gtk_hbox_new (FALSE, 0);
+
+ {
+ GtkWidget *button = sp_button_new_from_data( Inkscape::ICON_SIZE_DECORATION,
+ SP_BUTTON_TYPE_TOGGLE,
+ NULL,
+ "nodes_show_handles",
+ _("Show the Bezier handles of selected nodes"),
+ tt);
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), prefs_get_int_attribute ("tools.nodes", "show_handles", 1));
+ g_signal_connect_after (G_OBJECT (button), "clicked", G_CALLBACK (toggle_show_handles), desktop);
+ gtk_box_pack_start(GTK_BOX(cbox), button, FALSE, FALSE, 0);
+ }
+
+ gtk_box_pack_start(GTK_BOX(cvbox), cbox, TRUE, FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(tb), cvbox, FALSE, FALSE, 0);
+
gtk_widget_show_all(tb);
return tb;