Commit Graph

22 Commits

Author SHA1 Message Date
Benjamin Otte
580863b112 accelerators: Make gtk_accelerator_parse() return TRUE/FALSE
A parse function should return success or not. So do that.
2020-03-25 23:14:28 -04:00
Matthias Clasen
31db615885 Revert "Merge branch 'disable-window-test' into 'master'"
This reverts commit 3ac4c76b18, reversing
changes made to 6ec96d2e98.
2020-03-19 18:03:16 -04:00
Benjamin Otte
87df17e4ce accelerators: Make gtk_accelerator_parse() return TRUE/FALSE
A parse function should return success or not. So do that.
2020-03-18 23:00:51 -04:00
Timm Bäder
68b4c061cf shortcutlabel: Remove unnecessary includes 2020-02-25 11:08:25 +01:00
Benjamin Otte
fce37b137d gdk: Make gdk_keyval_name() return a const char
The string is const, so return it like that.
2020-02-09 16:50:22 -05:00
Timm Bäder
655711fef2 Rename gtk_widget{get,set,has}_style_class to _css_class
We want to use css instead of style everywhere now.
2020-02-07 13:16:45 -05:00
Timm Bäder
b7ee2cbc28 Start using GtkWidget's new style class API 2020-02-07 13:16:32 -05:00
Timm Bäder
bb2c68452c shortcutlabel: Inherit from GtkWidget 2019-10-22 09:37:07 +02:00
Matthias Clasen
4c150d8eb5 The big versioning cleanup
Remove all the old 2.x and 3.x version annotations.
GTK+ 4 is a new start, and from the perspective of a
GTK+ 4 developer all these APIs have been around since
the beginning.
2018-02-06 01:16:32 -05:00
Timm Bäder
56a58655fe Remove unnecessary gtk_widget_show calls 2017-01-22 14:38:21 +01:00
Christian Hergert
a68915abd1 shortcuts: the accelerator should always be LTR
Even on RTL languages, we want the shortcut to be LTR so that we always
have <control> to the left of the accel keyval.

https://bugzilla.gnome.org/show_bug.cgi?id=772695
2016-10-10 13:56:48 -07:00
Georges Basile Stavracas Neto
ddee89f4a3 shortcut-label: add 'disabled-text' property
When there's no useful shortcut accelerator set,
GtkShortcutLabel doesn't show any useful information.

To work around that, add a new property to set the
text to be displayed when there's no accelerator
available.

https://bugzilla.gnome.org/show_bug.cgi?id=769205
2016-07-27 16:30:43 -03:00
Georges Basile Stavracas Neto
7543cd8ce4 shortcut-label: make it public
GtkShortcutLabel is a widget that displays a single
shortcut accelerator or gesture in the user interface,
and is currently used by the shortcuts window.

This widget, however, has public value as other applications
also may want to expose their own shortcuts. For instance,
it'll be useful for the Keyboard panel on Control Center and
the new shortcut editor in Pitivi, among others.

This patch exposes GtkShortcutLabel as a public widget,
and adds the necessary documentation.

https://bugzilla.gnome.org/show_bug.cgi?id=769205
2016-07-27 16:30:31 -03:00
Matthias Clasen
1c6b878e09 shortcuts window: Fix handling of significant xml chars
We are using markup in the labels, so we need to escape things
like < and >.

https://bugzilla.gnome.org/show_bug.cgi?id=767795
2016-06-19 17:49:03 -04:00
Timm Bäder
6a97b2563b shortcutlabel: Use a label directly
We can everything we need without the frame around it now.
2016-01-14 16:02:12 +01:00
Matthias Clasen
03769e3830 shortcut label: Tweak modifier key rendering
The subscript was affecting the vertical alignment too much,
so tweak the rendering of the L/R markers to avoid that. Also,
mark these as translatable.
2015-12-04 13:22:26 -05:00
Matthias Clasen
8768c0b8ac shortcuts: Extend the accelerator syntax more
Cover cases like left+right control, and render them nicely.
The gtk3-demo builder shortcuts example shows the new
possibilities.
2015-12-04 10:56:48 -05:00
Matthias Clasen
705d371362 help overlay: Allow key sequences
Extend the syntax to allow sequences of keys or key combinations,
e.g. t+t or <ctl>c+<ctl>x.

https://bugzilla.gnome.org/show_bug.cgi?id=758051
2015-11-14 21:34:43 -05:00
Matthias Clasen
62ec4a2415 shortcuts label: Redo the keycap theming
Use a style class directly on the frame. This is easier to reuse.
2015-10-28 10:19:00 -04:00
Matthias Clasen
71b79f3329 shortcut: Improve formatting of ranges
Use a centered ellipsis, to make it look nicer.
2015-10-23 07:46:31 -04:00
Matthias Clasen
67a54bf4ef shortcuts: Support ranges in the display of shortcuts
Repeating Alt-1 to Alt-9 as individual shortcuts looks really boring,
so allow compressing such ranges by specifying <Alt>1...9.
2015-10-22 14:32:50 -04:00
Matthias Clasen
1dfbae1aa4 Add GtkShortcutsWindow
This is a toplevel window that is tailored towards showing
help for shortcuts in an application. The implementation closely
follows this design: https://wiki.gnome.org/Design/OS/HelpOverlay

This implementation is inspired by earlier work in gnome-builder,
thanks to Christian Hergert.

https://bugzilla.gnome.org/show_bug.cgi?id=756428
2015-10-21 15:19:34 -04:00