summaryrefslogtreecommitdiff
path: root/examples/bp
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2016-04-17 10:22:59 -0400
committerMatthias Clasen <mclasen@redhat.com>2016-04-17 13:42:14 -0400
commit268243834a002ee406ecd846fa66ceac42d68699 (patch)
tree79e26f1fa0b074d45f06fe697ce04ffb1503d028 /examples/bp
parentcf144ea26f84f0121a2f681f6d408f4a8e1851ed (diff)
downloadgtk+-268243834a002ee406ecd846fa66ceac42d68699.tar.gz
Add a help overlay to bloatpad
This will let us explore the (non-)interaction between help overlays and editing shortcuts.
Diffstat (limited to 'examples/bp')
-rw-r--r--examples/bp/Makefile.am3
-rw-r--r--examples/bp/bloatpad.gresources.xml1
-rw-r--r--examples/bp/gtk/help-overlay.ui47
-rw-r--r--examples/bp/gtk/menus.ui6
4 files changed, 56 insertions, 1 deletions
diff --git a/examples/bp/Makefile.am b/examples/bp/Makefile.am
index 6930521002..d521715eae 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 2e5c42314b..04650a7212 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 0000000000..ac166b79a7
--- /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 60abf4adb8..d3adad8e4a 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>