diff options
author | Ted Gould <ted@canonical.com> | 2009-08-26 10:13:08 -0500 |
---|---|---|
committer | Ted Gould <ted@canonical.com> | 2009-08-26 10:13:08 -0500 |
commit | 7c407863390dbe97bccad51a52baf3ffc65d213b (patch) | |
tree | a9fac07424f8370ae92451242beda7026078e904 /src | |
parent | 91fa6c67e8720123c2d81ac8aac0ef5aa4ac97e8 (diff) | |
download | ayatana-indicator-messages-7c407863390dbe97bccad51a52baf3ffc65d213b.tar.gz ayatana-indicator-messages-7c407863390dbe97bccad51a52baf3ffc65d213b.tar.bz2 ayatana-indicator-messages-7c407863390dbe97bccad51a52baf3ffc65d213b.zip |
Oh, wow, now there's some flesh on these. Let's hide and show icons.
Diffstat (limited to 'src')
-rw-r--r-- | src/indicator-messages.c | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/src/indicator-messages.c b/src/indicator-messages.c index 87fd77e..ef77c28 100644 --- a/src/indicator-messages.c +++ b/src/indicator-messages.c @@ -43,13 +43,23 @@ static DBusGProxy * icon_proxy = NULL; static void attention_changed_cb (DBusGProxy * proxy, gboolean dot, gpointer userdata) { - + if (dot) { + gtk_image_set_from_icon_name(GTK_IMAGE(main_image), "indicator-messages-new", DESIGN_TEAM_SIZE); + } else { + gtk_image_set_from_icon_name(GTK_IMAGE(main_image), "indicator-messages", DESIGN_TEAM_SIZE); + } + return; } static void icon_changed_cb (DBusGProxy * proxy, gboolean hidden, gpointer userdata) { - + if (hidden) { + gtk_widget_hide(main_image); + } else { + gtk_widget_show(main_image); + } + return; } static void @@ -65,15 +75,25 @@ watch_cb (DBusGProxy * proxy, GError * error, gpointer userdata) static void attention_cb (DBusGProxy * proxy, gboolean dot, GError * error, gpointer userdata) { + if (error != NULL) { + g_warning("Unable to get attention status: %s", error->message); + g_error_free(error); + return; + } - return; + return attention_changed_cb(proxy, dot, userdata); } static void icon_cb (DBusGProxy * proxy, gboolean hidden, GError * error, gpointer userdata) { + if (error != NULL) { + g_warning("Unable to get icon visibility: %s", error->message); + g_error_free(error); + return; + } - return; + return icon_changed_cb(proxy, hidden, userdata); } static gboolean |