1.47 <AdwShortcutsItem>

Class: <AdwShortcutsItem>

It derives from <GObject>.

An object representing an individual shortcut in ShortcutsSection.

A shortcut has a title, an optional subtitle, and an accelerator.

Accelerator must be specified in the format ShortcutLabel accepts.

Alternatively, the ShortcutsItem:action-name property can be used to automatically get accelerator associated with the specified action, as set via application:set-accels-for-action.

If both are specified, the accelerator will be used if the action couldn’t be found or doesn’t have an accelerator associated for it.

If ShortcutsItem:direction is set, the shortcut will only be displayed for the specified text direction. This allows to display different shortcuts for different text directions.

Properties

Property: shortcuts-item:accelerator self

The shortcut accelerator.

Accelerator must be in the format ShortcutLabel accepts.

Its value is a string, or #f.

Set it with (set! (shortcuts-item:accelerator self) value).

Property: shortcuts-item:action-name self

Fully qualified action name to get the accelerator from.

Its value is a string, or #f.

Set it with (set! (shortcuts-item:action-name self) value).

Property: shortcuts-item:direction self

The shortcut direction.

If set to Gtk.TextDirection.LTR or Gtk.TextDirection.rtl, the shortcut will only be displayed for this direction.

Its value is a <GtkTextDirection> (or, to set it, one of its symbols).

Set it with (set! (shortcuts-item:direction self) value).

Property: shortcuts-item:subtitle self

The subtitle of the shortcut.

Its value is a string, or #f.

Set it with (set! (shortcuts-item:subtitle self) value).

Property: shortcuts-item:title self

The title of the shortcut.

Its value is a string, or #f.

Set it with (set! (shortcuts-item:title self) value).

Procedures

Method: shortcuts-item:get-accelerator self ⇒ %return
Method: get-accelerator self ⇒ %return

Gets the accelerator of self.

self

Passed: a <AdwShortcutsItem>.

a shortcuts item

%return

Returned: a string.

the accelerator

Method: shortcuts-item:get-action-name self ⇒ %return
Method: get-action-name self ⇒ %return

Gets the action name to get the accelerator from.

self

Passed: a <AdwShortcutsItem>.

a shortcuts item

%return

Returned: a string.

the action name

Method: shortcuts-item:get-direction self ⇒ %return
Method: get-direction self ⇒ %return

Gets the direction of self.

self

Passed: a <AdwShortcutsItem>.

a shortcuts item

%return

Returned: a <GtkTextDirection>.

the shortcut direction

Method: shortcuts-item:get-subtitle self ⇒ %return
Method: get-subtitle self ⇒ %return

Gets the subtitle of self.

self

Passed: a <AdwShortcutsItem>.

a shortcuts item

%return

Returned: a string.

the subtitle

Method: shortcuts-item:get-title self ⇒ %return
Method: get-title self ⇒ %return

Gets the title of self.

self

Passed: a <AdwShortcutsItem>.

a shortcuts item

%return

Returned: a string.

the title

Procedure: shortcuts-item:new title accelerator ⇒ %return

Creates a new <AdwShortcutsItem> with title and accelerator.

title

Passed: a string.

the shortcut title

accelerator

Passed: a string.

the shortcut accelerator

%return

Returned: a <AdwShortcutsItem>.

the newly created <AdwShortcutsItem>

Procedure: shortcuts-item:new-from-action title action-name ⇒ %return

Creates a new <AdwShortcutsItem> with title and action-name.

title

Passed: a string.

the shortcut title

action-name

Passed: a string.

the shortcut action name

%return

Returned: a <AdwShortcutsItem>.

the newly created <AdwShortcutsItem>

Method: shortcuts-item:set-accelerator self accelerator
Method: set-accelerator self accelerator

Sets the accelerator of self.

accelerator must be in the format ShortcutLabel accepts.

self

Passed: a <AdwShortcutsItem>.

a shortcuts item

accelerator

Passed: a string.

the accelerator to use

Method: shortcuts-item:set-action-name self action-name
Method: set-action-name self action-name

Sets the action name to get the accelerator from.

self

Passed: a <AdwShortcutsItem>.

a shortcuts item

action-name

Passed: a string.

the action name to use

Method: shortcuts-item:set-direction self direction
Method: set-direction self direction

Sets the direction of self.

If set to Gtk.TextDirection.ltr or Gtk.TextDirection.rtl, the shortcut will only be displayed for this direction.

self

Passed: a <AdwShortcutsItem>.

a shortcuts item

direction

Passed: a <GtkTextDirection>, or one of its symbols.

the shortcut direction

Method: shortcuts-item:set-subtitle self subtitle
Method: set-subtitle self subtitle

Sets the subtitle of self.

self

Passed: a <AdwShortcutsItem>.

a shortcuts item

subtitle

Passed: a string.

the subtitle to use

Method: shortcuts-item:set-title self title
Method: set-title self title

Sets the title of self.

self

Passed: a <AdwShortcutsItem>.

a shortcuts item

title

Passed: a string.

the title to use