[lightsoff/arnaudb/rework-ui: 1/7] Add a "Start Puzzle" menu button.




commit be2b2ea6d5693393d29a771a5c6fc3c664395afb
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date:   Thu Oct 29 14:01:41 2020 +0100

    Add a "Start Puzzle" menu button.
    
    That will clarify that "Start Over"
    does not mean "Restart", and aligns
    with other games (notably Klotski).

 data/lightsoff-menus.ui | 20 --------------------
 data/lightsoff.ui       | 34 ++++++++++++++++++++++++++++++++++
 2 files changed, 34 insertions(+), 20 deletions(-)
---
diff --git a/data/lightsoff-menus.ui b/data/lightsoff-menus.ui
index d25a0eb..ab1f4ec 100644
--- a/data/lightsoff-menus.ui
+++ b/data/lightsoff-menus.ui
@@ -2,26 +2,6 @@
 <interface>
   <requires lib="gtk+" version="3.12"/>
   <menu id="primary-menu">
-    <section>
-      <item>
-        <!-- Translators: entry of the window menu (with a mnemonic that appears when pressing Alt); 
restarts the current level  -->
-        <attribute name="label" translatable="yes">_Start Over</attribute>
-        <attribute name="action">win.new-game</attribute>
-        <attribute name="accel">&lt;Primary&gt;n</attribute>
-      </item>
-      <item>
-        <!-- Translators: entry of the window menu (with a mnemonic that appears when pressing Alt); switch 
to previous level -->
-        <attribute name="label" translatable="yes">_Previous puzzle</attribute>
-        <attribute name="action">win.previous-level</attribute>
-        <attribute name="accel">&lt;Primary&gt;Page_Up</attribute>
-      </item>
-      <item>
-        <!-- Translators: entry of the window menu (with a mnemonic that appears when pressing Alt); switch 
to next level -->
-        <attribute name="label" translatable="yes">Ne_xt puzzle</attribute>
-        <attribute name="action">win.next-level</attribute>
-        <attribute name="accel">&lt;Primary&gt;Page_Down</attribute>
-      </item>
-    </section>
     <section>
       <item>
         <!-- Translators: entry of the window menu (with a mnemonic that appears when pressing Alt); show 
application help -->
diff --git a/data/lightsoff.ui b/data/lightsoff.ui
index 5088238..d151a89 100644
--- a/data/lightsoff.ui
+++ b/data/lightsoff.ui
@@ -1,6 +1,29 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!-- Generated with glade 3.22.1 -->
 <interface>
+  <menu id="change-level-menu">
+    <section>
+      <item>
+        <!-- Translators: entry of the window menu (with a mnemonic that appears when pressing Alt); switch 
to the first level  -->
+        <attribute name="label" translatable="yes">_Start Over</attribute>
+        <attribute name="action">win.new-game</attribute>
+        <attribute name="accel">&lt;Primary&gt;n</attribute>
+      </item>
+      <item>
+        <!-- Translators: entry of the window menu (with a mnemonic that appears when pressing Alt); switch 
to previous level -->
+        <attribute name="label" translatable="yes">_Previous puzzle</attribute>
+        <attribute name="action">win.previous-level</attribute>
+        <attribute name="accel">&lt;Primary&gt;Page_Up</attribute>
+      </item>
+      <item>
+        <!-- Translators: entry of the window menu (with a mnemonic that appears when pressing Alt); switch 
to next level -->
+        <attribute name="label" translatable="yes">Ne_xt puzzle</attribute>
+        <attribute name="action">win.next-level</attribute>
+        <attribute name="accel">&lt;Primary&gt;Page_Down</attribute>
+      </item>
+    </section>
+  </menu>
+
   <requires lib="gtk+" version="3.12"/>
   <template class="LightsoffWindow" parent="ManagedWindow">
     <property name="can_focus">False</property>
@@ -11,6 +34,17 @@
         <property name="title" translatable="no">Puzzle X</property>
         <property name="subtitle" translatable="no">y moves</property>
         <property name="show_close_button">True</property>
+        <child>
+          <object class="GtkMenuButton">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="receives_default">False</property>
+            <property name="use_underline">True</property>
+            <!-- Translators: label of a button, in the headerbar (with a mnemonic that appears when 
pressing Alt); pops up a menu for going previous/next level -->
+            <property name="label" translatable="yes">_Change Puzzle</property>
+            <property name="menu_model">change-level-menu</property>
+          </object>
+        </child>
         <child>
           <object class="GtkMenuButton" id="menu_button">
             <property name="visible">True</property>


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