aboutsummaryrefslogtreecommitdiff
path: root/src/indicator-messages.c
diff options
context:
space:
mode:
authorTed Gould <ted@canonical.com>2009-02-13 16:12:56 -0600
committerTed Gould <ted@canonical.com>2009-02-13 16:12:56 -0600
commitb63bf8103240f06e05ed99024d4ff24bbc08b725 (patch)
treefe810a905ff7a3d621f9c3717de81b0f857ef4dc /src/indicator-messages.c
parentdf2dfb8762356add2ac100cd23988811c273c92e (diff)
downloadayatana-indicator-messages-b63bf8103240f06e05ed99024d4ff24bbc08b725.tar.gz
ayatana-indicator-messages-b63bf8103240f06e05ed99024d4ff24bbc08b725.tar.bz2
ayatana-indicator-messages-b63bf8103240f06e05ed99024d4ff24bbc08b725.zip
Making the image global, and changing it based on how many IMs we have.
Diffstat (limited to 'src/indicator-messages.c')
-rw-r--r--src/indicator-messages.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/indicator-messages.c b/src/indicator-messages.c
index 94f1421..20417e6 100644
--- a/src/indicator-messages.c
+++ b/src/indicator-messages.c
@@ -30,6 +30,7 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
static IndicateListener * listener;
static GList * imList;
static GHashTable * serverHash;
+static GtkWidget * main_image;
typedef struct _imList_t imList_t;
struct _imList_t {
@@ -154,6 +155,10 @@ subtype_cb (IndicateListener * listener, IndicateListenerServer * server, Indica
gtk_menu_shell_prepend(menushell, GTK_WIDGET(menuitem));
}
+ if (g_list_length(imList) != 0) {
+ gtk_image_set_from_icon_name(main_image, "indicator-messages-new", GTK_ICON_SIZE_MENU);
+ }
+
return;
}
@@ -211,6 +216,10 @@ indicator_removed (IndicateListener * listener, IndicateListenerServer * server,
g_warning("We were asked to remove %s %d but we didn't.", (gchar*)server, (guint)indicator);
}
+ if (g_list_length(imList) == 0) {
+ gtk_image_set_from_icon_name(main_image, "indicator-messages", GTK_ICON_SIZE_MENU);
+ }
+
return;
}
@@ -225,7 +234,7 @@ get_menu_item (void)
GtkWidget * mainmenu = gtk_menu_item_new();
- GtkWidget * image = gtk_image_new_from_icon_name("indicator-messages", GTK_ICON_SIZE_MENU);
+ main_image = gtk_image_new_from_icon_name("indicator-messages", GTK_ICON_SIZE_MENU);
gtk_widget_show(image);
gtk_container_add(GTK_CONTAINER(mainmenu), image);