[glide] Totally awesome panel animation
- From: Robert Carr <racarr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glide] Totally awesome panel animation
- Date: Thu, 29 Apr 2010 08:40:56 +0000 (UTC)
commit ebf6d9bb62c421841cf23944083d151b8ce73841
Author: Robert Carr <racarr Valentine localdomain>
Date: Thu Apr 29 01:14:25 2010 -0400
Totally awesome panel animation
src/glide-animation-manager.c | 1 +
src/glide-vala-animations.vala | 84 ++++++++++++++++++++++++++++++++++++++++
2 files changed, 85 insertions(+), 0 deletions(-)
---
diff --git a/src/glide-animation-manager.c b/src/glide-animation-manager.c
index c0ac2a9..a0c675b 100644
--- a/src/glide-animation-manager.c
+++ b/src/glide-animation-manager.c
@@ -304,6 +304,7 @@ glide_animation_manager_register_animations ()
glide_animation_manager_register_animation ((GlideAnimationCallback)glide_animate_pivot, (GlideAnimationListOptionsCallback)glide_animate_pivot_list_options, "Pivot");
glide_animation_manager_register_animation ((GlideAnimationCallback)glide_animate_slide, (GlideAnimationListOptionsCallback)glide_animate_slide_list_options, "Slide");
glide_animation_manager_register_animation ((GlideAnimationCallback)glide_animate_zoom, (GlideAnimationListOptionsCallback)glide_animate_zoom_list_options, "Zoom");
+ glide_animation_manager_register_animation ((GlideAnimationCallback)glide_animate_panel, (GlideAnimationListOptionsCallback)glide_animate_panel_list_options, "Panel");
glide_animation_manager_register_animation (glide_animations_animate_doorway, NULL, "Doorway");
}
diff --git a/src/glide-vala-animations.vala b/src/glide-vala-animations.vala
index 625eeb1..185fa97 100644
--- a/src/glide-vala-animations.vala
+++ b/src/glide-vala-animations.vala
@@ -223,4 +223,88 @@ namespace Glide {
return timeline;
}
+
+ public static
+ GLib.List animate_panel_list_options ()
+ {
+ var ret = new GLib.List<string> ();
+
+ ret.append("Up");
+ ret.append("Down");
+ ret.append("Left");
+ ret.append("Right");
+
+ return ret;
+ }
+
+ public static
+ Clutter.Timeline animate_panel (AnimationInfo info,
+ Clutter.Actor a,
+ Clutter.Actor b)
+ {
+ var timeline = new Clutter.Timeline (info.duration);
+ var animator = new Clutter.Animator ();
+ string property;
+ float pos;
+
+
+ animator.timeline = timeline;
+ b.show_all ();
+
+ switch (info.option)
+ {
+ case "Up":
+ pos = a.height;
+ property = "y";
+ break;
+ case "Down":
+ pos =-a.height;
+ property = "y";
+ break;
+ case "Left":
+ pos = a.width;
+ property = "x";
+ break;
+ case "Right":
+ pos = -a.width;
+ property = "x";
+ break;
+ default:
+ pos = a.width;
+ property = "x";
+ break;
+ }
+
+ b.set_property (property, pos);
+ b.set_scale_full (0.8, 0.8, a.width/2, a.height/2);
+ a.set_property ("scale_center_x", a.width/2);
+ a.set_property ("scale_center_y", a.height/2);
+ animator.set (a, "scale_x", Clutter.AnimationMode.EASE_IN_OUT_SINE, 0.25, 0.8f, a,
+ "scale_y", Clutter.AnimationMode.EASE_IN_OUT_SINE, 0.25, 0.8f);
+ animator.set (a, property, Clutter.AnimationMode.EASE_IN_OUT_SINE, 0.25f, 0.0f);
+ animator.set (b, property, Clutter.AnimationMode.EASE_IN_OUT_SINE, 0.25f, pos);
+ animator.set (a, property, Clutter.AnimationMode.EASE_IN_OUT_SINE, 0.75, -pos);
+ animator.set (b, property, Clutter.AnimationMode.EASE_IN_OUT_SINE, 0.75, 0.0f);
+ animator.set (b, "scale_x", Clutter.AnimationMode.EASE_IN_OUT_SINE, 0.75, 0.8f, b,
+ "scale_y", Clutter.AnimationMode.EASE_IN_OUT_SINE, 0.75, 0.8f);
+ animator.set (a, "scale_x", Clutter.AnimationMode.EASE_IN_OUT_SINE, 0.75, 0.8f, a,
+ "scale_y", Clutter.AnimationMode.EASE_IN_OUT_SINE, 0.75, 0.8f);
+ animator.set (b, "scale_x", Clutter.AnimationMode.EASE_IN_OUT_SINE, 1.0, 1.0f, b,
+ "scale_y", Clutter.AnimationMode.EASE_IN_OUT_SINE, 1.0, 1.0f);
+ animator.set (a, "scale_x", Clutter.AnimationMode.EASE_IN_OUT_SINE, 1.0, 1.0f, a,
+ "scale_y", Clutter.AnimationMode.EASE_IN_OUT_SINE, 1.0, 1.0f);
+
+
+ timeline.completed.connect ((m) => {
+ a.hide_all();
+ a.x = a.y = 0;
+ // BUG: Otherwise vala leaks us.
+ animator.timeline = null;
+ });
+ timeline.start();
+
+ return timeline;
+ }
+
+
}
\ No newline at end of file
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]