From b1b9134542bd3bcfa6b5492f0a7f1b83cf0ec32f Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 13 Jan 2010 12:25:49 -0600 Subject: Fleshing out the fallback function, so it should create an icon. --- src/libappindicator/app-indicator.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/libappindicator/app-indicator.c b/src/libappindicator/app-indicator.c index 259ba3e..a3ad1ee 100644 --- a/src/libappindicator/app-indicator.c +++ b/src/libappindicator/app-indicator.c @@ -739,6 +739,24 @@ fallback_timer_expire (gpointer data) static GtkStatusIcon * fallback (AppIndicator * self) { + GtkStatusIcon * icon = gtk_status_icon_new(); + + gtk_status_icon_set_title(icon, app_indicator_get_id(self)); + + switch (app_indicator_get_status(self)) { + case APP_INDICATOR_STATUS_PASSIVE: + gtk_status_icon_set_visible(icon, FALSE); + gtk_status_icon_set_from_icon_name(icon, app_indicator_get_icon(self)); + break; + case APP_INDICATOR_STATUS_ACTIVE: + gtk_status_icon_set_from_icon_name(icon, app_indicator_get_icon(self)); + gtk_status_icon_set_visible(icon, TRUE); + break; + case APP_INDICATOR_STATUS_ATTENTION: + gtk_status_icon_set_from_icon_name(icon, app_indicator_get_attention_icon(self)); + gtk_status_icon_set_visible(icon, TRUE); + break; + }; return NULL; } @@ -748,7 +766,7 @@ fallback (AppIndicator * self) static void unfallback (AppIndicator * self, GtkStatusIcon * status_icon) { - + g_object_unref(G_OBJECT(status_icon)); return; } -- cgit v1.2.3