[gnome-control-center] shell: Add a help overlay
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] shell: Add a help overlay
- Date: Fri, 11 Dec 2015 12:54:32 +0000 (UTC)
commit fde96cc69104ecbe45add676442b27949b3a96a6
Author: Matthias Clasen <mclasen redhat com>
Date: Thu Dec 10 20:49:59 2015 -0500
shell: Add a help overlay
This explains the various keyboard shortcuts that are available
in the control-center.
See https://wiki.gnome.org/Initiatives/GnomeGoals/ShortcutWindows
https://bugzilla.gnome.org/show_bug.cgi?id=759320
shell/Makefile.am | 9 ++++
shell/cc-application.c | 1 +
shell/gnome-control-center.gresource.xml | 6 +++
shell/help-overlay.ui | 61 ++++++++++++++++++++++++++++++
4 files changed, 77 insertions(+), 0 deletions(-)
---
diff --git a/shell/Makefile.am b/shell/Makefile.am
index f72ebe9..e9cac8b 100644
--- a/shell/Makefile.am
+++ b/shell/Makefile.am
@@ -109,10 +109,19 @@ completion_DATA = $(completion_in_files:.in=)
completions/gnome-control-center: completions/gnome-control-center.in list-panel.sh
$(AM_V_GEN) mkdir -p `dirname $ ` && cat $< | sed "s,@PANELS@,`$(srcdir)/list-panel.sh
$(top_srcdir)`," > $@
+resource_files = $(shell glib-compile-resources --generate-dependencies --sourcedir=$(srcdir)
gnome-control-center.gresource.xml)
+resources.c: gnome-control-center.gresource.xml $(resource_files)
+ $(AM_V_GEN) glib-compile-resources --target=$@ --sourcedir=$(srcdir) --generate-source $<
+
+BUILT_SOURCES = resources.c
+
EXTRA_DIST = \
gnome-control-center.desktop.in.in \
$(servicefile_in_files) \
$(completion_in_files) \
+ gnome-control-center.gresource.xml \
+ help-overlay.ui \
+ $(resource_files) \
list-panel.sh
CLEANFILES = $(BUILT_SOURCES) $(completion_DATA) $(servicefile_DATA)
diff --git a/shell/cc-application.c b/shell/cc-application.c
index 1b6b9f8..c160899 100644
--- a/shell/cc-application.c
+++ b/shell/cc-application.c
@@ -248,6 +248,7 @@ cc_application_startup (GApplication *application)
menu = g_menu_new ();
section = g_menu_new ();
+ g_menu_append (section, _("Keyboard Shortcuts"), "win.show-help-overlay");
g_menu_append (section, _("Help"), "app.help");
g_menu_append (section, _("Quit"), "app.quit");
diff --git a/shell/gnome-control-center.gresource.xml b/shell/gnome-control-center.gresource.xml
new file mode 100644
index 0000000..050f803
--- /dev/null
+++ b/shell/gnome-control-center.gresource.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<gresources>
+ <gresource prefix="/org/gnome/ControlCenter/gtk">
+ <file preprocess="xml-stripblanks">help-overlay.ui</file>
+ </gresource>
+</gresources>
diff --git a/shell/help-overlay.ui b/shell/help-overlay.ui
new file mode 100644
index 0000000..e72d5f1
--- /dev/null
+++ b/shell/help-overlay.ui
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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">10</property>
+ <child>
+ <object class="GtkShortcutsGroup">
+ <property name="visible">1</property>
+ <property name="title" translatable="yes">General</property>
+ <child>
+ <object class="GtkShortcutsShortcut">
+ <property name="visible">1</property>
+ <property name="accelerator"><ctrl>Q</property>
+ <property name="title" translatable="yes">Quit</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkShortcutsShortcut">
+ <property name="visible">1</property>
+ <property name="accelerator"><ctrl>S</property>
+ <property name="title" translatable="yes">Search</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="GtkShortcutsGroup">
+ <property name="visible">1</property>
+ <property name="title" translatable="yes">Panels</property>
+ <child>
+ <object class="GtkShortcutsShortcut">
+ <property name="visible">1</property>
+ <property name="accelerator"><Alt>Left</property>
+ <property name="title" translatable="yes">Go back to the overview</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="GtkShortcutsGroup">
+ <property name="visible">1</property>
+ <property name="title" translatable="yes">Search</property>
+ <child>
+ <object class="GtkShortcutsShortcut">
+ <property name="visible">1</property>
+ <property name="accelerator">Escape</property>
+ <property name="title" translatable="yes">Cancel search</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+</interface>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]