[bijiben] Add a shortcuts window



commit 5f83a5eb21ca5a8ca9570d32dcf8a1d92916a00a
Author: Jonathan Kang <jonathan121537 gmail com>
Date:   Wed Dec 27 11:26:12 2017 +0800

    Add a shortcuts window
    
    GtkShortcutsWindow is introduced in GTK+ 3.19.x, and it shows an
    overview of shortcuts and touch gestures for an application. So it's
    a nice thing to have in bijiben. As this GNOME wiki[0] describes,
    add a shortcuts window to bijiben.
    
    *[0] https://wiki.gnome.org/Initiatives/GnomeGoals/ShortcutWindows
    
    https://bugzilla.gnome.org/show_bug.cgi?id=757834

 data/bjb.gresource.xml         |    1 +
 data/resources/app-menu.ui     |    4 ++
 data/resources/help-overlay.ui |  111 ++++++++++++++++++++++++++++++++++++++++
 meson.build                    |    2 +-
 po/POTFILES.in                 |    1 +
 5 files changed, 118 insertions(+), 1 deletions(-)
---
diff --git a/data/bjb.gresource.xml b/data/bjb.gresource.xml
index d07bfc3..76718a7 100644
--- a/data/bjb.gresource.xml
+++ b/data/bjb.gresource.xml
@@ -12,6 +12,7 @@
 
   <gresource prefix="/org/gnome/bijiben/gtk">
     <file alias="menus.ui">resources/app-menu.ui</file>
+    <file alias="help-overlay.ui">resources/help-overlay.ui</file>
   </gresource>
     
   <gresource prefix="/org/gnome/bijiben/ui">
diff --git a/data/resources/app-menu.ui b/data/resources/app-menu.ui
index c26c945..41babe3 100644
--- a/data/resources/app-menu.ui
+++ b/data/resources/app-menu.ui
@@ -22,6 +22,10 @@
         <attribute name="action">app.help</attribute>
       </item>
       <item>
+        <attribute name="label" translatable="yes">_Keyboard Shortcuts</attribute>
+        <attribute name="action">win.show-help-overlay</attribute>
+      </item>
+      <item>
         <attribute name="label" translatable="yes">_About</attribute>
         <attribute name="action">app.about</attribute>
       </item>
