ShortcutsItem#
Added in version 1.8.
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
AdwShortcutsItemwithtitleandaccelerator.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
AdwShortcutsItemwithtitleandaction_name.Added in version 1.8.
- Parameters:
title – the shortcut title
action_name – the shortcut action name
Methods#
- class ShortcutsItem
-
- get_direction() TextDirection#
Gets the direction of
self.Added in version 1.8.
- set_accelerator(accelerator: str) None#
Sets the accelerator of
self.acceleratormust be in the formatShortcutLabelaccepts.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
ltrorrtl, the shortcut will only be displayed for this direction.Added in version 1.8.
- Parameters:
direction – the shortcut direction
Properties#
- class ShortcutsItem
-
- props.direction: TextDirection#
The type of the None singleton.
Added in version 1.8.