aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKrzysztof Klimonda <kklimonda@syntaxhighlighted.com>2010-03-22 18:07:32 +0100
committerKrzysztof Klimonda <kklimonda@syntaxhighlighted.com>2010-03-22 18:07:32 +0100
commit85400dc1f4b95227f9160b96e30841e1e90ee60a (patch)
tree6487b30f2992c8f698555b69c4d7cc88d8250f0f
parentc80fe4d00d01c4498771c79419aa3c54567a1eec (diff)
downloadayatana-indicator-application-85400dc1f4b95227f9160b96e30841e1e90ee60a.tar.gz
ayatana-indicator-application-85400dc1f4b95227f9160b96e30841e1e90ee60a.tar.bz2
ayatana-indicator-application-85400dc1f4b95227f9160b96e30841e1e90ee60a.zip
Use app_indicator_get_icon/app_indicator_get_attention_icon methods to get
the right icon.
-rw-r--r--src/libappindicator/app-indicator.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/libappindicator/app-indicator.c b/src/libappindicator/app-indicator.c
index 43475fb..38f095f 100644
--- a/src/libappindicator/app-indicator.c
+++ b/src/libappindicator/app-indicator.c
@@ -861,26 +861,33 @@ static void
status_icon_changes (AppIndicator * self, gpointer data)
{
GtkStatusIcon * icon = GTK_STATUS_ICON(data);
- GIcon *themed_icon =
- g_themed_icon_new_with_default_fallbacks (self->priv->icon_name);
+ GIcon *themed_icon = NULL;
switch (app_indicator_get_status(self)) {
case APP_INDICATOR_STATUS_PASSIVE:
+ themed_icon =
+ g_themed_icon_new_with_default_fallbacks (app_indicator_get_icon (self));
gtk_status_icon_set_visible(icon, FALSE);
- gtk_status_icon_set_from_gicon(icon, G_ICON (themed_icon));
+ gtk_status_icon_set_from_gicon(icon, themed_icon);
break;
case APP_INDICATOR_STATUS_ACTIVE:
- gtk_status_icon_set_from_gicon(icon, G_ICON (themed_icon));
+ themed_icon =
+ g_themed_icon_new_with_default_fallbacks (app_indicator_get_icon (self));
+ gtk_status_icon_set_from_gicon(icon, themed_icon);
gtk_status_icon_set_visible(icon, TRUE);
break;
case APP_INDICATOR_STATUS_ATTENTION:
- gtk_status_icon_set_from_gicon(icon, G_ICON (themed_icon));
+ themed_icon =
+ g_themed_icon_new_with_default_fallbacks (app_indicator_get_attention_icon (self));
+ gtk_status_icon_set_from_gicon(icon, themed_icon);
gtk_status_icon_set_visible(icon, TRUE);
break;
};
- g_object_ref_sink (themed_icon);
- g_object_unref (themed_icon);
+ if (themed_icon) {
+ g_object_ref_sink (themed_icon);
+ g_object_unref (themed_icon);
+ }
return;
}