[gnome-nibbles/arnaudb/modernize-code] Simplify UI file.



commit 64a772fad6d9541dd0919072f18e23c723ee43be
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date:   Mon Jun 1 20:31:53 2020 +0200

    Simplify UI file.
    
    The overlay only applies to
    the game_box and the window
    can be set black without an
    unneeded box for one child.

 data/nibbles.css |   2 +-
 data/nibbles.ui  | 134 +++++++++++++++++++++++++------------------------------
 2 files changed, 63 insertions(+), 73 deletions(-)
---
diff --git a/data/nibbles.css b/data/nibbles.css
index 0cc9a22..eec9467 100644
--- a/data/nibbles.css
+++ b/data/nibbles.css
@@ -1,4 +1,4 @@
-.window-background {
+window {
   background-color: rgba(0, 0, 0, 1);
 }
 .menu-title {
diff --git a/data/nibbles.ui b/data/nibbles.ui
index 91aa5b4..a26b191 100644
--- a/data/nibbles.ui
+++ b/data/nibbles.ui
@@ -92,98 +92,88 @@
       </object>
     </child>
     <child>
-      <object class="GtkOverlay" id="overlay">
+      <object class="GtkStack" id="main_stack">
         <property name="visible">True</property>
-        <property name="can-default">True</property>
+        <property name="homogeneous">True</property>
+        <property name="margin">25</property>
+        <property name="expand">True</property>
+        <property name="transition-type">slide-up</property>
+        <property name="transition-duration">500</property>
         <child>
-          <object class="GtkBox">
+          <object class="Players" id="players">
             <property name="visible">True</property>
-            <property name="orientation">vertical</property>
-            <style><class name="window-background"/></style>
+          </object>
+          <packing>
+            <property name="name">number_of_players</property>
+          </packing>
+        </child>
+        <child>
+          <object class="Controls" id="controls">
+            <property name="visible">True</property>
+          </object>
+          <packing>
+            <property name="name">controls</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkOverlay" id="overlay">
+            <property name="visible">True</property>
+            <property name="can-default">True</property>
             <child>
-              <object class="GtkStack" id="main_stack">
+              <object class="GtkBox" id="game_box">
                 <property name="visible">True</property>
-                <property name="homogeneous">True</property>
-                <property name="margin">25</property>
-                <property name="expand">True</property>
-                <property name="transition-type">slide-up</property>
-                <property name="transition-duration">500</property>
+                <property name="orientation">vertical</property>
                 <child>
-                  <object class="Players" id="players">
+                  <object class="GtkBox">
                     <property name="visible">True</property>
-                  </object>
-                  <packing>
-                    <property name="name">number_of_players</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="Controls" id="controls">
-                    <property name="visible">True</property>
-                  </object>
-                  <packing>
-                    <property name="name">controls</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkBox" id="game_box">
-                    <property name="visible">True</property>
-                    <property name="orientation">vertical</property>
+                    <property name="halign">center</property>
                     <child>
-                      <object class="GtkBox">
+                      <object class="GtkStack" id="statusbar_stack">
                         <property name="visible">True</property>
-                        <property name="halign">center</property>
                         <child>
-                          <object class="GtkStack" id="statusbar_stack">
+                          <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>
+                          <packing>
+                            <property name="name">countdown</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="Scoreboard" id="scoreboard">
                             <property name="visible">True</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>
-                              <packing>
-                                <property name="name">countdown</property>
-                              </packing>
-                            </child>
-                            <child>
-                              <object class="Scoreboard" id="scoreboard">
-                                <property name="visible">True</property>
-                              </object>
-                              <packing>
-                                <property name="name">scoreboard</property>
-                              </packing>
-                            </child>
-                            <child>
-                              <object class="GtkLabel">
-                                <property name="visible">True</property>
-                                <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="name">scoreboard</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkLabel">
+                            <property name="visible">True</property>
+                            <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>
                   <packing>
-                    <property name="name">game_box</property>
+                    <property name="pack-type">end</property>
                   </packing>
                 </child>
-              </object> <!-- End of main_stack -->
-              <packing>
-                <property name="pack-type">start</property>
-              </packing>
+              </object>
             </child>
-          </object> <!-- End of vbox -->
+          </object>
+          <packing>
+            <property name="name">game_box</property>
+          </packing>
         </child>
-      </object>
+      </object> <!-- End of main_stack -->
     </child>
-  </template> <!-- End of nibbles_app -->
+  </template>
 </interface>


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