diff options
| author | Martin Owens <doctormo@gmail.com> | 2016-04-12 16:01:58 +0000 |
|---|---|---|
| committer | Martin Owens <doctormo@gmail.com> | 2016-04-12 16:01:58 +0000 |
| commit | fe975a9b3c5603fe2b2d0491de3bbfe1e4bf0233 (patch) | |
| tree | f9d7a9f4e0ba58f92a722578bc1f750bce989e7d /src/widgets/ink-action.cpp | |
| parent | sp-canvas: Disable deprecated double-buffering #Hackfest2016 (diff) | |
| download | inkscape-fe975a9b3c5603fe2b2d0491de3bbfe1e4bf0233.tar.gz inkscape-fe975a9b3c5603fe2b2d0491de3bbfe1e4bf0233.zip | |
Fork GtkImageMenuItem and remove show_image boolean because we always want to show menu.
(bzr r14800)
Diffstat (limited to 'src/widgets/ink-action.cpp')
| -rw-r--r-- | src/widgets/ink-action.cpp | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/widgets/ink-action.cpp b/src/widgets/ink-action.cpp index 5941c31e4..01aa4957a 100644 --- a/src/widgets/ink-action.cpp +++ b/src/widgets/ink-action.cpp @@ -1,12 +1,20 @@ #include "widgets/icon.h" #include "icon-size.h" #include <glib/gi18n.h> -#include <gtk/gtk.h> + #include "widgets/ink-action.h" #include "widgets/button.h" +#include <gtk/gtk.h> + +#if GTK_CHECK_VERSION(3,0,0) + // Fork of gtk-imagemenuitem to continue support + #include "widgets/imagemenuitem.h" + +#endif + static void ink_action_finalize( GObject* obj ); static void ink_action_get_property( GObject* obj, guint propId, GValue* value, GParamSpec * pspec ); static void ink_action_set_property( GObject* obj, guint propId, const GValue *value, GParamSpec* pspec ); @@ -158,7 +166,12 @@ static GtkWidget* ink_action_create_menu_item( GtkAction* action ) gchar* label = 0; g_object_get( G_OBJECT(act), "label", &label, NULL ); +#if GTK_CHECK_VERSION(3,0,0) + item = image_menu_item_new_with_mnemonic( label ); +#else item = gtk_image_menu_item_new_with_mnemonic( label ); +#endif + GtkWidget* child = sp_icon_new( Inkscape::ICON_SIZE_MENU, act->private_data->iconId ); // TODO this work-around is until SPIcon will live properly inside of a popup menu if ( SP_IS_ICON(child) ) { @@ -172,7 +185,12 @@ static GtkWidget* ink_action_create_menu_item( GtkAction* action ) } } gtk_widget_show_all( child ); + +#if GTK_CHECK_VERSION(3,0,0) + image_menu_item_set_image( IMAGE_MENU_ITEM(item), child ); +#else gtk_image_menu_item_set_image( GTK_IMAGE_MENU_ITEM(item), child ); +#endif g_free( label ); label = 0; |
