[gnome-nibbles/arnaudb/wip/gtk4: 37/62] Adapt UI files.



commit 66fef79d119a41d90d3ad4219484a68e2ef8c601
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date:   Mon Jun 15 18:17:49 2020 +0200

    Adapt UI files.

 data/ui/controls-grid.ui      |  85 ++++----
 data/ui/controls.ui           |  11 +-
 data/ui/first-run.ui          |  14 +-
 data/ui/nibbles.ui            | 167 +++++++--------
 data/ui/player-score-box.ui   |  17 +-
 data/ui/players.ui            |  27 +--
 data/ui/preferences-dialog.ui | 483 +++++++++++++++++++-----------------------
 data/ui/speed.ui              |  13 --
 8 files changed, 345 insertions(+), 472 deletions(-)
---
diff --git a/data/ui/controls-grid.ui b/data/ui/controls-grid.ui
index fb18ae8..8662770 100644
--- a/data/ui/controls-grid.ui
+++ b/data/ui/controls-grid.ui
@@ -19,7 +19,6 @@
 -->
 <interface>
   <template class="ControlsGrid" parent="GtkButton">
-    <property name="visible">True</property>
     <property name="halign">center</property>
     <property name="valign">center</property>
     <property name="action-name">win.preferences</property>
@@ -28,7 +27,6 @@
     </style>
     <child>
       <object class="GtkGrid">
-        <property name="visible">True</property>
         <property name="valign">center</property>
         <property name="halign">center</property>
         <property name="vexpand">True</property>
@@ -36,105 +34,96 @@
         <property name="column_spacing">5</property>
         <child>
           <object class="GtkLabel" id="name_label">
-            <property name="visible">True</property>
+            <layout>
+              <property name="left-attach">0</property>
+              <property name="top-attach">0</property>
+              <property name="column-span">5</property>
+            </layout>
           </object>
-          <packing>
-            <property name="left-attach">0</property>
-            <property name="top-attach">0</property>
-            <property name="width">5</property>
-          </packing>
         </child>
         <child>
           <object class="GtkImage" id="arrow_up">
-            <property name="visible">True</property>
+            <layout>
+              <property name="left-attach">2</property>
+              <property name="top-attach">1</property>
+            </layout>
           </object>
-          <packing>
-            <property name="left-attach">2</property>
-            <property name="top-attach">1</property>
-          </packing>
         </child>
         <child>
           <object class="GtkLabel" id="move_up_label">
-            <property name="visible">True</property>
             <property name="height-request">45</property>
             <property name="width-request">45</property>
             <style>
               <class name="controls-button"/>
             </style>
+            <layout>
+              <property name="left-attach">2</property>
+              <property name="top-attach">2</property>
+            </layout>
           </object>
-          <packing>
-            <property name="left-attach">2</property>
-            <property name="top-attach">2</property>
-          </packing>
         </child>
         <child>
           <object class="GtkImage" id="arrow_left">
-            <property name="visible">True</property>
+            <layout>
+              <property name="left-attach">0</property>
+              <property name="top-attach">3</property>
+            </layout>
           </object>
-          <packing>
-            <property name="left-attach">0</property>
-            <property name="top-attach">3</property>
-          </packing>
         </child>
         <child>
           <object class="GtkLabel" id="move_left_label">
-            <property name="visible">True</property>
             <property name="height-request">45</property>
             <property name="width-request">45</property>
             <style>
               <class name="controls-button"/>
             </style>
+            <layout>
+              <property name="left-attach">1</property>
+              <property name="top-attach">3</property>
+            </layout>
           </object>
-          <packing>
-            <property name="left-attach">1</property>
-            <property name="top-attach">3</property>
-          </packing>
         </child>
         <child>
           <object class="GtkLabel" id="move_right_label">
-            <property name="visible">True</property>
             <property name="height-request">45</property>
             <property name="width-request">45</property>
             <style>
               <class name="controls-button"/>
             </style>
+            <layout>
+              <property name="left-attach">3</property>
+              <property name="top-attach">3</property>
+            </layout>
           </object>
-          <packing>
-            <property name="left-attach">3</property>
-            <property name="top-attach">3</property>
-          </packing>
         </child>
         <child>
           <object class="GtkImage" id="arrow_right">
-            <property name="visible">True</property>
+            <layout>
+              <property name="left-attach">4</property>
+              <property name="top-attach">3</property>
+            </layout>
           </object>
-          <packing>
-            <property name="left-attach">4</property>
-            <property name="top-attach">3</property>
-          </packing>
         </child>
         <child>
           <object class="GtkLabel" id="move_down_label">
-            <property name="visible">True</property>
             <property name="height-request">45</property>
             <property name="width-request">45</property>
             <style>
               <class name="controls-button"/>
             </style>
+            <layout>
+              <property name="left-attach">2</property>
+              <property name="top-attach">4</property>
+            </layout>
           </object>
-          <packing>
-            <property name="left-attach">2</property>
-            <property name="top-attach">4</property>
-          </packing>
         </child>
         <child>
           <object class="GtkImage" id="arrow_down">
-            <property name="visible">True</property>
+            <layout>
+              <property name="left-attach">2</property>
+              <property name="top-attach">5</property>
+            </layout>
           </object>
-          <packing>
-            <property name="left-attach">2</property>
-            <property name="top-attach">5</property>
-          </packing>
         </child>
       </object>
     </child>
diff --git a/data/ui/controls.ui b/data/ui/controls.ui
index 5568284..72d0915 100644
--- a/data/ui/controls.ui
+++ b/data/ui/controls.ui
@@ -23,22 +23,21 @@
     <property name="orientation">vertical</property>
     <child>
       <object class="GtkBox">
