[iagno] Move New Game button in headerbar.



commit 59327eb7e6fd5c0107d73f8a1f22646affa50ef9
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date:   Fri Feb 22 15:01:51 2019 +0100

    Move New Game button in headerbar.

 data/ui/iagno.ui     | 36 ++++++++++++++----------------------
 src/game-window.vala |  2 ++
 2 files changed, 16 insertions(+), 22 deletions(-)
---
diff --git a/data/ui/iagno.ui b/data/ui/iagno.ui
index b2119ee..e20118d 100644
--- a/data/ui/iagno.ui
+++ b/data/ui/iagno.ui
@@ -48,6 +48,19 @@
       <object class="GtkHeaderBar" id="headerbar">
         <property name="visible">True</property>
         <property name="show-close-button">True</property>
+        <child>
+          <object class="GtkButton" id="new_game_button">
+            <property name="visible">False</property>
+            <property name="use-underline">True</property>
+            <!-- Translators: during a game, label of the New Game button (with a mnemonic that appears 
pressing Alt) -->
+            <property name="label" translatable="yes">_New Game</property>
+            <property name="halign">center</property>
+            <property name="valign">center</property>
+            <property name="action-name">ui.new-game</property>
+            <!-- Translators: during a game, tooltip text of the New Game button -->
+            <property name="tooltip-text" translatable="yes">Start a new game</property>
+          </object>
+        </child>
         <child>
           <object class="GtkBox" id="controls_box">
             <property name="visible">False</property>
@@ -137,28 +150,7 @@
                         <property name="visible">True</property>
                         <property name="orientation">vertical</property>
                         <property name="spacing">6</property>
-                        <child>
-                          <object class="GtkButton" id="new_game_button">
-                            <property name="visible">True</property>
-                            <property name="use-underline">True</property>
-                            <!-- Translators: during a game, label of the Start Over button (with a mnemonic 
that appears pressing Alt) -->
-                            <property name="label" translatable="yes">_New Game</property>
-                            <property name="halign">center</property>
-                            <property name="valign">center</property>
-                            <property name="action-name">ui.new-game</property>
-                            <!-- Translators: during a game, tooltip text of the Start Over button -->
-                            <property name="tooltip-text" translatable="yes">Start a new game</property>
-                            <property name="width-request">120</property>
-                            <property name="height-request">60</property>
-                          </object>
-                          <packing>
-                            <property name="pack-type">end</property>
-                            <property name="expand">False</property>
-                            <property name="fill">False</property>
-                            <property name="padding">0</property>
-                            <property name="position">1</property>
-                          </packing>
-                        </child>
+                        <property name="width-request">111</property>
                       </object>
                       <packing>
                         <property name="pack-type">end</property>
diff --git a/src/game-window.vala b/src/game-window.vala
index f6171ed..b7650a0 100644
--- a/src/game-window.vala
+++ b/src/game-window.vala
@@ -305,6 +305,7 @@ private class GameWindow : ApplicationWindow
 
         stack.set_visible_child_name ("start-box");
         controls_box.hide ();
+        new_game_button.hide ();
 
         if (!game_finished && back_button.visible)
             back_button.grab_focus ();
@@ -316,6 +317,7 @@ private class GameWindow : ApplicationWindow
     {
         stack.set_visible_child_name ("frame");
         back_button.hide ();        // TODO transition?
+        new_game_button.show ();
         controls_box.show ();
 
         if (game_finished)


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