[gnome-taquin] Configure the transition from GameView.



commit 1975290dbdde1b64cb2ce723419d4a24f9ebcbfb
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date:   Wed Jan 16 21:25:10 2019 +0100

    Configure the transition from GameView.
    
    Let's make GameView handle its own stuff.

 src/game-view.vala   | 7 +++++++
 src/game-window.vala | 9 +++------
 2 files changed, 10 insertions(+), 6 deletions(-)
---
diff --git a/src/game-view.vala b/src/game-view.vala
index 5b1c90f..2f7ef24 100644
--- a/src/game-view.vala
+++ b/src/game-view.vala
@@ -83,4 +83,11 @@ private class GameView : Stack
     {
         return get_visible_child () == game_content;
     }
+
+    internal void configure_transition (StackTransitionType transition_type,
+                                        uint                transition_duration)
+    {
+        set_transition_type (transition_type);
+        set_transition_duration (transition_duration);
+    }
 }
diff --git a/src/game-window.vala b/src/game-window.vala
index f1e8a74..e46bf3b 100644
--- a/src/game-window.vala
+++ b/src/game-window.vala
@@ -203,8 +203,7 @@ private class GameWindow : ApplicationWindow
 
         wait ();
 
-        game_view.set_transition_type (StackTransitionType.SLIDE_LEFT);
-        game_view.set_transition_duration (800);
+        game_view.configure_transition (StackTransitionType.SLIDE_LEFT, 800);
 
         headerbar.new_game ();
         back_action_disabled = false;
@@ -223,8 +222,7 @@ private class GameWindow : ApplicationWindow
 
         play ();        // FIXME lag (see in Taquin…)
 
-        game_view.set_transition_type (StackTransitionType.SLIDE_DOWN);
-        game_view.set_transition_duration (1000);
+        game_view.configure_transition (StackTransitionType.SLIDE_DOWN, 1000);
         show_view ();
     }
 
@@ -236,8 +234,7 @@ private class GameWindow : ApplicationWindow
             return;
 
         // TODO change back headerbar subtitle?
-        game_view.set_transition_type (StackTransitionType.SLIDE_RIGHT);
-        game_view.set_transition_duration (800);
+        game_view.configure_transition (StackTransitionType.SLIDE_RIGHT, 800);
         show_view ();
 
         back ();


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