[ease] Connect the inspector's duration spin button to the slide's transition duration.



commit ee9947a66beb3b826458f0f5928887be557c7389
Author: Nate Stedman <natesm gmail com>
Date:   Sun May 23 16:07:21 2010 -0400

    Connect the inspector's duration spin button to the slide's transition duration.

 src/EditorWindow.vala   |    1 +
 src/TransitionPane.vala |   25 ++++++++++++++++++++-----
 2 files changed, 21 insertions(+), 5 deletions(-)
---
diff --git a/src/EditorWindow.vala b/src/EditorWindow.vala
index af83ad4..b443951 100644
--- a/src/EditorWindow.vala
+++ b/src/EditorWindow.vala
@@ -236,6 +236,7 @@ public class Ease.EditorWindow : Gtk.Window
 		if (slide.variant != "" && slide.variant != null)
 		{
 			pane_transition.variant.set_active(Transitions.get_variant_id(slide.transition, slide.variant));
+			pane_transition.slide = slide;
 		}
 		
 		embed.set_slide(slide);
diff --git a/src/TransitionPane.vala b/src/TransitionPane.vala
index cdfda95..b3cdf36 100644
--- a/src/TransitionPane.vala
+++ b/src/TransitionPane.vala
@@ -22,13 +22,24 @@
 public class Ease.TransitionPane : Gtk.VBox
 {
 	public Gtk.ComboBox effect { get; set; }
-	public Gtk.SpinButton duration { get; set; }
+	public Gtk.SpinButton transition_time { get; set; }
 	public Gtk.ComboBox variant { get; set; }
 	public Gtk.Alignment variant_align { get; set; }
 	public Gtk.Label variant_label { get; set; }
 	public Gtk.ComboBox start_transition { get; set; }
 	public Gtk.SpinButton delay { get; set; }
 	public GtkClutter.Embed preview;
+	
+	
+	private Slide slide_priv;
+	public Slide slide
+	{
+		get { return slide_priv; }
+		set {
+			slide_priv = value;
+			transition_time.set_value(value.transition_time);
+		}
+	}
 
 	public TransitionPane()
 	{
@@ -64,19 +75,23 @@ public class Ease.TransitionPane : Gtk.VBox
 		vbox.pack_start(align, false, false, 0);
 		hbox.pack_start(vbox, true, true, 5);
 		
-		// transition duration
+		// transition transition_time
 		vbox = new Gtk.VBox(false, 0);
 		align = new Gtk.Alignment(0, 0, 0, 0);
 		align.add(new Gtk.Label("Duration"));
 		vbox.pack_start(align, false, false, 0);
-		duration = new Gtk.SpinButton.with_range(0, 10, 0.25);
-		duration.digits = 2;
+		transition_time = new Gtk.SpinButton.with_range(0, 10, 0.25);
+		transition_time.digits = 2;
 		align = new Gtk.Alignment(0, 0.5f, 1, 1);
-		align.add(duration);
+		align.add(transition_time);
 		vbox.pack_start(align, true, true, 0);
 		hbox.pack_start(vbox, false, false, 5);
 		pack_start(hbox, false, false, 5);
 		
+		transition_time.value_changed.connect(() => {
+			slide.transition_time = transition_time.get_value();
+		});
+		
 		// transition variant
 		hbox = new Gtk.HBox(false, 0);
 		vbox = new Gtk.VBox(false, 0);



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