[Xfce4-commits] <libxfce4ui:master> Allow icon names in xfce_gtk_button_new_mixed().

Nick Schermer noreply at xfce.org
Tue Feb 23 18:50:01 CET 2010


Updating branch refs/heads/master
         to b09216ac08e1b9619e738c363398396e524c106f (commit)
       from ead1eb96548eeca84eaa15acae6ae9ed3bd0e1a1 (commit)

commit b09216ac08e1b9619e738c363398396e524c106f
Author: Nick Schermer <nick at xfce.org>
Date:   Tue Feb 23 18:46:03 2010 +0100

    Allow icon names in xfce_gtk_button_new_mixed().
    
    Allow creating buttons with icon names too.

 libxfce4ui/xfce-gtk-extensions.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/libxfce4ui/xfce-gtk-extensions.c b/libxfce4ui/xfce-gtk-extensions.c
index 977fa75..8581bfa 100644
--- a/libxfce4ui/xfce-gtk-extensions.c
+++ b/libxfce4ui/xfce-gtk-extensions.c
@@ -66,7 +66,10 @@ xfce_gtk_button_new_mixed (const gchar *stock_id,
       if (stock_id != NULL)
         {
           /* create image widget */
-          image = gtk_image_new_from_stock (stock_id, GTK_ICON_SIZE_BUTTON);
+          if (g_str_has_prefix (stock_id, "gtk-"))
+            image = gtk_image_new_from_stock (stock_id, GTK_ICON_SIZE_BUTTON);
+          else
+            image = gtk_image_new_from_icon_name (stock_id, GTK_ICON_SIZE_BUTTON);
           gtk_button_set_image (GTK_BUTTON (button), image);
         }
     }



More information about the Xfce4-commits mailing list