-        <property name="visible">True</property>
         <property name="orientation">vertical</property>
         <property name="valign">center</property>
         <property name="spacing">25</property>
         <child>
           <object class="GtkLabel">
-            <property name="visible">True</property>
             <!-- Translators: title of one of the panels displayed during game configuration; the panel 
shows the keyboard controls of each player -->
             <property name="label" translatable="yes">Controls</property>
             <property name="valign">center</property>
-            <style><class name="menu-title"/></style>
+            <style>
+              <class name="menu-title"/>
+            </style>
           </object>
         </child>
         <child>
           <object class="GtkBox" id="grids_box">
-            <property name="visible">True</property>
             <property name="orientation">horizontal</property>
             <property name="homogeneous">True</property>
             <property name="halign">center</property>
@@ -50,7 +49,6 @@
     </child>
     <child>
       <object class="GtkButton">
-        <property name="visible">True</property>
         <property name="can-default">True</property>
         <property name="use-underline">True</property>
         <!-- Translators: label of a button in the last panel displayed during game configuration (the 
"Controls" one); starts the game -->
@@ -64,9 +62,6 @@
           <class name="play"/>
         </style>
       </object>
-      <packing>
-        <property name="pack-type">end</property>
-      </packing>
     </child>
   </template>
 </interface>
diff --git a/data/ui/first-run.ui b/data/ui/first-run.ui
index ea98e57..7873fe1 100644
--- a/data/ui/first-run.ui
+++ b/data/ui/first-run.ui
@@ -25,7 +25,6 @@
     <property name="height-request">350</property>
     <child>
       <object class="GtkButton">
-        <property name="visible">True</property>
         <property name="use-underline">True</property>
         <!-- Translators: label of a button in a panel shown only the first time the game is launched; to 
see it, launch `dconf write /org/gnome/nibbles/first-run 'true'` before launching the game -->
         <property name="label" translatable="yes">Let’s _Play</property>
@@ -38,29 +37,22 @@
           <class name="suggested-action"/>
           <class name="play"/>
         </style>
-      </object>
-      <packing>
-        <property name="pack-type">end</property>
-      </packing>
+      </object>>
     </child>
     <child>
       <object class="GtkBox">
-        <property name="visible">True</property>
         <property name="orientation">vertical</property>
         <property name="homogeneous">True</property>
         <property name="valign">center</property>
         <property name="vexpand">True</property>
         <child>
           <object class="GtkImage">
-            <property name="visible">True</property>
             <property name="icon-name">org.gnome.Nibbles</property>
-            <property name="icon-size">6</property> <!-- DIALOG -->
             <property name="pixel-size">96</property>
           </object>
         </child>
         <child>
           <object class="GtkLabel">
-            <property name="visible">True</property>
             <!-- Translators: label displayed on a panel shown only the first time the game is launched; to 
see it, launch `dconf write /org/gnome/nibbles/first-run 'true'` before launching the game -->
             <property name="label" translatable="yes">Welcome, worms.</property>
             <style>
@@ -70,7 +62,6 @@
         </child>
         <child>
           <object class="GtkLabel">
-            <property name="visible">True</property>
             <!-- Translators: label displayed on a panel shown only the first time the game is launched; to 
see it, launch `dconf write /org/gnome/nibbles/first-run 'true'` before launching the game -->
             <property name="label" translatable="yes">Eat the treats before the other worms, but don’t hit 
anything!</property>
             <property name="valign">start</property>
@@ -80,9 +71,6 @@
           </object>
         </child>
       </object>
-      <packing>
-        <property name="pack-type">end</property>
-      </packing>
     </child>
   </template>
 </interface>
diff --git a/data/ui/nibbles.ui b/data/ui/nibbles.ui
index 3cd4523..3493c6a 100644
--- a/data/ui/nibbles.ui
+++ b/data/ui/nibbles.ui
@@ -56,11 +56,10 @@
     </style>
     <child type="titlebar">
       <object class="GtkHeaderBar" id="headerbar">
-        <property name="visible">True</property>
         <!-- Translators: title of the window, as displayed in the headerbar -->
         <property name="title" translatable="yes">Nibbles</property>
-        <property name="show-close-button">True</property>
-        <child>
+        <property name="show-title-buttons">True</property>
+        <child type="start">
           <object class="GtkButton" id="new_game_button">
             <property name="visible">False</property>
             <property name="use-underline">True</property>
@@ -68,11 +67,14 @@
             <property name="label" translatable="yes">_New Game</property>
             <property name="action-name">win.new-game</property>
           </object>
-          <packing>
-            <property name="pack-type">start</property>
-          </packing>
         </child>
-        <child>
+        <child type="end">
+          <object class="GtkMenuButton">
+            <property name="menu-model">app-menu</property>
+            <property name="icon-name">open-menu-symbolic</property>
+          </object>
+        </child>
+        <child type="end">
           <object class="GtkButton" id="pause_button">
             <property name="visible">False</property>
             <property name="use-underline">True</property>
@@ -80,115 +82,100 @@
             <property name="label" translatable="yes">_Pause</property> <!-- duplicated in 
nibbles-window.vala; keep here else we see the button resize at game start -->
             <property name="action-name">win.pause</property>
           </object>
-          <packing>
-            <property name="pack-type">end</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkMenuButton">
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="menu-model">app-menu</property>
-            <child>
-              <object class="GtkImage">
-                <property name="visible">True</property>
-                <property name="icon_name">open-menu-symbolic</property>
-                <property name="icon_size">1</property>
-              </object>
-            </child>
-          </object>
-          <packing>
-            <property name="pack_type">end</property>
-            <property name="position">1</property>
-          </packing>
         </child>
       </object>
     </child>
     <child>
       <object class="GtkStack" id="main_stack">
-        <property name="visible">True</property>
         <property name="homogeneous">True</property>
