[Xfce4-commits] [xfce/xfce4-panel] 01/01: Launcher: Fix size of menu icons (Bug #13539)

noreply at xfce.org noreply at xfce.org
Sun Apr 30 00:15:23 CEST 2017


This is an automated email from the git hooks/post-receive script.

o   c   h   o   s   i       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository xfce/xfce4-panel.

commit ee7381e4feb1c009c23e8936a351bf07d303d6e3
Author: Simon Steinbeiss <simon.steinbeiss at elfenbeinturm.at>
Date:   Sun Apr 30 00:15:17 2017 +0200

    Launcher: Fix size of menu icons (Bug #13539)
    
    While we get rid of the deprecated GtkImageMenuItem
    here, we also get the useless padding on the left
    which reserves space for radios and checks in menus
    that have those. The one useful feature of
    GtkImageMenuItem (apart from the convenience) was to
    not reserve that space.
---
 plugins/launcher/launcher.c | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/plugins/launcher/launcher.c b/plugins/launcher/launcher.c
index db0e1b5..3998224 100644
--- a/plugins/launcher/launcher.c
+++ b/plugins/launcher/launcher.c
@@ -1537,7 +1537,7 @@ launcher_plugin_menu_construct (LauncherPlugin *plugin)
   GtkArrowType    arrow_type;
   guint           n;
   GarconMenuItem *item;
-  GtkWidget      *mi, *image;
+  GtkWidget      *mi, *box, *label, *image;
   const gchar    *name, *icon_name;
   GSList         *li;
 
@@ -1565,12 +1565,13 @@ launcher_plugin_menu_construct (LauncherPlugin *plugin)
 
       /* create the menu item */
       name = garcon_menu_item_get_name (item);
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-      mi = gtk_image_menu_item_new_with_label (
-          panel_str_is_empty (name) ? _("Unnamed Item") : name);
-G_GNUC_END_IGNORE_DEPRECATIONS
+      mi = gtk_menu_item_new ();
+      label = gtk_label_new (panel_str_is_empty (name) ? _("Unnamed Item") : name);
+      box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
+      gtk_box_pack_end (GTK_BOX (box), label, TRUE, TRUE, 0);
+      gtk_container_add (GTK_CONTAINER (mi), box);
       g_object_set_qdata (G_OBJECT (mi), launcher_plugin_quark, plugin);
-      gtk_widget_show (mi);
+      gtk_widget_show_all (mi);
       gtk_drag_dest_set (mi, GTK_DEST_DEFAULT_ALL, drop_targets,
                          G_N_ELEMENTS (drop_targets), GDK_ACTION_COPY);
       g_signal_connect (G_OBJECT (mi), "activate",
@@ -1599,9 +1600,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS
       if (!panel_str_is_empty (icon_name))
         {
           image = gtk_image_new_from_icon_name (icon_name, GTK_ICON_SIZE_DND);
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-          gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (mi), image);
-G_GNUC_END_IGNORE_DEPRECATIONS
+          gtk_box_pack_start (GTK_BOX (box), image, FALSE, TRUE, 3);
           gtk_widget_show (image);
         }
     }

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list