aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2011-09-30 16:44:39 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2011-09-30 16:44:39 +0200
commit4aca6f60949a7c707f33fa6f39257613b7d6d5d5 (patch)
tree620cf2161b84da0669e7a008b8267a4fba19a4a3 /src
parentf476076f2bc74a408f135895c9a6d7f96329bac0 (diff)
downloadlibayatana-appindicator-4aca6f60949a7c707f33fa6f39257613b7d6d5d5.tar.gz
libayatana-appindicator-4aca6f60949a7c707f33fa6f39257613b7d6d5d5.tar.bz2
libayatana-appindicator-4aca6f60949a7c707f33fa6f39257613b7d6d5d5.zip
src/app-indicator.c: honor icon_theme_path in the fallback
Diffstat (limited to 'src')
-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;
}