docs: Add GtkShortcutsWindow to the widget gallery

This commit is contained in:
Matthias Clasen 2020-10-26 00:56:28 -04:00
parent d9259fc958
commit b67eee5741
7 changed files with 149 additions and 1 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

View File

@ -354,6 +354,7 @@ images = [
'images/search-bar.png',
'images/search-entry.png',
'images/separator.png',
'images/shortcuts-window.png',
'images/sidebar.png',
'images/slices.png',
'images/sliders.png',

View File

@ -96,6 +96,7 @@
<link linkend="GtkAppChooserDialog"><inlinegraphic fileref="appchooserdialog.png" format="PNG"></inlinegraphic></link>
<link linkend="GtkPageSetupUnixDialog"><inlinegraphic fileref="pagesetupdialog.png" format="PNG"></inlinegraphic></link>
<link linkend="GtkPrintUnixDialog"><inlinegraphic fileref="printdialog.png" format="PNG"></inlinegraphic></link>
<link linkend="GtkShortcutsWindow"><inlinegraphic fileref="shortcuts-window.png" format="PNG"></inlinegraphic></link>
</para>
</section>
</para>

View File

@ -1,4 +1,8 @@
if get_option('gtk_doc')
doc_shooter_resources = gnome.compile_resources('shooter_resources',
'shooter.gresource.xml',
source_dir: '.')
doc_shooter_sources = [
'shooter.c',
'shadow.c',
@ -6,7 +10,8 @@ if get_option('gtk_doc')
'../../tests/gtkgears.c',
]
doc_shooter = executable('doc-shooter', doc_shooter_sources,
doc_shooter = executable('doc-shooter',
doc_shooter_sources, doc_shooter_resources,
include_directories: [ confinc, gdkinc, gtkinc, testinc, ],
dependencies: libgtk_dep)
endif

View File

@ -0,0 +1,5 @@
<gresources>
<gresource prefix="/">
<file>shortcuts-boxes.ui</file>
</gresource>
</gresources>

View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<object class="GtkShortcutsWindow" id="shortcuts-boxes">
<property name="modal">1</property>
<child>
<object class="GtkShortcutsSection">
<property name="section-name">shortcuts</property>
<property name="max-height">12</property>
<child>
<object class="GtkShortcutsGroup">
<property name="title" translatable="yes">Overview</property>
<property name="view">overview</property>
<child>
<object class="GtkShortcutsShortcut">
<property name="accelerator">F1</property>
<property name="title" translatable="yes">Help</property>
</object>
</child>
<child>
<object class="GtkShortcutsShortcut">
<property name="accelerator">&lt;Ctrl&gt;n</property>
<property name="title" translatable="yes">Create a new box</property>
</object>
</child>
<child>
<object class="GtkShortcutsShortcut">
<property name="accelerator">&lt;Ctrl&gt;f</property>
<property name="title" translatable="yes">Search</property>
</object>
</child>
<child>
<object class="GtkShortcutsShortcut">
<property name="accelerator">&lt;Ctrl&gt;k</property>
<property name="title" translatable="yes">Keyboard shortcuts</property>
</object>
</child>
<child>
<object class="GtkShortcutsShortcut">
<property name="accelerator">&lt;Ctrl&gt;q</property>
<property name="title" translatable="yes">Close Window/Quit Boxes</property>
</object>
</child>
</object>
</child>
<child>
<object class="GtkShortcutsGroup">
<property name="title" translatable="yes">Box Creation and Properties</property>
<property name="view">wizard</property>
<child>
<object class="GtkShortcutsShortcut">
<property name="direction">ltr</property>
<property name="accelerator">&lt;Alt&gt;Right</property>
<property name="title" translatable="yes">Switch to the next page</property>
</object>
</child>
<child>
<object class="GtkShortcutsShortcut">
<property name="direction">ltr</property>
<property name="accelerator">&lt;Alt&gt;Left</property>
<property name="title" translatable="yes">Switch to the previous page</property>
</object>
</child>
<child>
<object class="GtkShortcutsShortcut">
<property name="direction">rtl</property>
<property name="accelerator">&lt;Alt&gt;Left</property>
<property name="title" translatable="yes">Switch to the next page</property>
</object>
</child>
<child>
<object class="GtkShortcutsShortcut">
<property name="direction">rtl</property>
<property name="accelerator">&lt;Alt&gt;Right</property>
<property name="title" translatable="yes">Switch to the previous page</property>
</object>
</child>
</object>
</child>
<child>
<object class="GtkShortcutsGroup">
<property name="title" translatable="yes">Box Display</property>
<property name="view">display</property>
<child>
<object class="GtkShortcutsShortcut">
<property name="accelerator">Control_L+Alt_L</property>
<property name="title" translatable="yes">Grab/Ungrab keyboard</property>
</object>
</child>
<child>
<object class="GtkShortcutsShortcut">
<property name="direction">ltr</property>
<property name="accelerator">&lt;Alt&gt;Left</property>
<property name="title" translatable="yes">Back to overview</property>
</object>
</child>
<child>
<object class="GtkShortcutsShortcut">
<property name="direction">rtl</property>
<property name="accelerator">&lt;Alt&gt;Right</property>
<property name="title" translatable="yes">Back to overview</property>
</object>
</child>
<child>
<object class="GtkShortcutsShortcut">
<property name="accelerator">&lt;Ctrl&gt;q</property>
<property name="title" translatable="yes">Close window/Quit Boxes</property>
</object>
</child>
<child>
<object class="GtkShortcutsShortcut">
<property name="accelerator">F11</property>
<property name="title" translatable="yes">Fullscreen/Restore from fullscreen</property>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</interface>

View File

@ -1726,6 +1726,21 @@ create_menu (void)
return new_widget_info ("menu", widget, ASIS);
}
static WidgetInfo *
create_shortcuts_window (void)
{
GtkBuilder *builder;
GtkWidget *overlay;
builder = gtk_builder_new_from_resource ("/shortcuts-boxes.ui");
overlay = GTK_WIDGET (gtk_builder_get_object (builder, "shortcuts-boxes"));
g_object_set (overlay, "view-name", "display", NULL);
g_object_ref (overlay);
g_object_unref (builder);
return new_widget_info ("shortcuts-window", overlay, ASIS);
}
GList *
get_all_widgets (void)
{
@ -1798,6 +1813,7 @@ get_all_widgets (void)
retval = g_list_prepend (retval, create_menu_bar ());
retval = g_list_prepend (retval, create_popover ());
retval = g_list_prepend (retval, create_menu ());
retval = g_list_prepend (retval, create_shortcuts_window ());
return retval;
}