After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 757837 - Provide a shortcuts window
Provide a shortcuts window
Status: RESOLVED FIXED
Product: gnome-clocks
Classification: Applications
Component: general
3.18.x
Other Linux
: Normal normal
: ---
Assigned To: Clocks maintainer(s)
Clocks maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2015-11-09 17:01 UTC by Allan Day
Modified: 2015-12-12 17:07 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add a help overlay (7.74 KB, patch)
2015-12-09 12:40 UTC, Matthias Clasen
none Details | Review

Description Allan Day 2015-11-09 17:01:42 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
Comment 1 Matthias Clasen 2015-12-09 12:40:33 UTC
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
Comment 2 Paolo Borelli 2015-12-09 23:27:29 UTC
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...
Comment 3 Anders Jonsson 2015-12-12 15:26:32 UTC
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.
Comment 4 Anders Jonsson 2015-12-12 15:41:13 UTC
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...
Comment 5 Anders Jonsson 2015-12-12 15:48:00 UTC
(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.
Comment 6 Anders Jonsson 2015-12-12 17:07:09 UTC
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