[cheese] Fix crash when animating countdown
- From: David King <davidk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [cheese] Fix crash when animating countdown
- Date: Tue, 9 Sep 2014 15:53:51 +0000 (UTC)
commit 6efd4960cfc57bea26fb7d169a5f600164f0bfd9
Author: David King <amigadave amigadave com>
Date: Tue Sep 9 16:50:09 2014 +0100
Fix crash when animating countdown
https://bugzilla.gnome.org/show_bug.cgi?id=735285
src/cheese-countdown.vala | 16 ++++++++--------
1 files changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/src/cheese-countdown.vala b/src/cheese-countdown.vala
index d8f4e4f..736b0ee 100644
--- a/src/cheese-countdown.vala
+++ b/src/cheese-countdown.vala
@@ -24,6 +24,8 @@ internal class Cheese.Countdown : GLib.Object
public delegate void CountdownCallback ();
private Clutter.Text countdown_actor;
private unowned CountdownCallback completed_callback;
+ private Clutter.PropertyTransition pulse_in;
+ private Clutter.PropertyTransition pulse_out;
private int current_value = 0;
private GLib.Settings settings;
public bool running;
@@ -46,14 +48,13 @@ internal class Cheese.Countdown : GLib.Object
*/
private void fade_out ()
{
- var pulse_out = new Clutter.PropertyTransition ("opacity");
+ pulse_out = new Clutter.PropertyTransition ("opacity");
pulse_out.set_duration (500);
pulse_out.set_from_value (255);
pulse_out.set_to_value (0);
- pulse_out.remove_on_complete = true;
pulse_out.completed.connect (fade_in);
-
- this.countdown_actor.add_transition ("pulse-out", pulse_out);
+ pulse_out.animatable = countdown_actor;
+ pulse_out.start ();
}
/**
@@ -72,14 +73,13 @@ internal class Cheese.Countdown : GLib.Object
this.countdown_actor.text = this.current_value.to_string ();
this.current_value--;
- var pulse_in = new Clutter.PropertyTransition ("opacity");
+ pulse_in = new Clutter.PropertyTransition ("opacity");
pulse_in.set_duration (500);
pulse_in.set_from_value (0);
pulse_in.set_to_value (255);
- pulse_in.remove_on_complete = true;
pulse_in.completed.connect (fade_out);
-
- this.countdown_actor.add_transition ("pulse-in", pulse_in);
+ pulse_in.animatable = countdown_actor;
+ pulse_in.start ();
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]