aboutsummaryrefslogtreecommitdiff
path: root/src/user-widget.c
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2012-06-12 00:07:34 -0500
committerCharles Kerr <charles.kerr@canonical.com>2012-06-12 00:07:34 -0500
commitf7f945beb6353195c84d5d897a20fcc26d243058 (patch)
tree2ab60a3b2c584c91b923d737aa37f4f8b0aa516a /src/user-widget.c
parentd95d729276b77016d07a04f75efdb5ba7b352b96 (diff)
downloadayatana-indicator-session-f7f945beb6353195c84d5d897a20fcc26d243058.tar.gz
ayatana-indicator-session-f7f945beb6353195c84d5d897a20fcc26d243058.tar.bz2
ayatana-indicator-session-f7f945beb6353195c84d5d897a20fcc26d243058.zip
properly respond to changes in the menuitem's USER_ITEM_PROP_LOGGED_IN property
Diffstat (limited to 'src/user-widget.c')
-rw-r--r--src/user-widget.c33
1 files changed, 16 insertions, 17 deletions
diff --git a/src/user-widget.c b/src/user-widget.c
index 8ba25ca..f886660 100644
--- a/src/user-widget.c
+++ b/src/user-widget.c
@@ -65,12 +65,6 @@ static void user_widget_set_twin_item (UserWidget* self,
// keyevent consumers
static gboolean user_widget_button_release_event (GtkWidget *menuitem,
GdkEventButton *event);
-// Dbusmenuitem properties update callback
-static void user_widget_property_update (DbusmenuMenuitem* item,
- gchar* property,
- GVariant* value,
- gpointer userdata);
-
static void _color_shade (const CairoColorRGB *a,
float k,
@@ -484,7 +478,7 @@ _color_hls_to_rgb (gdouble *h,
}
}
-void
+static void
_color_shade (const CairoColorRGB *a, float k, CairoColorRGB *b)
{
double red;
@@ -535,20 +529,25 @@ user_widget_button_release_event (GtkWidget *menuitem,
return FALSE;
}
-
-/**
- * TODO, be sensitive to UI updates
- * */
static void
-user_widget_property_update (DbusmenuMenuitem* item, gchar* property,
- GVariant* value, gpointer userdata)
+user_widget_property_update (DbusmenuMenuitem * item,
+ const gchar * property,
+ GVariant * value,
+ UserWidget * self)
{
- g_return_if_fail (IS_USER_WIDGET (userdata));
- //gtk_widget_queue_redraw (GTK_WIDGET(userdata));
-}
-
+ g_return_if_fail (IS_USER_WIDGET (self));
+ UserWidgetPrivate* priv = USER_WIDGET_GET_PRIVATE(self);
+ if (!g_strcmp0 (property, USER_ITEM_PROP_LOGGED_IN))
+ {
+ gtk_widget_set_visible (priv->tick_icon, g_variant_get_boolean(value));
+ }
+ else
+ {
+ g_debug ("%s FIXME: unhandled property change %s", G_STRFUNC, property);
+ }
+}
static void
user_widget_set_twin_item (UserWidget* self,