summaryrefslogtreecommitdiff
path: root/plugins/systray/systray.c
diff options
context:
space:
mode:
authorNick Schermer <nick@xfce.org>2010-12-28 16:20:21 +0100
committerNick Schermer <nick@xfce.org>2010-12-28 17:01:45 +0100
commit750acf1cdabe2eed13c346a713adb5d46c47a4f1 (patch)
treebf8fec5ba3eb7d9db5f6697558016e1d670e9352 /plugins/systray/systray.c
parentc8bdf2b20efc0447ca7074e969ea1bc11582e72e (diff)
downloadxfce4-panel-750acf1cdabe2eed13c346a713adb5d46c47a4f1.tar.gz
Use xfce_panel_pixbuf_from_source() to load known apps.
Diffstat (limited to 'plugins/systray/systray.c')
-rw-r--r--plugins/systray/systray.c37
1 files changed, 4 insertions, 33 deletions
diff --git a/plugins/systray/systray.c b/plugins/systray/systray.c
index 7629f472..c179f7b3 100644
--- a/plugins/systray/systray.c
+++ b/plugins/systray/systray.c
@@ -865,36 +865,6 @@ systray_plugin_dialog_camel_case (const gchar *text)
-static GdkPixbuf *
-systray_plugin_dialog_icon (GtkIconTheme *icon_theme,
- const gchar *icon_name)
-{
- GdkPixbuf *icon = NULL;
- gchar *first_occ;
- const gchar *p;
-
- panel_return_val_if_fail (!exo_str_is_empty (icon_name), NULL);
- panel_return_val_if_fail (GTK_IS_ICON_THEME (icon_theme), NULL);
-
- /* try to load the icon from the theme */
- icon = gtk_icon_theme_load_icon (icon_theme, icon_name, ICON_SIZE, 0, NULL);
- if (icon != NULL)
- return icon;
-
- /* try the first part when the name contains a space */
- p = g_utf8_strchr (icon_name, -1, ' ');
- if (p != NULL)
- {
- first_occ = g_strndup (icon_name, p - icon_name);
- icon = gtk_icon_theme_load_icon (icon_theme, first_occ, ICON_SIZE, 0, NULL);
- g_free (first_occ);
- }
-
- return icon;
-}
-
-
-
static void
systray_plugin_dialog_add_application_names (gpointer key,
gpointer value,
@@ -903,7 +873,6 @@ systray_plugin_dialog_add_application_names (gpointer key,
GtkListStore *store = GTK_LIST_STORE (user_data);
const gchar *name = key;
gboolean hidden = GPOINTER_TO_UINT (value);
- GtkIconTheme *icon_theme;
const gchar *title = NULL;
gchar *camelcase = NULL;
const gchar *icon_name = name;
@@ -937,8 +906,10 @@ systray_plugin_dialog_add_application_names (gpointer key,
}
/* try to load the icon name */
- icon_theme = gtk_icon_theme_get_default ();
- pixbuf = systray_plugin_dialog_icon (icon_theme, icon_name);
+ if (G_LIKELY (icon_name != NULL))
+ pixbuf = xfce_panel_pixbuf_from_source (icon_name, NULL, ICON_SIZE);
+ else
+ pixbuf = NULL;
/* insert in the store */
gtk_list_store_append (store, &iter);