[gtk/matthiasc/for-master: 6/7] docs: Add GtkShortcutsWindow to the widget gallery
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/matthiasc/for-master: 6/7] docs: Add GtkShortcutsWindow to the widget gallery
- Date: Mon, 26 Oct 2020 05:12:31 +0000 (UTC)
commit b67eee5741646781acd02f791338140f746b8e96
Author: Matthias Clasen <mclasen redhat com>
Date: Mon Oct 26 00:56:28 2020 -0400
docs: Add GtkShortcutsWindow to the widget gallery
docs/reference/gtk/images/shortcuts-window.png | Bin 0 -> 23118 bytes
docs/reference/gtk/meson.build | 1 +
docs/reference/gtk/visual_index.xml | 1 +
docs/tools/meson.build | 7 +-
docs/tools/shooter.gresource.xml | 5 ++
docs/tools/shortcuts-boxes.ui | 120 +++++++++++++++++++++++++
docs/tools/widgets.c | 16 ++++
7 files changed, 149 insertions(+), 1 deletion(-)
---
diff --git a/docs/reference/gtk/images/shortcuts-window.png b/docs/reference/gtk/images/shortcuts-window.png
new file mode 100644
index 0000000000..3cc9cb0c5b
Binary files /dev/null and b/docs/reference/gtk/images/shortcuts-window.png differ
diff --git a/docs/reference/gtk/meson.build b/docs/reference/gtk/meson.build
index 8b2a8115d3..4e72c167da 100644
--- a/docs/reference/gtk/meson.build
+++ b/docs/reference/gtk/meson.build
@@ -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',
diff --git a/docs/reference/gtk/visual_index.xml b/docs/reference/gtk/visual_index.xml
index bac57788ab..82fc571465 100644
--- a/docs/reference/gtk/visual_index.xml
+++ b/docs/reference/gtk/visual_index.xml
@@ -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>
diff --git a/docs/tools/meson.build b/docs/tools/meson.build
index 71473c9e50..d9a9afb359 100644
--- a/docs/tools/meson.build
+++ b/docs/tools/meson.build
@@ -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
diff --git a/docs/tools/shooter.gresource.xml b/docs/tools/shooter.gresource.xml
new file mode 100644
index 0000000000..67385b6bd8
--- /dev/null
+++ b/docs/tools/shooter.gresource.xml
@@ -0,0 +1,5 @@
+<gresources>
+ <gresource prefix="/">
+ <file>shortcuts-boxes.ui</file>
+ </gresource>
+</gresources>
diff --git a/docs/tools/shortcuts-boxes.ui b/docs/tools/shortcuts-boxes.ui
new file mode 100644
index 0000000000..c55037a389
--- /dev/null
+++ b/docs/tools/shortcuts-boxes.ui
@@ -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"><Ctrl>n</property>
+ <property name="title" translatable="yes">Create a new box</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkShortcutsShortcut">
+ <property name="accelerator"><Ctrl>f</property>
+ <property name="title" translatable="yes">Search</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkShortcutsShortcut">
+ <property name="accelerator"><Ctrl>k</property>
+ <property name="title" translatable="yes">Keyboard shortcuts</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkShortcutsShortcut">
+ <property name="accelerator"><Ctrl>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"><Alt>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"><Alt>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"><Alt>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"><Alt>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"><Alt>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"><Alt>Right</property>
+ <property name="title" translatable="yes">Back to overview</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkShortcutsShortcut">
+ <property name="accelerator"><Ctrl>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>
diff --git a/docs/tools/widgets.c b/docs/tools/widgets.c
index 6500291b0a..c99cef1d06 100644
--- a/docs/tools/widgets.c
+++ b/docs/tools/widgets.c
@@ -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;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]