Index: panel/icons.c =================================================================== RCS file: /var/cvs/xfce/xfce4/xfce4-panel/panel/icons.c,v retrieving revision 1.23 diff -u -u -r1.23 icons.c --- panel/icons.c 6 Dec 2003 15:26:02 -0000 1.23 +++ panel/icons.c 25 Feb 2004 18:33:13 -0000 @@ -22,6 +22,7 @@ #endif #include +#include #include "xfce.h" #include "icons/xfce4-panel-icon.h" @@ -30,6 +31,7 @@ #define gdk_pixbuf_new_from_inline gdk_pixbuf_new_from_stream #endif +static GtkIconTheme *icon_theme = NULL; const char *icon_names[NUM_ICONS]; /* icon themes */ @@ -89,6 +91,9 @@ icons_init (void) { set_icon_names (); + + icon_theme = gtk_icon_theme_get_default (); + gtk_icon_theme_prepend_search_path (icon_theme, DATADIR "/themes"); } GdkPixbuf * @@ -97,7 +102,7 @@ if (id < UNKNOWN_ICON || id >= NUM_ICONS) id = UNKNOWN_ICON; - return get_themed_pixbuf (xfce_icon_names[id]); + return gtk_icon_theme_load_icon (icon_theme, xfce_icon_names[id], 48, 0, NULL); } GdkPixbuf * @@ -137,7 +142,7 @@ if (id < 0 || id >= MINIBUTTONS) return get_pixbuf_by_id (UNKNOWN_ICON); - pb = get_themed_pixbuf (minibutton_names[id]); + pb = gtk_icon_theme_load_icon (icon_theme, minibutton_names[id], 24, 0, NULL); if (!pb) pb = get_pixbuf_by_id (UNKNOWN_ICON); @@ -188,46 +193,19 @@ _get_themed_pixbuf (const char *name, const char *theme) { GdkPixbuf *pb = NULL; - char **icon_paths, **p; - const char *real_theme; - char *path = NULL; - - if (theme) - real_theme = theme; - else - real_theme = DEFAULT_THEME; - - icon_paths = get_theme_dirs (); - - for (p = icon_paths; *p; p++) - { - char **suffix; + gchar *p, *rootname = g_strdup(name); - for (suffix = icon_suffix; *suffix; suffix++) - { - path = - g_strconcat (*p, "/", real_theme, "/", name, ".", *suffix, - NULL); - - if (g_file_test (path, G_FILE_TEST_EXISTS)) - pb = gdk_pixbuf_new_from_file (path, NULL); - - g_free (path); - - if (pb) - break; + if ((p=g_strrstr(rootname, "."))) { + if (strlen(rootname) - (p-rootname) <= 5) + *p = 0; } - if (pb) - break; - } - - g_strfreev (icon_paths); + pb = gtk_icon_theme_load_icon (icon_theme, rootname, 48, 0, NULL); + g_free(rootname); /* prevent race condition when we can't find our fallback icon: * default theme, unknown icon */ - if (!pb && strequal (real_theme, DEFAULT_THEME) && - strequal (name, xfce_icon_names[UNKNOWN_ICON])) + if (!pb && strequal (name, xfce_icon_names[UNKNOWN_ICON])) { g_printerr ("\n** ERROR **: xfce: unable to find any icons! " "Please check your installation.\n\n"); Index: panel/panel.c =================================================================== RCS file: /var/cvs/xfce/xfce4/xfce4-panel/panel/panel.c,v retrieving revision 1.71 diff -u -u -r1.71 panel.c --- panel/panel.c 18 Feb 2004 21:43:46 -0000 1.71 +++ panel/panel.c 25 Feb 2004 18:33:13 -0000 @@ -1137,6 +1137,9 @@ g_free (settings.theme); settings.theme = g_strdup (theme); + gtk_settings_set_string_property (gtk_settings_get_default (), + "gtk-icon-theme-name", theme, "panel.c:1141"); + if (!panel_created) return;