-        <property name="margin">25</property>
-        <property name="expand">True</property>
+        <property name="margin-start">25</property>
+        <property name="margin-end">25</property>
+        <property name="margin-top">25</property>
+        <property name="margin-bottom">25</property>
+        <property name="hexpand">True</property>
+        <property name="vexpand">True</property>
         <property name="transition-type">slide-up</property>
         <property name="transition-duration">500</property>
         <child>
-          <object class="Players" id="players">
-            <property name="visible">True</property>
-          </object>
-          <packing>
+          <object class="GtkStackPage">
             <property name="name">number_of_players</property>
-          </packing>
+            <property name="child">
+              <object class="Players" id="players"/>
+            </property>
+          </object>
         </child>
         <child>
-          <object class="Speed" id="speed">
-            <property name="visible">True</property>
-          </object>
-          <packing>
+          <object class="GtkStackPage">
             <property name="name">speed</property>
-          </packing>
+            <property name="child">
+              <object class="Speed" id="speed"/>
+            </property>
+          </object>
         </child>
         <child>
-          <object class="Controls" id="controls">
-            <property name="visible">True</property>
-          </object>
-          <packing>
+          <object class="GtkStackPage">
             <property name="name">controls</property>
-          </packing>
+            <property name="child">
+              <object class="Controls" id="controls"/>
+            </property>
+          </object>
         </child>
         <child>
-          <object class="GtkOverlay" id="overlay">
-            <property name="visible">True</property>
-            <property name="can-default">True</property>
-            <child>
-              <object class="GtkBox" id="game_box">
-                <property name="visible">True</property>
-                <property name="orientation">vertical</property>
+          <object class="GtkStackPage">
+            <property name="name">game_box</property>
+            <property name="child">
+              <object class="GtkOverlay" id="overlay">
+                <property name="can-default">True</property>
                 <child>
-                  <object class="GtkStack" id="statusbar_stack">
-                    <property name="visible">True</property>
+                  <object class="GtkBox" id="game_box">
+                    <property name="orientation">vertical</property>
                     <child>
-                      <object class="GtkLabel" id="countdown">
-                        <property name="visible">True</property>
-                        <property name="label">3</property>
-                        <property name="halign">center</property>
-                        <style><class name="countdown"/></style>
+                      <object class="GtkStack" id="statusbar_stack">
+                        <child>
+                          <object class="GtkStackPage">
+                            <property name="name">countdown</property>
+                            <property name="child">
+                              <object class="GtkLabel" id="countdown">
+                                <property name="label">3</property>
+                                <property name="halign">center</property>
+                                <style>
+                                  <class name="countdown"/>
+                                </style>
+                              </object>
+                            </property>
+                          </object>
+                        </child>
+                        <child>
+                          <object class="GtkStackPage">
+                            <property name="name">scoreboard</property>
+                            <property name="child">
+                              <object class="Scoreboard" id="scoreboard">
+                                <property name="halign">center</property>
+                              </object>
+                            </property>
+                          </object>
+                        </child>
+                        <child>
+                          <object class="GtkStackPage">
+                            <property name="name">paused</property>
+                            <property name="child">
+                              <object class="GtkLabel">
+                                <!-- Translators: text displayed at the bottom of the window, when the game 
is paused -->
+                                <property name="label" translatable="yes">Paused</property>
+                                <style>
+                                  <class name="menu-title"/>
+                                </style>
+                              </object>
+                            </property>
+                          </object>
+                        </child>
                       </object>
-                      <packing>
-                        <property name="name">countdown</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="Scoreboard" id="scoreboard">
-                        <property name="visible">True</property>
-                        <property name="halign">center</property>
-                      </object>
-                      <packing>
-                        <property name="name">scoreboard</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkLabel">
-                        <property name="visible">True</property>
-                        <!-- Translators: text displayed at the bottom of the window, when the game is 
paused -->
-                        <property name="label" translatable="yes">Paused</property>
-                        <style><class name="menu-title"/></style>
-                      </object>
-                      <packing>
-                        <property name="name">paused</property>
-                      </packing>
                     </child>
                   </object>
-                  <packing>
-                    <property name="pack-type">end</property>
-                  </packing>
                 </child>
               </object>
-            </child>
+            </property>
           </object>
-          <packing>
-            <property name="name">game_box</property>
-          </packing>
         </child>
       </object> <!-- End of main_stack -->
     </child>
diff --git a/data/ui/player-score-box.ui b/data/ui/player-score-box.ui
index 529dfb0..adea671 100644
--- a/data/ui/player-score-box.ui
+++ b/data/ui/player-score-box.ui
@@ -19,41 +19,26 @@
 -->
 <interface>
   <template class="PlayerScoreBox" parent="GtkBox">
-    <property name="visible">True</property>
     <property name="orientation">vertical</property>
     <property name="spacing">5</property>
     <child>
       <object class="GtkBox">
-        <property name="visible">True</property>
         <property name="orientation">horizontal</property>
         <property name="spacing">4</property>
         <child>
-          <object class="GtkLabel" id="name_label">
-            <property name="visible">True</property>
-          </object>
-          <packing>
-            <property name="pack-type">start</property>
-          </packing>
+          <object class="GtkLabel" id="name_label"/>
         </child>
         <child>
           <object class="GtkLabel" id="score_label">
-            <property name="visible">True</property>
             <property name="label">0</property>
             <property name="width-request">36</property>
             <property name="xalign">1</property>
           </object>
-          <packing>
-            <property name="pack-type">end</property>
-          </packing>
         </child>
       </object>
-      <packing>
-        <property name="pack-type">start</property>
-      </packing>
     </child>
     <child>
       <object class="GtkGrid" id="lives_grid">
