diff options
| author | Richard White <rwhite8282@gmail.com> | 2016-05-19 01:17:29 +0000 |
|---|---|---|
| committer | Richard White <rwhite8282@gmail.com> | 2016-05-19 01:17:29 +0000 |
| commit | 1fe9c2603c33fddcd9f2688b30e843f91e1a86fa (patch) | |
| tree | 13289cbe033a46a40eb829437e115b5393e2ca84 /src/ui/interface.cpp | |
| parent | Corrected frame extension stroke and fill values on 64 bit machine. (diff) | |
| parent | GTK3: Another widget named. (diff) | |
| download | inkscape-1fe9c2603c33fddcd9f2688b30e843f91e1a86fa.tar.gz inkscape-1fe9c2603c33fddcd9f2688b30e843f91e1a86fa.zip | |
Merge from Inkscape trunk.
(bzr r14668.1.3)
Diffstat (limited to 'src/ui/interface.cpp')
| -rw-r--r-- | src/ui/interface.cpp | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/src/ui/interface.cpp b/src/ui/interface.cpp index 69b229519..3e2a2004c 100644 --- a/src/ui/interface.cpp +++ b/src/ui/interface.cpp @@ -79,6 +79,10 @@ #include "message-stack.h" #include "ui/dialog/layer-properties.h" +#if GTK_CHECK_VERSION(3,0,0) + #include "widgets/image-menu-item.h" +#endif + #include <gdk/gdkkeysyms.h> #include <glibmm/miscutils.h> @@ -413,7 +417,11 @@ sp_ui_menuitem_add_icon( GtkWidget *item, gchar *icon_name ) icon = sp_icon_new( Inkscape::ICON_SIZE_MENU, icon_name ); gtk_widget_show(icon); +#if GTK_CHECK_VERSION(3,0,0) + image_menu_item_set_image((ImageMenuItem *) item, icon); +#else gtk_image_menu_item_set_image((GtkImageMenuItem *) item, icon); +#endif } // end of sp_ui_menu_add_icon void @@ -467,7 +475,11 @@ static GtkWidget *sp_ui_menu_append_item_from_verb(GtkMenu *menu, Inkscape::Verb if (radio) { item = gtk_radio_menu_item_new_with_mnemonic(group, action->name); } else { +#if GTK_CHECK_VERSION(3,0,0) + item = image_menu_item_new_with_mnemonic(action->name); +#else item = gtk_image_menu_item_new_with_mnemonic(action->name); +#endif } gtk_label_set_markup_with_mnemonic( GTK_LABEL(gtk_bin_get_child(GTK_BIN (item))), action->name); @@ -1018,7 +1030,7 @@ sp_ui_drag_data_received(GtkWidget *widget, { int destX = 0; int destY = 0; - gtk_widget_translate_coordinates( widget, &(desktop->canvas->widget), x, y, &destX, &destY ); + gtk_widget_translate_coordinates( widget, GTK_WIDGET(desktop->canvas), x, y, &destX, &destY ); Geom::Point where( sp_canvas_window_to_world( desktop->canvas, Geom::Point( destX, destY ) ) ); Geom::Point const button_dt(desktop->w2d(where)); Geom::Point const button_doc(desktop->dt2doc(button_dt)); @@ -1141,7 +1153,7 @@ sp_ui_drag_data_received(GtkWidget *widget, if ( worked ) { int destX = 0; int destY = 0; - gtk_widget_translate_coordinates( widget, &(desktop->canvas->widget), x, y, &destX, &destY ); + gtk_widget_translate_coordinates( widget, GTK_WIDGET(desktop->canvas), x, y, &destX, &destY ); Geom::Point where( sp_canvas_window_to_world( desktop->canvas, Geom::Point( destX, destY ) ) ); Geom::Point const button_dt(desktop->w2d(where)); Geom::Point const button_doc(desktop->dt2doc(button_dt)); @@ -1511,6 +1523,12 @@ ContextMenu::ContextMenu(SPDesktop *desktop, SPItem *item) : MIParent.signal_activate().connect(sigc::mem_fun(*this, &ContextMenu::LeaveGroup)); MIParent.show(); append(MIParent); + + /* Pop selection out of group */ + Gtk::MenuItem* miu = Gtk::manage(new Gtk::MenuItem(_("_Pop selection out of group"), 1)); + miu->signal_activate().connect(sigc::mem_fun(*this, &ContextMenu::ActivateUngroupPopSelection)); + miu->show(); + append(*miu); } } } @@ -1786,7 +1804,7 @@ void ContextMenu::MakeItemMenu (void) /* Group */ mi = Gtk::manage(new Gtk::MenuItem(_("_Group"), 1)); mi->signal_activate().connect(sigc::mem_fun(*this, &ContextMenu::ActivateGroup)); - if (_desktop->selection->isEmpty() || _desktop->selection->single()) { + if (_desktop->selection->isEmpty()) { mi->set_sensitive(FALSE); } else { mi->set_sensitive(TRUE); @@ -1908,6 +1926,12 @@ void ContextMenu::ActivateUngroup(void) sp_item_group_ungroup(static_cast<SPGroup*>(_item), children); _desktop->selection->setList(children); } + +void ContextMenu::ActivateUngroupPopSelection(void) +{ + sp_selection_ungroup_pop_selection(_desktop->selection, _desktop); +} + void ContextMenu::MakeAnchorMenu(void) { |
