aboutsummaryrefslogtreecommitdiff
path: root/src/user-widget.c
diff options
context:
space:
mode:
authorConor Curran <conor.curran@canonical.com>2011-08-17 13:48:51 +0100
committerConor Curran <conor.curran@canonical.com>2011-08-17 13:48:51 +0100
commit25abede4d0251f965b5f8b879d26c86129a11453 (patch)
tree348ff4bb5a71dd1899593c73f67f329f373bb47e /src/user-widget.c
parentfb32494de9b55663cec088ade6967da349c0cac7 (diff)
downloadayatana-indicator-session-25abede4d0251f965b5f8b879d26c86129a11453.tar.gz
ayatana-indicator-session-25abede4d0251f965b5f8b879d26c86129a11453.tar.bz2
ayatana-indicator-session-25abede4d0251f965b5f8b879d26c86129a11453.zip
put guest item in place and fixed ticked icon on user menu
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);