aboutsummaryrefslogtreecommitdiff
path: root/src/app-indicator.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/app-indicator.c')
-rw-r--r--src/app-indicator.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/app-indicator.c b/src/app-indicator.c
index 21276c6..7b5e0f2 100644
--- a/src/app-indicator.c
+++ b/src/app-indicator.c
@@ -1523,10 +1523,19 @@ status_icon_changes (AppIndicator * self, gpointer data)
GtkStatusIcon * icon = GTK_STATUS_ICON(data);
gchar *longname = NULL;
+ GtkIconTheme *icon_theme;
+ if (self->priv->icon_theme_path != NULL)
+ {
+ icon_theme = gtk_icon_theme_new();
+ gtk_icon_theme_prepend_search_path(icon_theme, self->priv->icon_theme_path);
+ } else {
+ icon_theme = gtk_icon_theme_get_default();
+ }
+
switch (app_indicator_get_status(self)) {
case APP_INDICATOR_STATUS_PASSIVE:
longname = append_panel_icon_suffix(app_indicator_get_icon(self));
- if (gtk_icon_theme_has_icon (gtk_icon_theme_get_default(), longname))
+ if (gtk_icon_theme_has_icon (icon_theme, longname))
gtk_status_icon_set_from_icon_name(icon, longname);
else
gtk_status_icon_set_from_icon_name(icon, app_indicator_get_icon(self));
@@ -1534,7 +1543,7 @@ status_icon_changes (AppIndicator * self, gpointer data)
break;
case APP_INDICATOR_STATUS_ACTIVE:
longname = append_panel_icon_suffix(app_indicator_get_icon(self));
- if (gtk_icon_theme_has_icon (gtk_icon_theme_get_default(), longname))
+ if (gtk_icon_theme_has_icon (icon_theme, longname))
gtk_status_icon_set_from_icon_name(icon, longname);
else
gtk_status_icon_set_from_icon_name(icon, app_indicator_get_icon(self));
@@ -1543,7 +1552,7 @@ status_icon_changes (AppIndicator * self, gpointer data)
case APP_INDICATOR_STATUS_ATTENTION:
/* get the _attention_ icon here */
longname = append_panel_icon_suffix(app_indicator_get_attention_icon(self));
- if (gtk_icon_theme_has_icon (gtk_icon_theme_get_default(), longname))
+ if (gtk_icon_theme_has_icon (icon_theme, longname))
gtk_status_icon_set_from_icon_name(icon, longname);
else
gtk_status_icon_set_from_icon_name(icon, app_indicator_get_icon(self));
@@ -1554,6 +1563,9 @@ status_icon_changes (AppIndicator * self, gpointer data)
if (longname) {
g_free(longname);
}
+ if (icon_theme != gtk_icon_theme_get_default()) {
+ g_object_unref(icon_theme);
+ }
return;
}