-        <property name="visible">True</property>
         <property name="column-spacing">2</property>
       </object>
     </child>
diff --git a/data/ui/players.ui b/data/ui/players.ui
index 7ae9120..5b02567 100644
--- a/data/ui/players.ui
+++ b/data/ui/players.ui
@@ -25,40 +25,36 @@
     <property name="width-request">644</property>
     <child>
       <object class="GtkBox">
-        <property name="visible">True</property>
         <property name="orientation">vertical</property>
         <property name="valign">center</property>
         <property name="spacing">60</property>
         <child>
           <object class="GtkBox">
-            <property name="visible">True</property>
             <property name="orientation">vertical</property>
             <property name="spacing">10</property>
             <child>
               <object class="GtkLabel">
-                <property name="visible">True</property>
                 <!-- Translators: title of one of the panels displayed during game configuration; the panel 
allows to change the number of human and ai worms -->
                 <property name="label" translatable="yes">Number of players</property>
-                <style><class name="menu-title"/></style>
+                <style>
+                  <class name="menu-title"/>
+                </style>
               </object>
             </child>
           </object>
         </child>
         <child>
           <object class="GtkBox">
-            <property name="visible">True</property>
             <property name="orientation">vertical</property>
             <property name="spacing">10</property>
             <child>
               <object class="GtkLabel">
-                <property name="visible">True</property>
                 <!-- Translators: label in one of the panels displayed during game configuration; allows to 
choose if the game has 1/2/3/4 human players -->
                 <property name="label" translatable="yes">Select the number of human players.</property>
               </object>
             </child>
             <child>
               <object class="GtkBox">
-                <property name="visible">True</property>
                 <property name="orientation">horizontal</property>
                 <property name="valign">center</property>
                 <property name="halign">center</property>
@@ -66,7 +62,6 @@
                 <property name="vexpand">True</property>
                 <child>
                   <object class="GtkToggleButton" id="players1">
-                    <property name="visible">True</property>
                     <property name="use-underline">True</property>
                     <property name="label">_1</property>
                     <property name="action-name">players.change-players-number</property>
@@ -79,7 +74,6 @@
                 </child>
                 <child>
                   <object class="GtkToggleButton" id="players2">
-                    <property name="visible">True</property>
                     <property name="use-underline">True</property>
                     <property name="label">_2</property>
                     <property name="action-name">players.change-players-number</property>
@@ -92,7 +86,6 @@
                 </child>
                 <child>
                   <object class="GtkToggleButton" id="players3">
-                    <property name="visible">True</property>
                     <property name="use-underline">True</property>
                     <property name="label">_3</property>
                     <property name="action-name">players.change-players-number</property>
@@ -105,7 +98,6 @@
                 </child>
                 <child>
                   <object class="GtkToggleButton" id="players4">
-                    <property name="visible">True</property>
                     <property name="use-underline">True</property>
                     <property name="label">_4</property>
                     <property name="action-name">players.change-players-number</property>
@@ -122,19 +114,16 @@
         </child>
         <child>
           <object class="GtkBox">
-            <property name="visible">True</property>
             <property name="orientation">vertical</property>
             <property name="spacing">10</property>
             <child>
               <object class="GtkLabel">
-                <property name="visible">True</property>
                 <!-- Translators: label in one of the panels displayed during game configuration; allows to 
choose if the game has 0/1/2/3/4/5 ai-controlled worms -->
                 <property name="label" translatable="yes">Select the number of computer players.</property>
               </object>
             </child>
             <child>
               <object class="GtkBox">
-                <property name="visible">True</property>
                 <property name="orientation">horizontal</property>
                 <property name="valign">center</property>
                 <property name="halign">center</property>
@@ -142,7 +131,6 @@
                 <property name="vexpand">True</property>
                 <child>
                   <object class="GtkToggleButton" id="worms4">
-                    <property name="visible">True</property>
                     <property name="use-underline">True</property>
                     <property name="label">_3</property>
                     <property name="action-name">players.change-nibbles-number</property>
@@ -155,7 +143,6 @@
                 </child>
                 <child>
                   <object class="GtkToggleButton" id="worms5">
-                    <property name="visible">True</property>
                     <property name="use-underline">True</property>
                     <property name="label">_4</property>
                     <property name="action-name">players.change-nibbles-number</property>
@@ -168,7 +155,6 @@
                 </child>
                 <child>
                   <object class="GtkToggleButton" id="worms6">
-                    <property name="visible">True</property>
                     <property name="use-underline">True</property>
                     <property name="label">_5</property>
                     <property name="action-name">players.change-nibbles-number</property>
@@ -184,13 +170,9 @@
           </object>
         </child>
       </object>
-      <packing>
-        <property name="pack-type">start</property>
-      </packing>
     </child>
     <child>
       <object class="GtkButton">
-        <property name="visible">True</property>
         <property name="can-default">True</property>
         <property name="use-underline">True</property>
         <!-- Translators: label of a button in the "Number of players" panel displayed during game 
configuration (with a mnemonic that appears when pressing Alt); switch to next panel -->
@@ -204,9 +186,6 @@
           <class name="play"/>
         </style>
       </object>
-      <packing>
-        <property name="pack-type">end</property>
-      </packing>
     </child>
   </template>
 </interface>
diff --git a/data/ui/preferences-dialog.ui b/data/ui/preferences-dialog.ui
index 6847c69..f2c6d7e 100644
--- a/data/ui/preferences-dialog.ui
+++ b/data/ui/preferences-dialog.ui
@@ -20,109 +20,66 @@
 -->
 <interface>
   <object class="GtkStack" id="headerbar_stack">
-    <property name="visible">True</property>
     <child>
