Adw.ShortcutsDialog

g Adw.Dialog Adw.Dialog Adw.ShortcutsDialog Adw.ShortcutsDialog Adw.Dialog->Adw.ShortcutsDialog GObject.GInterface GObject.GInterface Gtk.Accessible Gtk.Accessible GObject.GInterface->Gtk.Accessible Gtk.Buildable Gtk.Buildable GObject.GInterface->Gtk.Buildable Gtk.ConstraintTarget Gtk.ConstraintTarget GObject.GInterface->Gtk.ConstraintTarget Gtk.ShortcutManager Gtk.ShortcutManager GObject.GInterface->Gtk.ShortcutManager GObject.InitiallyUnowned GObject.InitiallyUnowned Gtk.Widget Gtk.Widget GObject.InitiallyUnowned->Gtk.Widget GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned Gtk.Accessible->Gtk.Widget Gtk.Buildable->Gtk.Widget Gtk.ConstraintTarget->Gtk.Widget Gtk.ShortcutManager->Adw.Dialog Gtk.Widget->Adw.Dialog

Subclasses:

None

Methods

Inherited:

Adw.Dialog (24), Gtk.Widget (183), GObject.Object (37), Gtk.Accessible (17), Gtk.Buildable (1)

Structs:

Gtk.WidgetClass (18), GObject.ObjectClass (5)

class

new ()

add (section)

Virtual Methods

Inherited:

Adw.Dialog (2), Gtk.Widget (25), GObject.Object (7), Gtk.Accessible (6), Gtk.Buildable (9), Gtk.ShortcutManager (2)

Properties

Inherited:

Adw.Dialog (10), Gtk.Widget (35), Gtk.Accessible (1)

Signals

Inherited:

Adw.Dialog (2), Gtk.Widget (13), GObject.Object (1)

Fields

Inherited:

Adw.Dialog (2), Gtk.Widget (13), GObject.Object (1)

Class Details

class Adw.ShortcutsDialog(**kwargs)
Bases:

Adw.Dialog

Abstract:

No

Structure:

Adw.ShortcutsDialogClass

A dialog that displays application’s keyboard shortcuts.

<picture> <source srcset=”shortcuts-dialog-dark.png” media=”(prefers-color-scheme: dark)”> <img src=”shortcuts-dialog.png” alt=”shortcuts-dialog”> </picture>

Shortcuts are grouped into sections, represented by [class`ShortcutsSection`] objects. Each section has one or more items, represented by [class`ShortcutsItem`] objects.

To add a section to the dialog, use [method`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:

``xml <object class=”AdwShortcutsDialog” id=”shortcuts_dialog”>

<child>
<object class=”AdwShortcutsSection”>

<property name=”title” translatable=”yes”>General</property> <child>

<object class=”AdwShortcutsItem”>

<property name=”title” translatable=”yes”>Open Menu</property> <property name=”accelerator”>F10</property>

</object>

</child> <child>

<object class=”AdwShortcutsItem”>

<property name=”title” translatable=”yes”>Quit</property> <property name=”action-name”>app.quit</property>

</object>

</child>

</object>

</child> <child>

<object class=”AdwShortcutsSection”>
<child>
<object class=”AdwShortcutsItem”>

<property name=”title” translatable=”yes”>Move Tab Left</property> <property name=”accelerator”>&lt;Shift&gt;&lt;Ctrl&gt;Page_Up</property> <property name=”direction”>ltr</property>

</object>

</child> <child>

<object class=”AdwShortcutsItem”>

<property name=”title” translatable=”yes”>Move Tab Right</property> <property name=”accelerator”>&lt;Shift&gt;&lt;Ctrl&gt;Page_Down</property> <property name=”direction”>ltr</property>

</object>

</child> <child>

<object class=”AdwShortcutsItem”>

<property name=”title” translatable=”yes”>Move Tab Right</property> <property name=”accelerator”>&lt;Shift&gt;&lt;Ctrl&gt;Page_Up</property> <property name=”direction”>rtl</property>

</object>

</child> <child>

<object class=”AdwShortcutsItem”>

<property name=”title” translatable=”yes”>Move Tab Left</property> <property name=”accelerator”>&lt;Shift&gt;&lt;Ctrl&gt;Page_Down</property> <property name=”direction”>rtl</property>

</object>

</child>

</object>

</child>

</object> ``

If the app.quit action has the <kbd>Ctrl</kbd><kbd>Q</kbd> accelerator associated with it, the result will look as follows:

<picture> <source srcset=”shortcuts-dialog-example-dark.png” media=”(prefers-color-scheme: dark)”> <img src=”shortcuts-dialog-example.png” alt=”shortcuts-dialog-example”> </picture>

The recommended way to use AdwShortcutsDialog is via [class`Application`]’s automatic resource loading.

See also: [class`ShortcutLabel`].

New in version 1.8.

classmethod new()
Returns:

the newly created AdwShortcutsDialog

Return type:

Adw.Dialog

Creates a new AdwShortcutsDialog.

New in version 1.8.

add(section)
Parameters:

section (Adw.ShortcutsSection) – the section to add

Adds section to self.

New in version 1.8.