:right-sidebar: True ShortcutsDialog =================================================================== .. currentmodule:: gi.repository.Adw .. versionadded:: 1.8 .. class:: ShortcutsDialog(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.Adw.Dialog`, :class:`~gi.repository.Gtk.Widget`, :class:`~gi.repository.GObject.InitiallyUnowned`, :class:`~gi.repository.GObject.Object` Implemented Interfaces: :class:`~gi.repository.Gtk.Accessible`, :class:`~gi.repository.Gtk.Buildable`, :class:`~gi.repository.Gtk.ConstraintTarget`, :class:`~gi.repository.Gtk.ShortcutManager` A dialog that displays application's keyboard shortcuts. .. image:: https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/shortcuts-dialog.png Shortcuts are grouped into sections, represented by :obj:`~gi.repository.Adw.ShortcutsSection` objects. Each section has one or more items, represented by :obj:`~gi.repository.Adw.ShortcutsItem` objects. To add a section to the dialog, use :obj:`~gi.repository.ShortcutsDialog.add`\, or add it as a child when using UI files. Sections without titles can be used to further subdivide each section into groups. Example of an ``AdwShortcutsDialog`` UI definition: .. code-block:: xml :dedent: General Open Menu F10 Quit app.quit Move Tab Left <Shift><Ctrl>Page_Up ltr Move Tab Right <Shift><Ctrl>Page_Down ltr Move Tab Right <Shift><Ctrl>Page_Up rtl Move Tab Left <Shift><Ctrl>Page_Down rtl If the ``app.quit`` action has the :kbd:`Ctrl`:kbd:`Q` accelerator associated with it, the result will look as follows: .. image:: https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/shortcuts-dialog-example.png The recommended way to use ``AdwShortcutsDialog`` is via :obj:`~gi.repository.Adw.Application`\'s automatic resource loading. See also: :obj:`~gi.repository.Adw.ShortcutLabel`\. Constructors ------------ .. rst-class:: interim-class .. class:: ShortcutsDialog :no-index: .. classmethod:: new() -> ~gi.repository.Adw.Dialog Creates a new ``AdwShortcutsDialog``\. .. versionadded:: 1.8 Methods ------- .. rst-class:: interim-class .. class:: ShortcutsDialog :no-index: .. method:: add(section: ~gi.repository.Adw.ShortcutsSection) -> None Adds ``section`` to ``self``\. .. versionadded:: 1.8 :param section: the section to add