-      <object class="GtkComboBoxText" id="worm_combobox">
-        <property name="visible">True</property>
-        <property name="active-id">worm1</property>
-        <items>
-          <!-- Translators: item in the title-combobox of the Controls configuration dialog; allows to 
configure 1st worm controls and color -->
-          <item translatable="yes" id="worm1">Worm 1</item>
-          <!-- Translators: item in the title-combobox of the Controls configuration dialog; allows to 
configure 2nd worm controls and color -->
-          <item translatable="yes" id="worm2">Worm 2</item>
-          <!-- Translators: item in the title-combobox of the Controls configuration dialog; allows to 
configure 3rd worm controls and color -->
-          <item translatable="yes" id="worm3">Worm 3</item>
-          <!-- Translators: item in the title-combobox of the Controls configuration dialog; allows to 
configure 4th worm controls and color -->
-          <item translatable="yes" id="worm4">Worm 4</item>
-        </items>
-        <signal name="changed" handler="on_worm_change"/>
-      </object>
-      <packing>
+      <object class="GtkStackPage">
         <property name="name">preferences-combo</property>
-      </packing>
+        <property name="child">
+          <object class="GtkComboBoxText" id="worm_combobox">
+            <property name="active-id">worm1</property>
+            <items>
+              <!-- Translators: item in the title-combobox of the Controls configuration dialog; allows to 
configure 1st worm controls and color -->
+              <item translatable="yes" id="worm1">Worm 1</item>
+              <!-- Translators: item in the title-combobox of the Controls configuration dialog; allows to 
configure 2nd worm controls and color -->
+              <item translatable="yes" id="worm2">Worm 2</item>
+              <!-- Translators: item in the title-combobox of the Controls configuration dialog; allows to 
configure 3rd worm controls and color -->
+              <item translatable="yes" id="worm3">Worm 3</item>
+              <!-- Translators: item in the title-combobox of the Controls configuration dialog; allows to 
configure 4th worm controls and color -->
+              <item translatable="yes" id="worm4">Worm 4</item>
+            </items>
+            <signal name="changed" handler="on_worm_change"/>
+          </object>
+        </property>
+      </object>
     </child>
     <child>
-      <object class="GtkLabel">
-        <property name="visible">True</property>
-        <!-- Translators: title of the Controls configuration dialog, if there is only one worm; allows to 
configure the worm controls and color -->
-        <property name="label" translatable="yes">Preferences</property>
-      </object>
-      <packing>
+      <object class="GtkStackPage">
         <property name="name">preferences-label</property>
-      </packing>
+        <property name="child">
+          <object class="GtkLabel">
+            <!-- Translators: title of the Controls configuration dialog, if there is only one worm; allows 
to configure the worm controls and color -->
+            <property name="label" translatable="yes">Preferences</property>
+          </object>
+        </property>
+      </object>
     </child>
   </object>
   <template class="PreferencesDialog" parent="GtkWindow">
     <property name="can_focus">False</property>
-    <property name="border_width">5</property>
+<!--    <property name="border_width">5</property>-->
     <property name="modal">True</property>
     <property name="icon_name">gnome-nibbles</property>
     <child type="titlebar">
       <object class="GtkHeaderBar">
-        <property name="visible">True</property>
         <property name="show-close-button">True</property>
         <property name="custom-title">headerbar_stack</property>
       </object>
     </child>
     <child>
       <object class="GtkStack" id="stack">
-        <property name="visible">True</property>
         <child>
-          <object class="GtkBox">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="border_width">12</property>
-            <property name="spacing">6</property>
-            <property name="orientation">vertical</property>
-            <child>
-              <object class="GtkLabel">
-                <!-- Translators: title of a section in the Preferences dialog (1st worm); allows to 
configure keyboard controls for the worm -->
-                <property name="label" translatable="yes">Controls</property>
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="xalign">0.5</property>
-                <property name="yalign">0.5</property>
-                <property name="halign">start</property>
-                <attributes>
-                  <attribute name="weight" value="bold"/>
-                </attributes>
-              </object>
-            </child>
-            <child>
-              <object class="GtkListStore" id="list_store_1">
-                <columns>
-                  <column type="gchararray"/>
-                  <column type="gchararray"/>
-                  <column type="gint"/>
-                </columns>
-              </object>
-              <object class="GtkTreeView" id="tree_view_1">
-                <property name="model">list_store_1</property>
-                <property name="visible">True</property>
-              </object>
-            </child>
-            <child>
-              <object class="GtkSeparator">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="orientation">horizontal</property>
-              </object>
-            </child>
-            <child>
-              <object class="GtkGrid">
-                <property name="visible">True</property>
+          <object class="GtkStackPage">
+            <property name="name">worm1</property>
+            <property name="child">
+              <object class="GtkBox">
                 <property name="can_focus">False</property>
-                <property name="row_spacing">0</property>
-                <property name="column_spacing">12</property>
-                <property name="border_width">0</property>
+    <!--            <property name="border_width">12</property>-->
+                <property name="spacing">6</property>
+                <property name="orientation">vertical</property>
                 <child>
                   <object class="GtkLabel">
-                    <!-- Translators: title of a section in the Preferences dialog (1st worm); allows to 
configure the worm color -->
-                    <property name="label" translatable="yes">Worm color</property>
-                    <property name="visible">True</property>
+                    <!-- Translators: title of a section in the Preferences dialog (1st worm); allows to 
configure keyboard controls for the worm -->
+                    <property name="label" translatable="yes">Controls</property>
                     <property name="can_focus">False</property>
-                    <property name="xalign">0.5</property>
-                    <property name="yalign">0.5</property>
                     <property name="halign">start</property>
                     <attributes>
                       <attribute name="weight" value="bold"/>
@@ -130,75 +87,66 @@
                   </object>
                 </child>
                 <child>
