[gnome-nibbles/arnaudb/modernize-code: 53/58] Add a transition from first-run.
- From: Arnaud B. <arnaudb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-nibbles/arnaudb/modernize-code: 53/58] Add a transition from first-run.
- Date: Wed, 10 Jun 2020 17:17:24 +0000 (UTC)
commit 41f5dc618867850436676ab03bb5afc6382bebcd
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date: Mon Jun 1 20:49:16 2020 +0200
Add a transition from first-run.
data/first-run.ui | 17 ++++++-----------
src/nibbles-window.vala | 18 +++++++++++++-----
2 files changed, 19 insertions(+), 16 deletions(-)
---
diff --git a/data/first-run.ui b/data/first-run.ui
index b6bcbc9..71b0f92 100644
--- a/data/first-run.ui
+++ b/data/first-run.ui
@@ -56,30 +56,25 @@
<property name="icon-size">6</property> <!-- DIALOG -->
<property name="pixel-size">96</property>
</object>
- <packing>
- <property name="pack-type">start</property>
- </packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="label" translatable="yes">Welcome, worms.</property>
- <style><class name="menu-title"/></style>
+ <style>
+ <class name="menu-title"/>
+ </style>
</object>
- <packing>
- <property name="pack-type">start</property>
- </packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="label" translatable="yes">Eat the treats before the other worms, but don’t hit
anything!</property>
<property name="valign">start</property>
- <style><class name="tip"/></style>
+ <style>
+ <class name="tip"/>
+ </style>
</object>
- <packing>
- <property name="pack-type">start</property>
- </packing>
</child>
</object>
<packing>
diff --git a/src/nibbles-window.vala b/src/nibbles-window.vala
index 2841e73..3260103 100644
--- a/src/nibbles-window.vala
+++ b/src/nibbles-window.vala
@@ -168,7 +168,7 @@ private class NibblesWindow : ApplicationWindow
main_stack.set_visible_child (first_run_panel);
}
else
- show_new_game_screen_cb ();
+ show_new_game_screen ();
/* Create scores */
create_scores ();
@@ -320,7 +320,7 @@ private class NibblesWindow : ApplicationWindow
button.set_label (_("_New Game"));
dialog.response.connect ((response_id) => {
if (response_id == ResponseType.OK)
- show_new_game_screen_cb ();
+ show_new_game_screen ();
if ((response_id == ResponseType.CANCEL || response_id == ResponseType.DELETE_EVENT)
&& !game.is_paused)
{
@@ -430,7 +430,12 @@ private class NibblesWindow : ApplicationWindow
* * Switching the stack
\*/
- private void show_new_game_screen_cb ()
+ private inline void show_new_game_screen_cb ()
+ {
+ show_new_game_screen (/* after first run */ true);
+ }
+
+ private void show_new_game_screen (bool after_first_run = false)
{
if (countdown_id != 0)
{
@@ -450,7 +455,10 @@ private class NibblesWindow : ApplicationWindow
new_game_button.hide ();
pause_button.hide ();
- main_stack.set_transition_type (StackTransitionType.NONE);
+ if (after_first_run)
+ main_stack.set_transition_type (StackTransitionType.SLIDE_UP);
+ else
+ main_stack.set_transition_type (StackTransitionType.NONE);
main_stack.set_visible_child_name ("number_of_players");
main_stack.set_transition_type (StackTransitionType.SLIDE_UP);
}
@@ -807,7 +815,7 @@ private class NibblesWindow : ApplicationWindow
view.show ();
- show_new_game_screen_cb ();
+ show_new_game_screen ();
});
button.show ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]