test-drag: Add desaturation effect
authorEmmanuele Bassi <ebassi@linux.intel.com>
Thu, 3 Jun 2010 14:20:17 +0000 (15:20 +0100)
committerEmmanuele Bassi <ebassi@linux.intel.com>
Fri, 4 Jun 2010 09:16:51 +0000 (10:16 +0100)
Use a desaturation effect on the drag handle.

tests/interactive/test-drag.c

index 2aa1d1d..08197c3 100644 (file)
@@ -32,7 +32,10 @@ on_drag_begin (ClutterDragAction   *action,
 
   clutter_drag_action_set_drag_handle (action, drag_handle);
 
-  clutter_actor_set_opacity (actor, 128);
+  /* fully desaturate the actor */
+  clutter_actor_animate (actor, CLUTTER_LINEAR, 150,
+                         "@effects.disable.factor", 1.0,
+                         NULL);
 }
 
 static void
@@ -68,14 +71,14 @@ on_drag_end (ClutterDragAction   *action,
                                            &real_y);
 
       clutter_actor_animate (actor, CLUTTER_EASE_OUT_CUBIC, 150,
-                             "opacity", 255,
+                             "@effects.disable.factor", 0.0,
                              "x", real_x,
                              "y", real_y,
                              NULL);
     }
   else
     clutter_actor_animate (actor, CLUTTER_LINEAR, 150,
-                           "opacity", 255,
+                           "@effects.disable.factor", 0.0,
                            NULL);
 }
 
@@ -165,6 +168,8 @@ test_drag_main (int argc, char *argv[])
 
   clutter_actor_add_action (handle, action);
 
+  clutter_actor_add_effect_with_name (handle, "disable", clutter_desaturate_effect_new (0.0));
+
   clutter_actor_show (stage);
 
   clutter_main ();