summaryrefslogtreecommitdiff
path: root/liszt/contact-view.c
diff options
context:
space:
mode:
Diffstat (limited to 'liszt/contact-view.c')
-rw-r--r--liszt/contact-view.c48
1 files changed, 47 insertions, 1 deletions
diff --git a/liszt/contact-view.c b/liszt/contact-view.c
index 968027910..21ed0fd38 100644
--- a/liszt/contact-view.c
+++ b/liszt/contact-view.c
@@ -475,6 +475,48 @@ lol_contact_view_new (void)
NULL);
}
+static gboolean
+selected_timeout_add (gpointer data)
+{
+ LolContactView *self = data;
+ LolContactViewPrivate *priv = self->priv;
+ gfloat to_add = 3.2;
+ gfloat height;
+
+ height = clutter_actor_get_height (priv->actions) + to_add;
+
+ clutter_actor_set_height (priv->actions, height);
+
+ if (height >= 32.0)
+ return FALSE;
+
+ return TRUE;
+}
+
+static gboolean
+selected_timeout_subtract (gpointer data)
+{
+ LolContactView *self = data;
+ LolContactViewPrivate *priv = self->priv;
+ gfloat to_sub = 3.2;
+ gfloat height;
+
+ height = clutter_actor_get_height (priv->actions) - to_sub;
+
+ if (height <= 0)
+ height = 0.0;
+
+ clutter_actor_set_height (priv->actions, height);
+
+ if (height == 0.0)
+ {
+ clutter_actor_hide (priv->actions);
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
void
lol_contact_view_toggle_selected (LolContactView *self)
{
@@ -490,12 +532,16 @@ lol_contact_view_toggle_selected (LolContactView *self)
clutter_box_set_color (CLUTTER_BOX (self), &blue);
clutter_actor_show (priv->actions);
clutter_text_set_color (CLUTTER_TEXT (priv->name_text), &white);
+
+ clutter_actor_set_height (priv->actions, 0);
+ g_timeout_add (10, selected_timeout_add, self);
}
else
{
clutter_box_set_color (CLUTTER_BOX (self), &white);
- clutter_actor_hide (priv->actions);
clutter_text_set_color (CLUTTER_TEXT (priv->name_text), &black);
+
+ g_timeout_add (10, selected_timeout_subtract, self);
}
g_signal_emit (self, signals[SELECTED], 0, priv->selected);