Adw.ShortcutsItem¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
|---|---|---|---|
r/w/en |
|||
r/w/en |
|||
r/w/en |
|||
r/w/en |
|||
r/w/en |
Signals¶
- Inherited:
Fields¶
- Inherited:
Class Details¶
- class Adw.ShortcutsItem(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
An object representing an individual shortcut in [class`ShortcutsSection`].
A shortcut has a title, an optional subtitle, and an accelerator.
Accelerator must be specified in the format [class`ShortcutLabel`] accepts.
Alternatively, the [property`ShortcutsItem`:py:data::action-name<Adw.ShortcutsItem.props.action_name>] property can be used to automatically get accelerator associated with the specified action, as set via [method`Gtk`.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 [property`ShortcutsItem`:py:data::direction<Adw.ShortcutsItem.props.direction>] is set, the shortcut will only be displayed for the specified text direction. This allows to display different shortcuts for different text directions.
New in version 1.8.
- classmethod new(title, accelerator)¶
- Parameters:
- Returns:
the newly created
AdwShortcutsItem- Return type:
Creates a new
AdwShortcutsItemwith title and accelerator.New in version 1.8.
- classmethod new_from_action(title, action_name)¶
- Parameters:
- Returns:
the newly created
AdwShortcutsItem- Return type:
Creates a new
AdwShortcutsItemwith title and action_name.New in version 1.8.
- get_accelerator()¶
- Returns:
the accelerator
- Return type:
Gets the accelerator of self.
New in version 1.8.
- get_action_name()¶
- Returns:
the action name
- Return type:
Gets the action name to get the accelerator from.
New in version 1.8.
- get_direction()¶
- Returns:
the shortcut direction
- Return type:
Gets the direction of self.
New in version 1.8.
- get_subtitle()¶
- Returns:
the subtitle
- Return type:
Gets the subtitle of self.
New in version 1.8.
- set_accelerator(accelerator)¶
- Parameters:
accelerator (
str) – the accelerator to use
Sets the accelerator of self.
accelerator must be in the format [class`ShortcutLabel`] accepts.
New in version 1.8.
- set_action_name(action_name)¶
- Parameters:
action_name (
str) – the action name to use
Sets the action name to get the accelerator from.
New in version 1.8.
- set_direction(direction)¶
- Parameters:
direction (
Gtk.TextDirection) – the shortcut direction
Sets the direction of self.
If set to [enum`Gtk`.TextDirection.LTR] or [enum`Gtk`.TextDirection.RTL], the shortcut will only be displayed for this direction.
New in version 1.8.
Property Details¶
- Adw.ShortcutsItem.props.accelerator¶
- Name:
accelerator- Type:
- Default Value:
''- Flags:
The shortcut accelerator.
Accelerator must be in the format [class`ShortcutLabel`] accepts.
New in version 1.8.
- Adw.ShortcutsItem.props.action_name¶
- Name:
action-name- Type:
- Default Value:
''- Flags:
Fully qualified action name to get the accelerator from.
New in version 1.8.
- Adw.ShortcutsItem.props.direction¶
- Name:
direction- Type:
- Default Value:
- Flags:
The shortcut direction.
If set to [enum`Gtk`.TextDirection.LTR] or [enum`Gtk`.TextDirection.RTL], the shortcut will only be displayed for this direction.
New in version 1.8.
- Adw.ShortcutsItem.props.subtitle¶
- Name:
subtitle- Type:
- Default Value:
''- Flags:
The subtitle of the shortcut.
New in version 1.8.
- Adw.ShortcutsItem.props.title¶
- Name:
title- Type:
- Default Value:
''- Flags:
The title of the shortcut.
New in version 1.8.