[gnome-taquin] Change transition on large windows.
- From: Arnaud B. <arnaudb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-taquin] Change transition on large windows.
- Date: Thu, 30 Jan 2020 15:17:31 +0000 (UTC)
commit 3dc7eeef59a5982e270bda3bc59ff8e482a8e2a0
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date: Thu Jan 30 16:12:30 2020 +0100
Change transition on large windows.
src/game-view.vala | 3 ++-
src/game-window.vala | 17 ++++++++++++++++-
2 files changed, 18 insertions(+), 2 deletions(-)
---
diff --git a/src/game-view.vala b/src/game-view.vala
index 5775aa3..17218f0 100644
--- a/src/game-view.vala
+++ b/src/game-view.vala
@@ -80,7 +80,8 @@ private class GameView : BaseView, AdaptativeWidget
game_box.show ();
game_box.get_style_context ().add_class ("game-box");
- game_stack.add (game_box);
+ // for the new-game-screen-to-game animation, it is probably better to have the game under
("uncovered")
+ game_stack.add_with_properties (game_box, "position", 0);
content.can_focus = true;
}
diff --git a/src/game-window.vala b/src/game-window.vala
index 58e8133..105e6af 100644
--- a/src/game-window.vala
+++ b/src/game-window.vala
@@ -87,6 +87,18 @@ private class GameWindow : BaseWindow, AdaptativeWidget
show_new_game_screen ();
}
+ /*\
+ * * adaptative stuff
+ \*/
+
+ private bool is_quite_thin = false;
+ protected override void set_window_size (AdaptativeWidget.WindowSize new_size)
+ {
+ base.set_window_size (new_size);
+
+ is_quite_thin = AdaptativeWidget.WindowSize.is_quite_thin (new_size);
+ }
+
/*\
* * some public calls
\*/
@@ -290,7 +302,10 @@ private class GameWindow : BaseWindow, AdaptativeWidget
undo_action.set_enabled (false);
redo_action.set_enabled (false);
- game_view.configure_transition (StackTransitionType.SLIDE_DOWN, 1000);
+ if (is_quite_thin)
+ game_view.configure_transition (StackTransitionType.SLIDE_DOWN, 1000);
+ else
+ game_view.configure_transition (StackTransitionType.OVER_DOWN_UP, 1000);
play (); // FIXME lag (see in Taquin…)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]