[clutter/text-selection-color: 5/5] test-text-field: Animate opacity



commit be740cbbe6ccce5d1f048d3eeaef8c544c08c649
Author: Emmanuele Bassi <ebassi linux intel com>
Date:   Fri May 13 14:35:03 2011 +0100

    test-text-field: Animate opacity

 tests/interactive/test-text-field.c |   24 ++++++++++++++++--------
 1 files changed, 16 insertions(+), 8 deletions(-)
---
diff --git a/tests/interactive/test-text-field.c b/tests/interactive/test-text-field.c
index e837a02..f169e32 100644
--- a/tests/interactive/test-text-field.c
+++ b/tests/interactive/test-text-field.c
@@ -14,15 +14,7 @@ on_entry_paint (ClutterActor *actor,
   clutter_actor_box_get_size (&allocation, &width, &height);
 
   cogl_set_source_color4ub (255, 255, 255, 24);
-#if 0
-  /* this spills over to the next actor in the paint cycle, and retains
-   * the same source color
-   */
-  cogl_path_round_rectangle (0, 0, width, height, 4.0, 1.0);
-  cogl_path_stroke ();
-#else
   cogl_rectangle (0, 0, width, height);
-#endif
 }
 
 static void
@@ -263,6 +255,14 @@ create_entry (const ClutterColor *color,
                     G_CALLBACK (on_captured_event),
                     NULL);
 
+  {
+    ClutterAnimation *a;
+
+    a = clutter_actor_animate (retval, CLUTTER_LINEAR, 2500, "opacity", 64, NULL);
+    clutter_timeline_set_loop (clutter_animation_get_timeline (a), TRUE);
+    clutter_timeline_set_auto_reverse (clutter_animation_get_timeline (a), TRUE);
+  }
+
   return retval;
 }
 
@@ -327,6 +327,14 @@ test_text_field_main (gint    argc,
                     "y-expand", FALSE,
                     NULL);
 
+  {
+    ClutterAnimation *a;
+
+    a = clutter_actor_animate (box, CLUTTER_LINEAR, 5000, "opacity", 128, NULL);
+    clutter_timeline_set_loop (clutter_animation_get_timeline (a), TRUE);
+    clutter_timeline_set_auto_reverse (clutter_animation_get_timeline (a), TRUE);
+  }
+
   clutter_actor_grab_key_focus (entry);
   clutter_actor_show (stage);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]