[gtk+] Add a help overlay to bloatpad



commit 268243834a002ee406ecd846fa66ceac42d68699
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun Apr 17 10:22:59 2016 -0400

    Add a help overlay to bloatpad
    
    This will let us explore the (non-)interaction between
    help overlays and editing shortcuts.

 examples/bp/Makefile.am             |    3 +-
 examples/bp/bloatpad.gresources.xml |    1 +
 examples/bp/gtk/help-overlay.ui     |   47 +++++++++++++++++++++++++++++++++++
 examples/bp/gtk/menus.ui            |    6 ++++
 4 files changed, 56 insertions(+), 1 deletions(-)
---
diff --git a/examples/bp/Makefile.am b/examples/bp/Makefile.am
index 6930521..d521715 100644
--- a/examples/bp/Makefile.am
+++ b/examples/bp/Makefile.am
@@ -19,7 +19,8 @@ nodist_bloatpad_SOURCES = bloatpad-gresources.c
 
 resource_files = \
        bloatpad.gresources.xml         \
-       gtk/menus.ui
+       gtk/menus.ui                    \
+       gtk/help-overlay.ui
 
 bloatpad-gresources.c: $(resource_files)
        $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir) --generate-source $<
diff --git a/examples/bp/bloatpad.gresources.xml b/examples/bp/bloatpad.gresources.xml
index 2e5c423..04650a7 100644
--- a/examples/bp/bloatpad.gresources.xml
+++ b/examples/bp/bloatpad.gresources.xml
@@ -3,5 +3,6 @@
 <gresources>
   <gresource prefix="/org/gtk/bloatpad">
     <file preprocess="xml-stripblanks">gtk/menus.ui</file>
+    <file preprocess="xml-stripblanks">gtk/help-overlay.ui</file>
   </gresource>
 </gresources>
diff --git a/examples/bp/gtk/help-overlay.ui b/examples/bp/gtk/help-overlay.ui
new file mode 100644
index 0000000..ac166b7
--- /dev/null
+++ b/examples/bp/gtk/help-overlay.ui
@@ -0,0 +1,47 @@
+<interface>
+  <!-- interface-requires gtk+ 3.17 -->
+  <object class="GtkShortcutsWindow" id="help_overlay">
+    <property name="modal">1</property>
+    <child>
+      <object class="GtkShortcutsSection">
+        <property name="visible">1</property>
+        <property name="section-name">shortcuts</property>
+        <property name="max-height">12</property>
+        <child>
+          <object class="GtkShortcutsGroup">
+            <property name="visible">1</property>
+            <property name="title">Shortcuts</property>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
+                <property name="accelerator">&lt;Primary&gt;c</property>
+                <property name="title" translatable="yes">Copy</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
+                <property name="accelerator">&lt;Primary&gt;p</property>
+                <property name="title" translatable="yes">Paste</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
+                <property name="accelerator">F11</property>
+                <property name="title" translatable="yes">Fullscreen</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
+                <property name="accelerator">&lt;Primary&gt;q</property>
+                <property name="title" translatable="yes">Quit</property>
+              </object>
+            </child>
+          </object>
+        </child>
+      </object>
+    </child>
+  </object>
+</interface>
diff --git a/examples/bp/gtk/menus.ui b/examples/bp/gtk/menus.ui
index 60abf4a..d3adad8 100644
--- a/examples/bp/gtk/menus.ui
+++ b/examples/bp/gtk/menus.ui
@@ -60,6 +60,12 @@
           <attribute name='action'>app.edit-accels</attribute>
         </item>
       </section>
+      <section>
+        <item>
+          <attribute name='label' translatable='yes'>Shortcuts...</attribute>
+          <attribute name='action'>win.show-help-overlay</attribute>
+        </item>
+      </section>
     </submenu>
     <submenu>
       <attribute name='label' translatable='yes'>_View</attribute>


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