GNOME Bugzilla – Bug 757837
Provide a shortcuts window
Last modified: 2015-12-12 17:07:09 UTC
Since Clocks doesn't have a menu bar, it would be great to provide a GtkShortcutsWindow so that users can discover available keyboard shortcuts. More details can be found here: https://wiki.gnome.org/Initiatives/GnomeGoals/ShortcutWindows
Created attachment 317017 [details] [review] Add a help overlay This is just copying the example from gtk3-demo. Some more work needed: - Verify that all the shortcuts are accurate and existing - Add code to set the "view" on the shortcuts window, both initially and whenever the current view changes in the application
I fixed up and pushed the patch, so this is fixed and we have an help overlay. With that said, our current story with regard to keyboard shortcuts is pretty poor, I had to remove quite a few from Matthias list. We should at least add shortcuts to start/stop/lap/reset in the stopwatch and timer...
That commit breaks compilation of gnome-clocks for me: src/window.vala:84.32-84.47: error: The name `get_help_overlay' does not exist in the context of `Clocks.Window.new._lambda42_' var help_overlay = get_help_overlay (); ^^^^^^^^^^^^^^^^ src/window.vala:84.17-84.50: error: var declaration not allowed with non-typed initializer var help_overlay = get_help_overlay (); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ src/window.vala:85.13-85.24: error: The name `help_overlay' does not exist in the context of `Clocks.Window.new._lambda42_' help_overlay.view_name = Type.from_instance(stack.visible_child).name(); ^^^^^^^^^^^^ Compilation failed: 3 error(s), 0 warning(s) Reverting Commit a5c5247b358e46bff06a4319b266ab7c9f2978cf fixes compilation for me.
I see. In data/gtk/help-overlay.ui: <!-- interface-requires gtk+ 3.17 --> But configure.ac only requires gtk+-3.0 >= 3.9.11 , so that's the reason why autogen.sh completes without complaints...
(In reply to Anders Jonsson from comment #4) > I see. In data/gtk/help-overlay.ui: > > <!-- interface-requires gtk+ 3.17 --> > > > But configure.ac only requires gtk+-3.0 >= 3.9.11 , so that's the reason why > autogen.sh completes without complaints... Sorry about the noise, I see I already have gtk+ 3.18.5 on my system (Debian testing), so the problem is probably not that, unless an even newer version is needed.
Ah, get_help_overlay is a recent addition to vala: https://git.gnome.org/browse/vala/commit/?id=a06c73d112ae8760d74c045409761dfc0a72ef01 , and that commit talks about GTK+ 3.19.0