ShortcutsItem#

Added in version 1.8.

class ShortcutsItem(**properties: Any)#

Superclasses: Object

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 action_name property can be used to automatically get accelerator associated with the specified action, as set via 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 direction is set, the shortcut will only be displayed for the specified text direction. This allows to display different shortcuts for different text directions.

Constructors#

class ShortcutsItem
classmethod new(title: str, accelerator: str) ShortcutsItem#

Creates a new AdwShortcutsItem with title and accelerator.

Added in version 1.8.

Parameters:
  • title – the shortcut title

  • accelerator – the shortcut accelerator

classmethod new_from_action(title: str, action_name: str) ShortcutsItem#

Creates a new AdwShortcutsItem with title and action_name.

Added in version 1.8.

Parameters:
  • title – the shortcut title

  • action_name – the shortcut action name

Methods#

class ShortcutsItem
get_accelerator() str#

Gets the accelerator of self.

Added in version 1.8.

get_action_name() str#

Gets the action name to get the accelerator from.

Added in version 1.8.

get_direction() TextDirection#

Gets the direction of self.

Added in version 1.8.

get_subtitle() str#

Gets the subtitle of self.

Added in version 1.8.

get_title() str#

Gets the title of self.

Added in version 1.8.

set_accelerator(accelerator: str) None#

Sets the accelerator of self.

accelerator must be in the format ShortcutLabel accepts.

Added in version 1.8.

Parameters:

accelerator – the accelerator to use

set_action_name(action_name: str) None#

Sets the action name to get the accelerator from.

Added in version 1.8.

Parameters:

action_name – the action name to use

set_direction(direction: TextDirection) None#

Sets the direction of self.

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

Added in version 1.8.

Parameters:

direction – the shortcut direction

set_subtitle(subtitle: str) None#

Sets the subtitle of self.

Added in version 1.8.

Parameters:

subtitle – the subtitle to use

set_title(title: str) None#

Sets the title of self.

Added in version 1.8.

Parameters:

title – the title to use

Properties#

class ShortcutsItem
props.accelerator: str#

The type of the None singleton.

Added in version 1.8.

props.action_name: str#

The type of the None singleton.

Added in version 1.8.

props.direction: TextDirection#

The type of the None singleton.

Added in version 1.8.

props.subtitle: str#

The type of the None singleton.

Added in version 1.8.

props.title: str#

The type of the None singleton.

Added in version 1.8.