aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2011-09-30 11:26:17 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2011-09-30 11:26:17 +0200
commit6ecd10fbb57cea400d59ad68da1d0fc602264c4e (patch)
tree62b69cc0492a8617aacb7d0c3a3d790b4baa48b5
parenta0119770c6e87433e7b43ec78fe1b17aaf315d71 (diff)
downloadlibayatana-appindicator-6ecd10fbb57cea400d59ad68da1d0fc602264c4e.tar.gz
libayatana-appindicator-6ecd10fbb57cea400d59ad68da1d0fc602264c4e.tar.bz2
libayatana-appindicator-6ecd10fbb57cea400d59ad68da1d0fc602264c4e.zip
src/app-indicator.c: when using the fallback icon, first check if there is a "-panel" version of the icon available and if not fallback to the indicator one
-rw-r--r--src/app-indicator.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/app-indicator.c b/src/app-indicator.c
index c2f0f69..c9e7ab9 100644
--- a/src/app-indicator.c
+++ b/src/app-indicator.c
@@ -1523,20 +1523,21 @@ status_icon_changes (AppIndicator * self, gpointer data)
GtkStatusIcon * icon = GTK_STATUS_ICON(data);
gchar *longname = NULL;
+ /* set longname only if its actually in the icon theme */
+ longname = append_panel_icon_suffix(app_indicator_get_icon(self));
+ if (gtk_icon_theme_has_icon (gtk_icon_theme_get_default(), longname))
+ gtk_status_icon_set_from_icon_name(icon, longname);
+ else
+ gtk_status_icon_set_from_icon_name(icon, app_indicator_get_icon(self));
+
switch (app_indicator_get_status(self)) {
case APP_INDICATOR_STATUS_PASSIVE:
- longname = append_panel_icon_suffix(app_indicator_get_icon(self));
gtk_status_icon_set_visible(icon, FALSE);
- gtk_status_icon_set_from_icon_name(icon, longname);
break;
case APP_INDICATOR_STATUS_ACTIVE:
- longname = append_panel_icon_suffix(app_indicator_get_icon(self));
- gtk_status_icon_set_from_icon_name(icon, longname);
gtk_status_icon_set_visible(icon, TRUE);
break;
case APP_INDICATOR_STATUS_ATTENTION:
- longname = append_panel_icon_suffix(app_indicator_get_attention_icon(self));
- gtk_status_icon_set_from_icon_name(icon, longname);
gtk_status_icon_set_visible(icon, TRUE);
break;
};