From e93822da2c418b1f1be822ff3c345c2120b1a6f2 Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Tue, 3 Jan 2012 00:02:35 +0100 Subject: add buttons for node adding at extrema (bzr r10825) --- src/widgets/toolbox.cpp | 74 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) (limited to 'src/widgets/toolbox.cpp') diff --git a/src/widgets/toolbox.cpp b/src/widgets/toolbox.cpp index adfa334e1..2da0642ae 100644 --- a/src/widgets/toolbox.cpp +++ b/src/widgets/toolbox.cpp @@ -286,6 +286,10 @@ static gchar const * ui_descr = " " " " " " +/* " " + " " + " " + " " */ " " " " " " @@ -1154,6 +1158,35 @@ static void sp_node_path_edit_add(void) } } +static void sp_node_path_edit_add_min_x(void) +{ + InkNodeTool *nt = get_node_tool(); + if (nt) { + nt->_multipath->insertNodes(); + } +} +static void sp_node_path_edit_add_max_x(void) +{ + InkNodeTool *nt = get_node_tool(); + if (nt) { + nt->_multipath->insertNodes(); + } +} +static void sp_node_path_edit_add_min_y(void) +{ + InkNodeTool *nt = get_node_tool(); + if (nt) { + nt->_multipath->insertNodes(); + } +} +static void sp_node_path_edit_add_max_y(void) +{ + InkNodeTool *nt = get_node_tool(); + if (nt) { + nt->_multipath->insertNodes(); + } +} + static void sp_node_path_edit_delete(void) { InkNodeTool *nt = get_node_tool(); @@ -1385,6 +1418,47 @@ static void sp_node_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions gtk_action_group_add_action( mainActions, GTK_ACTION(inky) ); } + { + InkAction* inky = ink_action_new( "NodeInsertActionMinX", + _("Insert node at min X"), + _("Insert new nodes at min X into selected segments"), + INKSCAPE_ICON("node_insert_min_x"), + secondarySize ); + g_object_set( inky, "short_label", _("Insert min X"), NULL ); + g_signal_connect_after( G_OBJECT(inky), "activate", G_CALLBACK(sp_node_path_edit_add_min_x), 0 ); + gtk_action_group_add_action( mainActions, GTK_ACTION(inky) ); + } + { + InkAction* inky = ink_action_new( "NodeInsertActionMaxX", + _("Insert node at max X"), + _("Insert new nodes at max X into selected segments"), + INKSCAPE_ICON("node_insert_max_x"), + secondarySize ); + g_object_set( inky, "short_label", _("Insert max X"), NULL ); + g_signal_connect_after( G_OBJECT(inky), "activate", G_CALLBACK(sp_node_path_edit_add_max_x), 0 ); + gtk_action_group_add_action( mainActions, GTK_ACTION(inky) ); + } + { + InkAction* inky = ink_action_new( "NodeInsertActionMinY", + _("Insert node at min Y"), + _("Insert new nodes at min Y into selected segments"), + INKSCAPE_ICON("node_insert_min_y"), + secondarySize ); + g_object_set( inky, "short_label", _("Insert min Y"), NULL ); + g_signal_connect_after( G_OBJECT(inky), "activate", G_CALLBACK(sp_node_path_edit_add_min_y), 0 ); + gtk_action_group_add_action( mainActions, GTK_ACTION(inky) ); + } + { + InkAction* inky = ink_action_new( "NodeInsertActionMaxY", + _("Insert node at max Y"), + _("Insert new nodes at max Y into selected segments"), + INKSCAPE_ICON("node_insert_max_y"), + secondarySize ); + g_object_set( inky, "short_label", _("Insert max Y"), NULL ); + g_signal_connect_after( G_OBJECT(inky), "activate", G_CALLBACK(sp_node_path_edit_add_max_y), 0 ); + gtk_action_group_add_action( mainActions, GTK_ACTION(inky) ); + } + { InkAction* inky = ink_action_new( "NodeDeleteAction", _("Delete node"), -- cgit v1.2.3