diff --git a/data/resources/help-overlay.ui b/data/resources/help-overlay.ui
new file mode 100644
index 0000000..ec2fb8e
--- /dev/null
+++ b/data/resources/help-overlay.ui
@@ -0,0 +1,111 @@
+<interface domain="bijiben">
+    <object class="GtkShortcutsWindow" id="help_overlay">
+        <child>
+            <object class="GtkShortcutsSection">
+                <property name="visible">True</property>
+                <child>
+                    <object class="GtkShortcutsGroup">
+                        <property name="title" translatable="yes" context="shortcut 
window">General</property>
+                        <property name="visible">True</property>
+                        <child>
+                            <object class="GtkShortcutsShortcut">
+                                <property name="accelerator">&lt;Primary&gt;n</property>
+                                <property name="title" translatable="yes" context="shortcut window">New 
note</property>
+                                <property name="visible">True</property>
+                            </object>
+                        </child>
+                        <child>
+                            <object class="GtkShortcutsShortcut">
+                                <property name="accelerator">&lt;Primary&gt;q</property>
+                                <property name="title" translatable="yes" context="shortcut window">Close 
window</property>
+                                <property name="visible">True</property>
+                            </object>
+                        </child>
+                        <child>
+                            <object class="GtkShortcutsShortcut">
+                                <property name="accelerator">F1</property>
+                                <property name="title" translatable="yes" context="shortcut window">Show 
help</property>
+                                <property name="visible">True</property>
+                            </object>
+                        </child>
+                        <child>
+                            <object class="GtkShortcutsShortcut">
+                                <property name="visible">True</property>
+                                <property name="title" translatable="yes" context="shortcut 
window">Shortcuts</property>
+                                <property name="accelerator">&lt;Primary&gt;question 
&lt;Primary&gt;F1</property>
+                            </object>
+                        </child>
+                    </object>
+                </child>
+                <child>
+                    <object class="GtkShortcutsGroup">
+                        <property name="title" translatable="yes" context="shortcut window">Selection 
mode</property>
+                        <property name="visible">True</property>
+                        <child>
+                            <object class="GtkShortcutsShortcut">
+                                <property name="accelerator">Escape</property>
+                                <property name="title" translatable="yes" context="shortcut window">Cancel 
selection mode</property>
+                                <property name="visible">True</property>
+                            </object>
+                        </child>
+                        <child>
+                            <object class="GtkShortcutsShortcut">
+                                <property name="accelerator">&lt;Primary&gt;a</property>
+                                <property name="title" translatable="yes" context="shortcut window">Select 
all</property>
+                                <property name="visible">True</property>
+                            </object>
+                        </child>
+                    </object>
+                </child>
+                <child>
+                    <object class="GtkShortcutsGroup">
+                        <property name="title" translatable="yes" context="shortcut window">Note edit 
mode</property>
+                        <property name="visible">True</property>
+                        <child>
+                            <object class="GtkShortcutsShortcut">
+                                <property name="accelerator">&lt;Primary&gt;b</property>
+                                <property name="title" translatable="yes" context="shortcut 
window">Bold</property>
+                                <property name="visible">True</property>
+                            </object>
+                        </child>
+                        <child>
+                            <object class="GtkShortcutsShortcut">
+                                <property name="accelerator">&lt;Primary&gt;i</property>
+                                <property name="title" translatable="yes" context="shortcut 
window">Italic</property>
+                                <property name="visible">True</property>
+                            </object>
+                        </child>
+                        <child>
+                            <object class="GtkShortcutsShortcut">
+                                <property name="accelerator">&lt;Primary&gt;s</property>
+                                <property name="title" translatable="yes" context="shortcut window">Strike 
through</property>
+                                <property name="visible">True</property>
+                            </object>
+                        </child>
+                        <child>
+                            <object class="GtkShortcutsShortcut">
+                                <property name="accelerator">&lt;Primary&gt;z</property>
+                                <property name="title" translatable="yes" context="shortcut 
window">Undo</property>
+                                <property name="visible">True</property>
+                            </object>
+                        </child>
+                        <child>
+                            <object class="GtkShortcutsShortcut">
+                                <property name="accelerator">&lt;Primary&gt;&lt;Shift&gt;z</property>
+                                <property name="title" translatable="yes" context="shortcut 
window">Redo</property>
+                                <property name="visible">True</property>
+                            </object>
+                        </child>
+                        <child>
+                            <object class="GtkShortcutsShortcut">
+                                <property name="accelerator">&lt;Primary&gt;Delete</property>
+                                <property name="title" translatable="yes" context="shortcut window">Move 
note to trash</property>
+                                <property name="visible">True</property>
+                            </object>
+                        </child>
+                    </object>
+                </child>
+            </object>
+        </child>
+    </object>
+</interface>
diff --git a/meson.build b/meson.build
index 2db0b27..851177a 100644
--- a/meson.build
+++ b/meson.build
@@ -110,7 +110,7 @@ bijiben_deps = [
   dependency('gio-unix-2.0'),
   dependency('glib-2.0', version: '>= 2.53.4'),
   dependency('goa-1.0'),
-  dependency('gtk+-3.0', version: '>= 3.11.4'),
+  dependency('gtk+-3.0', version: '>= 3.19.3'),
   dependency('libecal-1.2', version: '>= 3.13.90'),
   dependency('libedataserver-1.2', version: '>= 3.13.90'),
   dependency('libxml-2.0'),
diff --git a/po/POTFILES.in b/po/POTFILES.in
index b08e90a..cd118c3 100755
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -6,6 +6,7 @@ data/org.gnome.bijiben.xml.in
 data/resources/app-menu.ui
 data/resources/editor-toolbar.ui
 data/resources/empty-results-box.ui
+data/resources/help-overlay.ui
 data/resources/import-dialog.ui
 data/resources/organize-dialog.ui
 data/resources/selection-toolbar.ui


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