From 85400dc1f4b95227f9160b96e30841e1e90ee60a Mon Sep 17 00:00:00 2001 From: Krzysztof Klimonda Date: Mon, 22 Mar 2010 18:07:32 +0100 Subject: Use app_indicator_get_icon/app_indicator_get_attention_icon methods to get the right icon. --- src/libappindicator/app-indicator.c | 21 ++++++++++++++------- 1 file 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; } -- cgit v1.2.3