From fde96cc69104ecbe45add676442b27949b3a96a6 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Thu, 10 Dec 2015 20:49:59 -0500 Subject: [PATCH] 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(+) create mode 100644 shell/gnome-control-center.gresource.xml create mode 100644 shell/help-overlay.ui diff --git a/shell/Makefile.am b/shell/Makefile.am index f72ebe918..e9cac8b55 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 1b6b9f8fe..c160899b2 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 000000000..050f8034e --- /dev/null +++ b/shell/gnome-control-center.gresource.xml @@ -0,0 +1,6 @@ + + + + help-overlay.ui + + diff --git a/shell/help-overlay.ui b/shell/help-overlay.ui new file mode 100644 index 000000000..e72d5f155 --- /dev/null +++ b/shell/help-overlay.ui @@ -0,0 +1,61 @@ + + + + + + 1 + + + 1 + shortcuts + 10 + + + 1 + General + + + 1 + <ctrl>Q + Quit + + + + + 1 + <ctrl>S + Search + + + + + + + 1 + Panels + + + 1 + <Alt>Left + Go back to the overview + + + + + + + 1 + Search + + + 1 + Escape + Cancel search + + + + + + + +