Add a help overlay to bloatpad

This will let us explore the (non-)interaction between
help overlays and editing shortcuts.
This commit is contained in:
Matthias Clasen 2016-04-17 10:22:59 -04:00
parent cf144ea26f
commit 268243834a
4 changed files with 56 additions and 1 deletions

View File

@ -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 $<

View File

@ -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>

View File

@ -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>

View File

@ -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>