-                  <object class="GtkComboBoxText" id="combo_box_1">
-                    <property name="visible">True</property>
-                    <property name="hexpand">True</property>
+                  <object class="GtkListStore" id="list_store_1">
+                    <columns>
+                      <column type="gchararray"/>
+                      <column type="gchararray"/>
+                      <column type="gint"/>
+                    </columns>
+                  </object>
+                  <object class="GtkTreeView" id="tree_view_1">
+                    <property name="model">list_store_1</property>
+                  </object>
+                </child>
+                <child>
+                  <object class="GtkSeparator">
                     <property name="can_focus">False</property>
+                    <property name="orientation">horizontal</property>
+                  </object>
+                </child>
+                <child>
+                  <object class="GtkGrid">
+                    <property name="can_focus">False</property>
+                    <property name="row_spacing">0</property>
+                    <property name="column_spacing">12</property>
+    <!--                <property name="border_width">0</property>-->
+                    <child>
+                      <object class="GtkLabel">
+                        <!-- Translators: title of a section in the Preferences dialog (1st worm); allows to 
configure the worm color -->
+                        <property name="label" translatable="yes">Worm color</property>
+                        <property name="can_focus">False</property>
+                        <property name="halign">start</property>
+                        <attributes>
+                          <attribute name="weight" value="bold"/>
+                        </attributes>
+                      </object>
+                    </child>
+                    <child>
+                      <object class="GtkComboBoxText" id="combo_box_1">
+                        <property name="hexpand">True</property>
+                        <property name="can_focus">False</property>
+                      </object>
+                    </child>
                   </object>
                 </child>
               </object>
-            </child>
+            </property>
           </object>
-          <packing>
-            <property name="name">worm1</property>
-          </packing>
         </child>
         <child>
-          <object class="GtkBox">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="border_width">12</property>
-            <property name="spacing">6</property>
-            <property name="orientation">vertical</property>
-            <child>
-              <object class="GtkLabel">
-                <!-- Translators: title of a section in the Preferences dialog (2nd worm); allows to 
configure keyboard controls for the worm -->
-                <property name="label" translatable="yes">Controls</property>
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="xalign">0.5</property>
-                <property name="yalign">0.5</property>
-                <property name="halign">start</property>
-                <attributes>
-                  <attribute name="weight" value="bold"/>
-                </attributes>
-              </object>
-            </child>
-            <child>
-              <object class="GtkListStore" id="list_store_2">
-                <columns>
-                  <column type="gchararray"/>
-                  <column type="gchararray"/>
-                  <column type="guint"/>
-                </columns>
-              </object>
-              <object class="GtkTreeView" id="tree_view_2">
-                <property name="model">list_store_2</property>
-                <property name="visible">True</property>
-              </object>
-            </child>
-            <child>
-              <object class="GtkSeparator">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="orientation">horizontal</property>
-              </object>
-            </child>
-            <child>
-              <object class="GtkGrid">
-                <property name="visible">True</property>
+          <object class="GtkStackPage">
+            <property name="name">worm2</property>
+            <property name="child">
+              <object class="GtkBox">
                 <property name="can_focus">False</property>
-                <property name="row_spacing">0</property>
-                <property name="column_spacing">12</property>
-                <property name="border_width">0</property>
+    <!--            <property name="border_width">12</property>-->
+                <property name="spacing">6</property>
+                <property name="orientation">vertical</property>
                 <child>
                   <object class="GtkLabel">
-                    <!-- Translators: title of a section in the Preferences dialog (2nd worm); allows to 
configure the worm color -->
-                    <property name="label" translatable="yes">Worm color</property>
-                    <property name="visible">True</property>
+                    <!-- Translators: title of a section in the Preferences dialog (2nd worm); allows to 
configure keyboard controls for the worm -->
+                    <property name="label" translatable="yes">Controls</property>
                     <property name="can_focus">False</property>
-                    <property name="xalign">0.5</property>
-                    <property name="yalign">0.5</property>
                     <property name="halign">start</property>
                     <attributes>
                       <attribute name="weight" value="bold"/>
@@ -206,75 +154,66 @@
                   </object>
                 </child>
                 <child>
-                  <object class="GtkComboBoxText" id="combo_box_2">
-                    <property name="visible">True</property>
-                    <property name="hexpand">True</property>
+                  <object class="GtkListStore" id="list_store_2">
+                    <columns>
+                      <column type="gchararray"/>
+                      <column type="gchararray"/>
+                      <column type="guint"/>
+                    </columns>
+                  </object>
+                  <object class="GtkTreeView" id="tree_view_2">
+                    <property name="model">list_store_2</property>
+                  </object>
+                </child>
+                <child>
+                  <object class="GtkSeparator">
+                    <property name="can_focus">False</property>
+                    <property name="orientation">horizontal</property>
+                  </object>
+                </child>
+                <child>
+                  <object class="GtkGrid">
                     <property name="can_focus">False</property>
+                    <property name="row_spacing">0</property>
+                    <property name="column_spacing">12</property>
+    <!--                <property name="border_width">0</property>-->
+                    <child>
+                      <object class="GtkLabel">
+                        <!-- Translators: title of a section in the Preferences dialog (2nd worm); allows to 
configure the worm color -->
+                        <property name="label" translatable="yes">Worm color</property>
+                        <property name="can_focus">False</property>
+                        <property name="halign">start</property>
+                        <attributes>
+                          <attribute name="weight" value="bold"/>
+                        </attributes>
+                      </object>
+                    </child>
+                    <child>
+                      <object class="GtkComboBoxText" id="combo_box_2">
+                        <property name="hexpand">True</property>
+                        <property name="can_focus">False</property>
+                      </object>
+                    </child>
                   </object>
                 </child>
               </object>
-            </child>
+            </property>
           </object>
