summaryrefslogtreecommitdiffstats
path: root/src/widgets/toolbox.cpp
diff options
context:
space:
mode:
authorJohan B. C. Engelen <jbc.engelen@swissonline.ch>2012-01-05 20:22:09 +0000
committerJohan Engelen <goejendaagh@zonnet.nl>2012-01-05 20:22:09 +0000
commit5f739493fd73a6ae099e3929e8934bb8d3fe87cd (patch)
tree3256109cd5af8e5acadd35e4f8cbb2ee75b4b297 /src/widgets/toolbox.cpp
parentGTK 2.20 compat for interface.cpp (diff)
downloadinkscape-5f739493fd73a6ae099e3929e8934bb8d3fe87cd.tar.gz
inkscape-5f739493fd73a6ae099e3929e8934bb8d3fe87cd.zip
add toolbutton menu action type. now the add extremum node buttons are somewhat subbuttons of the insert node button...
(bzr r10849)
Diffstat (limited to 'src/widgets/toolbox.cpp')
-rw-r--r--src/widgets/toolbox.cpp29
1 files changed, 18 insertions, 11 deletions
diff --git a/src/widgets/toolbox.cpp b/src/widgets/toolbox.cpp
index 3960f2349..b6e8df259 100644
--- a/src/widgets/toolbox.cpp
+++ b/src/widgets/toolbox.cpp
@@ -285,11 +285,14 @@ static gchar const * ui_descr =
" <toolbar name='NodeToolbar'>"
" <separator />"
- " <toolitem action='NodeInsertAction' />"
- " <toolitem action='NodeInsertActionMinX' />"
- " <toolitem action='NodeInsertActionMaxX' />"
- " <toolitem action='NodeInsertActionMinY' />"
- " <toolitem action='NodeInsertActionMaxY' />"
+ " <toolitem action='NodeInsertAction'>"
+ " <menu action='NodeInsertActionMenu'>"
+ " <menuitem action='NodeInsertActionMinX' />"
+ " <menuitem action='NodeInsertActionMaxX' />"
+ " <menuitem action='NodeInsertActionMinY' />"
+ " <menuitem action='NodeInsertActionMaxY' />"
+ " </menu>"
+ " </toolitem>"
" <toolitem action='NodeDeleteAction' />"
" <separator />"
" <toolitem action='NodeJoinAction' />"
@@ -1408,14 +1411,18 @@ static void sp_node_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions
Inkscape::IconSize secondarySize = ToolboxFactory::prefToSize("/toolbox/secondary", 1);
{
- InkAction* inky = ink_action_new( "NodeInsertAction",
- _("Insert node"),
- _("Insert new nodes into selected segments"),
- INKSCAPE_ICON("node-add"),
- secondarySize );
- g_object_set( inky, "short_label", _("Insert"), NULL );
+ InkToolMenuAction* inky = ink_tool_menu_action_new( "NodeInsertAction",
+ _("Insert node"),
+ _("Insert new nodes into selected segments"),
+ INKSCAPE_ICON("node-add"),
+ secondarySize );
+ g_object_set( INK_ACTION(inky), "short_label", _("Insert"), NULL );
g_signal_connect_after( G_OBJECT(inky), "activate", G_CALLBACK(sp_node_path_edit_add), 0 );
gtk_action_group_add_action( mainActions, GTK_ACTION(inky) );
+ GtkToolItem *menu_tool_button = gtk_menu_tool_button_new (NULL, NULL);
+ gtk_activatable_set_related_action (GTK_ACTIVATABLE (menu_tool_button), GTK_ACTION(inky));
+ // also create dummy menu action:
+ gtk_action_group_add_action( mainActions, gtk_action_new("NodeInsertActionMenu", NULL, NULL, NULL) );
}
{