[libwnck] window-action-menu: don't use deprecated GtkImageMenuItem



commit 68a71158df9ad592d5283e203d60920812a0ee1e
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Wed Oct 15 01:19:06 2014 +0300

    window-action-menu: don't use deprecated GtkImageMenuItem

 libwnck/window-action-menu.c |   43 +-----------------------------------------
 1 files changed, 1 insertions(+), 42 deletions(-)
---
diff --git a/libwnck/window-action-menu.c b/libwnck/window-action-menu.c
index 01db6c3..d44e84f 100644
--- a/libwnck/window-action-menu.c
+++ b/libwnck/window-action-menu.c
@@ -340,34 +340,6 @@ set_item_text (GtkWidget  *mi,
   gtk_label_set_use_underline (label, TRUE);
 }
 
-static void
-set_item_stock (GtkWidget  *mi,
-                const char *stock_id)
-{
-  GtkWidget *image;
-
-  image = gtk_image_menu_item_get_image (GTK_IMAGE_MENU_ITEM (mi));
-
-  if (stock_id == NULL)
-    {
-      if (image != NULL)
-        gtk_widget_destroy (image);
-      return;
-    }
-
-  if (image == NULL)
-    {
-      image = gtk_image_new_from_stock (stock_id, GTK_ICON_SIZE_MENU);
-      gtk_widget_show (image);
-      gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (mi), image);
-    }
-  else
-    {
-      gtk_image_set_from_stock (GTK_IMAGE (image), stock_id,
-                                GTK_ICON_SIZE_MENU);
-    }
-}
-
 static gboolean
 update_menu_state (WnckActionMenu *menu)
 {
@@ -394,14 +366,12 @@ update_menu_state (WnckActionMenu *menu)
   if (wnck_window_is_minimized (priv->window))
     {
       set_item_text (priv->minimize_item, _("Unmi_nimize"));
-      set_item_stock (priv->minimize_item, NULL);
       gtk_widget_set_sensitive (priv->minimize_item,
                                 (actions & WNCK_WINDOW_ACTION_UNMINIMIZE) != 0);
     }
   else
     {
       set_item_text (priv->minimize_item, _("Mi_nimize"));
-      set_item_stock (priv->minimize_item, WNCK_STOCK_MINIMIZE);
       gtk_widget_set_sensitive (priv->minimize_item,
                                 (actions & WNCK_WINDOW_ACTION_MINIMIZE) != 0);
     }
@@ -409,14 +379,12 @@ update_menu_state (WnckActionMenu *menu)
   if (wnck_window_is_maximized (priv->window))
     {
       set_item_text (priv->maximize_item, _("Unma_ximize"));
-      set_item_stock (priv->maximize_item, NULL);
       gtk_widget_set_sensitive (priv->maximize_item,
                                 (actions & WNCK_WINDOW_ACTION_UNMAXIMIZE) != 0);
     }
   else
     {
       set_item_text (priv->maximize_item, _("Ma_ximize"));
-      set_item_stock (priv->maximize_item, WNCK_STOCK_MAXIMIZE);
       gtk_widget_set_sensitive (priv->maximize_item,
                                 (actions & WNCK_WINDOW_ACTION_MAXIMIZE) != 0);
     }
@@ -693,7 +661,7 @@ make_menu_item (WindowAction action)
 {
   GtkWidget *mi;
 
-  mi = gtk_image_menu_item_new_with_label ("");
+  mi = gtk_menu_item_new_with_label ("");
 
   g_signal_connect (G_OBJECT (mi), "activate",
                     G_CALLBACK (item_activated_callback),
@@ -818,7 +786,6 @@ refill_submenu_workspace (WnckActionMenu *menu)
 
       gtk_menu_shell_append (GTK_MENU_SHELL (submenu), item);
       set_item_text (item, name);
-      set_item_stock (item, NULL);
 
       g_free (name);
     }
@@ -897,7 +864,6 @@ refill_submenu_viewport (WnckActionMenu *menu)
 
           gtk_menu_shell_append (GTK_MENU_SHELL (submenu), item);
           set_item_text (item, label);
-          set_item_stock (item, NULL);
 
           g_free (label);
         }
@@ -1023,14 +989,12 @@ wnck_action_menu_constructor (GType                  type,
                          priv->move_item);
 
   set_item_text (priv->move_item, _("_Move"));
-  set_item_stock (priv->move_item, NULL);
 
   priv->resize_item = make_menu_item (RESIZE);
   gtk_menu_shell_append (GTK_MENU_SHELL (menu),
                          priv->resize_item);
 
   set_item_text (priv->resize_item, _("_Resize"));
-  set_item_stock (priv->move_item, NULL);
 
   priv->workspace_separator = separator = gtk_separator_menu_item_new ();
   gtk_widget_show (separator);
@@ -1059,25 +1023,21 @@ wnck_action_menu_constructor (GType                  type,
   gtk_menu_shell_append (GTK_MENU_SHELL (menu),
                          priv->left_item);
   set_item_text (priv->left_item, _("Move to Workspace _Left"));
-  set_item_stock (priv->left_item, NULL);
 
   priv->right_item = make_menu_item (RIGHT);
   gtk_menu_shell_append (GTK_MENU_SHELL (menu),
                          priv->right_item);
   set_item_text (priv->right_item, _("Move to Workspace R_ight"));
-  set_item_stock (priv->right_item, NULL);
 
   priv->up_item = make_menu_item (UP);
   gtk_menu_shell_append (GTK_MENU_SHELL (menu),
                          priv->up_item);
   set_item_text (priv->up_item, _("Move to Workspace _Up"));
-  set_item_stock (priv->up_item, NULL);
 
   priv->down_item = make_menu_item (DOWN);
   gtk_menu_shell_append (GTK_MENU_SHELL (menu),
                          priv->down_item);
   set_item_text (priv->down_item, _("Move to Workspace _Down"));
-  set_item_stock (priv->down_item, NULL);
 
   priv->workspace_item = gtk_menu_item_new_with_mnemonic (_("Move to Another _Workspace"));
   gtk_widget_show (priv->workspace_item);
@@ -1100,7 +1060,6 @@ wnck_action_menu_constructor (GType                  type,
                          priv->close_item);
 
   set_item_text (priv->close_item, _("_Close"));
-  set_item_stock (priv->close_item, WNCK_STOCK_DELETE);
 
   g_signal_connect_object (G_OBJECT (priv->window),
                            "state_changed",


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]