summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Smith <john.smith7545@yahoo.com>2012-09-02 04:24:45 +0000
committerJohn Smith <john.smith7545@yahoo.com>2012-09-02 04:24:45 +0000
commitb3f55760cbb99bd4cc96d86eae8068e724d0abe9 (patch)
tree6dbb9d360e31f5c7cc50f651d69927d549962ba8
parentFix for 747998 : Align unit menu in Rows Columns dialog (diff)
downloadinkscape-b3f55760cbb99bd4cc96d86eae8068e724d0abe9.tar.gz
inkscape-b3f55760cbb99bd4cc96d86eae8068e724d0abe9.zip
Fix for 273539 : Add Group action to the context menu
(bzr r11640)
-rw-r--r--src/interface.cpp16
-rw-r--r--src/interface.h4
2 files changed, 18 insertions, 2 deletions
diff --git a/src/interface.cpp b/src/interface.cpp
index 71be84f59..b10ba3077 100644
--- a/src/interface.cpp
+++ b/src/interface.cpp
@@ -1887,6 +1887,17 @@ void ContextMenu::MakeItemMenu (void)
}
mi->show();
append(*mi);
+
+ /* Group */
+ mi = manage(new Gtk::MenuItem(_("_Group"),1));
+ mi->signal_activate().connect(sigc::mem_fun(*this, &ContextMenu::ActivateGroup));
+ if (_desktop->selection->isEmpty() || _desktop->selection->single()) {
+ mi->set_sensitive(FALSE);
+ } else {
+ mi->set_sensitive(TRUE);
+ }
+ mi->show();
+ append(*mi);
}
void ContextMenu::SelectSameFillStroke(void)
@@ -1979,6 +1990,11 @@ void ContextMenu::MakeGroupMenu(void)
append(*mi);
}
+void ContextMenu::ActivateGroup(void)
+{
+ sp_selection_group(_desktop);
+}
+
void ContextMenu::ActivateUngroup(void)
{
GSList *children = NULL;
diff --git a/src/interface.h b/src/interface.h
index 931a2c1b3..aa0281db3 100644
--- a/src/interface.h
+++ b/src/interface.h
@@ -185,10 +185,10 @@ class ContextMenu : public Gtk::Menu
/**
- * callback, is executed on clicking the anchor "Ungroup" menu entry
+ * callback, is executed on clicking the anchor "Group" and "Ungroup" menu entry
*/
void ActivateUngroup(void);
-
+ void ActivateGroup(void);
void AnchorLinkProperties(void);
/**