[gnome-klotski/gnome-3-34] Readd some shortcut.



commit 127fa9af17825db214043d836f59467996d310bb
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date:   Sat Jan 4 12:12:34 2020 +0100

    Readd some shortcut.
    
    Fixes #11.

 data/klotski.ui        |  1 -
 src/gnome-klotski.vala | 21 ++++++++++++++-------
 2 files changed, 14 insertions(+), 8 deletions(-)
---
diff --git a/data/klotski.ui b/data/klotski.ui
index 58c0908..fb2d8f6 100644
--- a/data/klotski.ui
+++ b/data/klotski.ui
@@ -12,7 +12,6 @@
       <item>
         <attribute name="label" translatable="yes">_Help</attribute>
         <attribute name="action">app.help</attribute>
-        <attribute name="accel">F1</attribute>
       </item>
       <item>
         <attribute name="label" translatable="yes">_About Klotski</attribute>
diff --git a/src/gnome-klotski.vala b/src/gnome-klotski.vala
index 0bf3c44..35a3068 100644
--- a/src/gnome-klotski.vala
+++ b/src/gnome-klotski.vala
@@ -70,13 +70,20 @@ public class Klotski : Gtk.Application
 
         add_window (new KlotskiWindow ());
 
-        // set_accels_for_action ("win.start-game", {"<Primary>n"}); /* or <Primary>r ? or both ? */
-        set_accels_for_action ("win.prev-puzzle", {"Up"});       // TODO
-        set_accels_for_action ("win.next-puzzle", {"Down"});     // TODO a weird behaviour exists when you 
first change puzzle pack, then go to
-        set_accels_for_action ("win.prev-pack", {"Page_Up"});    // TODO the first/last one, click on a 
puzzle, and immediatly hit Up or Down arrows.
-        set_accels_for_action ("win.next-pack", {"Page_Down"});  // TODO that makes these keybindings 
sometimes act strangely, but they’re good.
-
-        set_accels_for_action ("app.quit", {"<Primary>q"});
+        set_accels_for_action ("win.prev-puzzle",   {"Up"});        // TODO
+        set_accels_for_action ("win.next-puzzle",   {"Down"});      // TODO a weird behaviour exists when 
you first change puzzle pack, then go to
+        set_accels_for_action ("win.prev-pack",     {"Page_Up"});   // TODO the first/last one, click on a 
puzzle, and immediatly hit Up or Down arrows.
+        set_accels_for_action ("win.next-pack",     {"Page_Down"}); // TODO that makes these keybindings 
sometimes act strangely, but they’re good.
+
+        set_accels_for_action ("win.start-game",    { "<Shift><Primary>n",
+                                                      "<Shift><Primary>r"   }); // TODO just <Primary>n/r?
+
+        set_accels_for_action ("app.scores",        {        "<Primary>s",      // TODO that's a weird 
shortcut
+                                                      "<Shift><Primary>s"   });
+        set_accels_for_action ("app.help",          {                 "F1"  });
+        set_accels_for_action ("app.about",         {          "<Shift>F1"  });
+        set_accels_for_action ("app.quit",          {        "<Primary>q",
+                                                      "<Shift><Primary>q"   });
     }
 
     protected override void activate ()


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