test-drag: Add desaturation effect

Use a desaturation effect on the drag handle.
This commit is contained in:
Emmanuele Bassi 2010-06-03 15:20:17 +01:00
parent 582f2ced5f
commit 781a413362

View File

@ -32,7 +32,10 @@ on_drag_begin (ClutterDragAction *action,
clutter_drag_action_set_drag_handle (action, drag_handle); 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 static void
@ -68,14 +71,14 @@ on_drag_end (ClutterDragAction *action,
&real_y); &real_y);
clutter_actor_animate (actor, CLUTTER_EASE_OUT_CUBIC, 150, clutter_actor_animate (actor, CLUTTER_EASE_OUT_CUBIC, 150,
"opacity", 255, "@effects.disable.factor", 0.0,
"x", real_x, "x", real_x,
"y", real_y, "y", real_y,
NULL); NULL);
} }
else else
clutter_actor_animate (actor, CLUTTER_LINEAR, 150, clutter_actor_animate (actor, CLUTTER_LINEAR, 150,
"opacity", 255, "@effects.disable.factor", 0.0,
NULL); NULL);
} }
@ -165,6 +168,8 @@ test_drag_main (int argc, char *argv[])
clutter_actor_add_action (handle, action); 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_actor_show (stage);
clutter_main (); clutter_main ();