-          <packing>
-            <property name="name">worm2</property>
-          </packing>
         </child>
         <child>
-          <object class="GtkBox">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="border_width">12</property>
-            <property name="spacing">6</property>
-            <property name="orientation">vertical</property>
-            <child>
-              <object class="GtkLabel">
-                <!-- Translators: title of a section in the Preferences dialog (3rd worm); allows to 
configure keyboard controls for the worm -->
-                <property name="label" translatable="yes">Controls</property>
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="xalign">0.5</property>
-                <property name="yalign">0.5</property>
-                <property name="halign">start</property>
-                <attributes>
-                  <attribute name="weight" value="bold"/>
-                </attributes>
-              </object>
-            </child>
-            <child>
-              <object class="GtkListStore" id="list_store_3">
-                <columns>
-                  <column type="gchararray"/>
-                  <column type="gchararray"/>
-                  <column type="guint"/>
-                </columns>
-              </object>
-              <object class="GtkTreeView" id="tree_view_3">
-                <property name="model">list_store_3</property>
-                <property name="visible">True</property>
-              </object>
-            </child>
-            <child>
-              <object class="GtkSeparator">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="orientation">horizontal</property>
-              </object>
-            </child>
-            <child>
-              <object class="GtkGrid">
-                <property name="visible">True</property>
+          <object class="GtkStackPage">
+            <property name="name">worm3</property>
+            <property name="child">
+              <object class="GtkBox">
                 <property name="can_focus">False</property>
-                <property name="row_spacing">0</property>
-                <property name="column_spacing">12</property>
-                <property name="border_width">0</property>
+    <!--            <property name="border_width">12</property>-->
+                <property name="spacing">6</property>
+                <property name="orientation">vertical</property>
                 <child>
                   <object class="GtkLabel">
-                    <!-- Translators: title of a section in the Preferences dialog (3rd worm); allows to 
configure the worm color -->
-                    <property name="label" translatable="yes">Worm color</property>
-                    <property name="visible">True</property>
+                    <!-- Translators: title of a section in the Preferences dialog (3rd worm); allows to 
configure keyboard controls for the worm -->
+                    <property name="label" translatable="yes">Controls</property>
                     <property name="can_focus">False</property>
-                    <property name="xalign">0.5</property>
-                    <property name="yalign">0.5</property>
                     <property name="halign">start</property>
                     <attributes>
                       <attribute name="weight" value="bold"/>
@@ -282,75 +221,66 @@
                   </object>
                 </child>
                 <child>
-                  <object class="GtkComboBoxText" id="combo_box_3">
-                    <property name="visible">True</property>
-                    <property name="hexpand">True</property>
+                  <object class="GtkListStore" id="list_store_3">
+                    <columns>
+                      <column type="gchararray"/>
+                      <column type="gchararray"/>
+                      <column type="guint"/>
+                    </columns>
+                  </object>
+                  <object class="GtkTreeView" id="tree_view_3">
+                    <property name="model">list_store_3</property>
+                  </object>
+                </child>
+                <child>
+                  <object class="GtkSeparator">
+                    <property name="can_focus">False</property>
+                    <property name="orientation">horizontal</property>
+                  </object>
+                </child>
+                <child>
+                  <object class="GtkGrid">
                     <property name="can_focus">False</property>
+                    <property name="row_spacing">0</property>
+                    <property name="column_spacing">12</property>
+    <!--                <property name="border_width">0</property>-->
+                    <child>
+                      <object class="GtkLabel">
+                        <!-- Translators: title of a section in the Preferences dialog (3rd worm); allows to 
configure the worm color -->
+                        <property name="label" translatable="yes">Worm color</property>
+                        <property name="can_focus">False</property>
+                        <property name="halign">start</property>
+                        <attributes>
+                          <attribute name="weight" value="bold"/>
+                        </attributes>
+                      </object>
+                    </child>
+                    <child>
+                      <object class="GtkComboBoxText" id="combo_box_3">
+                        <property name="hexpand">True</property>
+                        <property name="can_focus">False</property>
+                      </object>
+                    </child>
                   </object>
                 </child>
               </object>
-            </child>
+            </property>
           </object>
-          <packing>
-            <property name="name">worm3</property>
-          </packing>
         </child>
         <child>
-          <object class="GtkBox">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="border_width">12</property>
-            <property name="spacing">6</property>
-            <property name="orientation">vertical</property>
-            <child>
-              <object class="GtkLabel">
-                <!-- Translators: title of a section in the Preferences dialog (4th worm); allows to 
configure keyboard controls for the worm -->
-                <property name="label" translatable="yes">Controls</property>
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="xalign">0.5</property>
-                <property name="yalign">0.5</property>
-                <property name="halign">start</property>
-                <attributes>
-                  <attribute name="weight" value="bold"/>
-                </attributes>
-              </object>
-            </child>
-            <child>
-              <object class="GtkListStore" id="list_store_4">
-                <columns>
-                  <column type="gchararray"/>
-                  <column type="gchararray"/>
-                  <column type="guint"/>
-                </columns>
-              </object>
-              <object class="GtkTreeView" id="tree_view_4">
-                <property name="model">list_store_4</property>
-                <property name="visible">True</property>
-              </object>
-            </child>
-            <child>
-              <object class="GtkSeparator">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="orientation">horizontal</property>
-              </object>
-            </child>
-            <child>
-              <object class="GtkGrid">
-                <property name="visible">True</property>
+          <object class="GtkStackPage">
+            <property name="name">worm4</property>
+            <property name="child">
+              <object class="GtkBox">
                 <property name="can_focus">False</property>
-                <property name="row_spacing">0</property>
-                <property name="column_spacing">12</property>
-                <property name="border_width">0</property>
+    <!--            <property name="border_width">12</property>-->
+                <property name="spacing">6</property>
+                <property name="orientation">vertical</property>
                 <child>
                   <object class="GtkLabel">
