aboutsummaryrefslogtreecommitdiff
path: root/src/user-widget.c
diff options
context:
space:
mode:
authorKen VanDine <ken.vandine@canonical.com>2011-08-18 14:51:48 -0400
committerKen VanDine <ken.vandine@canonical.com>2011-08-18 14:51:48 -0400
commit92cb2ff94b4efb98437639a7c37fa894efa03556 (patch)
tree1c13f554a5cbf54ac86a0663d1aedb40cd1870fc /src/user-widget.c
parent7d476f1a4e0717678d5b1d86f022948f8959fa57 (diff)
parent7cb790290cb874e06deca13497eed34079b4fb8c (diff)
downloadayatana-indicator-session-92cb2ff94b4efb98437639a7c37fa894efa03556.tar.gz
ayatana-indicator-session-92cb2ff94b4efb98437639a7c37fa894efa03556.tar.bz2
ayatana-indicator-session-92cb2ff94b4efb98437639a7c37fa894efa03556.zip
releasing version 0.3.2-0ubuntu1
Diffstat (limited to 'src/user-widget.c')
-rw-r--r--src/user-widget.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/src/user-widget.c b/src/user-widget.c
index 9b046c5..6495e80 100644
--- a/src/user-widget.c
+++ b/src/user-widget.c
@@ -126,8 +126,6 @@ user_widget_init (UserWidget *self)
priv->user_name = gtk_label_new ("");
priv->container = gtk_hbox_new (FALSE, 0);
- // TODO:
- // Delete tick icon and draw primitively.
priv->tick_icon = gtk_image_new_from_icon_name ("account-logged-in",
GTK_ICON_SIZE_MENU);
gtk_misc_set_alignment(GTK_MISC(priv->tick_icon), 1.0, 0.5);
@@ -151,6 +149,10 @@ user_widget_init (UserWidget *self)
gtk_widget_show_all (priv->container);
gtk_container_add (GTK_CONTAINER (self), priv->container);
+ gtk_widget_show_all (priv->tick_icon);
+ gtk_widget_set_no_show_all (priv->tick_icon, TRUE);
+ gtk_widget_hide (priv->tick_icon);
+
// Fetch the drawing context.
#if GTK_CHECK_VERSION(3, 0, 0)
g_signal_connect_after (GTK_WIDGET(self), "draw",
@@ -178,11 +180,6 @@ user_widget_finalize (GObject *object)
G_OBJECT_CLASS (user_widget_parent_class)->finalize (object);
}
-/**
- * We override the expose method to enable primitive drawing of the
- * empty album art image and rounded rectangles on the album art.
- */
-
#if GTK_CHECK_VERSION(3, 0, 0)
// Draw the radio dot and/or green check mark
@@ -317,11 +314,16 @@ user_widget_set_twin_item (UserWidget* self,
gtk_label_set_label (GTK_LABEL (priv->user_name),
dbusmenu_menuitem_property_get (twin_item, USER_ITEM_PROP_NAME));
- //if (dbusmenu_menuitem_property_get_bool (twin_item, USER_ITEM_PROP_LOGGED_IN)) {
- // gtk_widget_show(priv->tick_icon);
- //} else {
- gtk_widget_show(priv->tick_icon);
- //}
+ if (dbusmenu_menuitem_property_get_bool (twin_item, USER_ITEM_PROP_LOGGED_IN)) {
+ g_debug ("%s USER HAS ACTIVE SESSIONS",
+ dbusmenu_menuitem_property_get (twin_item, USER_ITEM_PROP_NAME));
+ gtk_widget_show(priv->tick_icon);
+ }
+ else {
+ g_debug ("%s USER DOESN'T HAVE ACTIVE SESSIONS",
+ dbusmenu_menuitem_property_get (twin_item, USER_ITEM_PROP_NAME));
+ gtk_widget_hide(priv->tick_icon);
+ }
g_debug("Using user icon for '%s' from file: %s",
dbusmenu_menuitem_property_get(twin_item, USER_ITEM_PROP_NAME), icon_name);