ShortcutLabel#
Added in version 1.8.
Superclasses: Widget, InitiallyUnowned, Object
Implemented Interfaces: Accessible, Buildable, ConstraintTarget
A widget that displays a keyboard shortcut.
The shown shortcut can be set using the accelerator
property.
Optionally, if no shortcut is set, AdwShortcutLabel will display a
placeholder set with the disabled_text property.
The following types of shortcuts can be displayed:
A single shortcut in
accelerator_parseformat, e.g.<Control>C:
Multiple alternative shortcuts, separated with spaces, e.g.
<Shift>A Home:
A range of shortcuts, separated with
..., e.g.<Alt>1...9:
Multiple keys pressed at once, separated with
&, e.g.Control_L&Control_R:
Multiple shortcuts or keys, pressed sequentially, separated with
+, e.g.<Control>C+<Control>X:
- ::: note
<,>and&need to be escaped as<,>and&when used in UI files.
CSS nodes#
AdwShortcutLabel has a single CSS node with name shortcut-label. The
individual keycap labels each have the .keycap style class, while the
labels separating them have the .dimmed style class.
Accessibility#
AdwShortcutLabel uses the label role.
See also: ShortcutsDialog.