-                    <!-- Translators: title of a section in the Preferences dialog (4th worm); allows to 
configure the worm color -->
-                    <property name="label" translatable="yes">Worm color</property>
-                    <property name="visible">True</property>
+                    <!-- Translators: title of a section in the Preferences dialog (4th worm); allows to 
configure keyboard controls for the worm -->
+                    <property name="label" translatable="yes">Controls</property>
                     <property name="can_focus">False</property>
-                    <property name="xalign">0.5</property>
-                    <property name="yalign">0.5</property>
                     <property name="halign">start</property>
                     <attributes>
                       <attribute name="weight" value="bold"/>
@@ -358,18 +288,51 @@
                   </object>
                 </child>
                 <child>
-                  <object class="GtkComboBoxText" id="combo_box_4">
-                    <property name="visible">True</property>
-                    <property name="hexpand">True</property>
+                  <object class="GtkListStore" id="list_store_4">
+                    <columns>
+                      <column type="gchararray"/>
+                      <column type="gchararray"/>
+                      <column type="guint"/>
+                    </columns>
+                  </object>
+                  <object class="GtkTreeView" id="tree_view_4">
+                    <property name="model">list_store_4</property>
+                  </object>
+                </child>
+                <child>
+                  <object class="GtkSeparator">
+                    <property name="can_focus">False</property>
+                    <property name="orientation">horizontal</property>
+                  </object>
+                </child>
+                <child>
+                  <object class="GtkGrid">
                     <property name="can_focus">False</property>
+                    <property name="row_spacing">0</property>
+                    <property name="column_spacing">12</property>
+    <!--                <property name="border_width">0</property>-->
+                    <child>
+                      <object class="GtkLabel">
+                        <!-- Translators: title of a section in the Preferences dialog (4th worm); allows to 
configure the worm color -->
+                        <property name="label" translatable="yes">Worm color</property>
+                        <property name="can_focus">False</property>
+                        <property name="halign">start</property>
+                        <attributes>
+                          <attribute name="weight" value="bold"/>
+                        </attributes>
+                      </object>
+                    </child>
+                    <child>
+                      <object class="GtkComboBoxText" id="combo_box_4">
+                        <property name="hexpand">True</property>
+                        <property name="can_focus">False</property>
+                      </object>
+                    </child>
                   </object>
                 </child>
               </object>
-            </child>
+            </property>
           </object>
-          <packing>
-            <property name="name">worm4</property>
-          </packing>
         </child>
       </object>
     </child>
diff --git a/data/ui/speed.ui b/data/ui/speed.ui
index 9541a2d..8fe6cb5 100644
--- a/data/ui/speed.ui
+++ b/data/ui/speed.ui
@@ -23,13 +23,11 @@
     <property name="orientation">vertical</property>
     <child>
       <object class="GtkBox">
-        <property name="visible">True</property>
         <property name="orientation">vertical</property>
         <property name="valign">center</property>
         <property name="spacing">25</property>
         <child>
           <object class="GtkLabel">
-            <property name="visible">True</property>
             <!-- Translators: title of one of the panels displayed during game configuration; the panel 
allows to change the worms speed (notably) -->
             <property name="label" translatable="yes">Preferences</property>
             <property name="valign">center</property>
@@ -40,7 +38,6 @@
         </child>
         <child>
           <object class="GtkBox">
-            <property name="visible">True</property>
             <property name="orientation">vertical</property>
             <property name="valign">center</property>
             <property name="halign">center</property>
@@ -48,7 +45,6 @@
             <property name="vexpand">True</property>
             <child>
               <object class="GtkToggleButton" id="speed4">
-                <property name="visible">True</property>
                 <property name="hexpand">True</property>
                 <property name="halign">fill</property>
                 <property name="xalign">0.0</property>
@@ -65,7 +61,6 @@
             </child>
             <child>
               <object class="GtkToggleButton" id="speed3">
-                <property name="visible">True</property>
                 <property name="hexpand">True</property>
                 <property name="halign">fill</property>
                 <property name="xalign">0.0</property>
@@ -82,7 +77,6 @@
             </child>
             <child>
               <object class="GtkToggleButton" id="speed2">
-                <property name="visible">True</property>
                 <property name="hexpand">True</property>
                 <property name="halign">fill</property>
                 <property name="xalign">0.0</property>
@@ -99,7 +93,6 @@
             </child>
             <child>
               <object class="GtkToggleButton" id="speed1">
-                <property name="visible">True</property>
                 <property name="hexpand">True</property>
                 <property name="halign">fill</property>
                 <property name="xalign">0.0</property>
@@ -116,7 +109,6 @@
             </child>
             <child>
               <object class="GtkSeparator">
-                <property name="visible">True</property>
                 <property name="orientation">horizontal</property>
                 <style>
                   <class name="speed-separator"/>
@@ -125,7 +117,6 @@
             </child>
             <child>
               <object class="GtkModelButton" id="fakes_modelbutton">
-                <property name="visible">True</property>
                 <property name="hexpand">True</property>
                 <property name="halign">fill</property>
                 <property name="use-underline">True</property>
@@ -143,7 +134,6 @@
     </child>
     <child>
       <object class="GtkButton">
-        <property name="visible">True</property>
         <property name="can-default">True</property>
         <property name="use-underline">True</property>
         <!-- Translators: label of a button in the "Preferences" panel displayed during game configuration 
(with a mnemonic that appears when pressing Alt); switch to next panel -->
@@ -157,9 +147,6 @@
           <class name="play"/>
         </style>
       </object>
-      <packing>
-        <property name="pack-type">end</property>
-      </packing>
     </child>
   </template>
 </interface>


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