About all my projects
Gnome::Gtk3::ShortcutsShortcut

Gnome::Gtk3::ShortcutsShortcut

Represents a keyboard shortcut in a GtkShortcutsWindow

Description

A Gnome::Gtk3::ShortcutsShortcut represents a single keyboard shortcut or gesture with a short text. This widget is only meant to be used with Gnome::Gtk3::ShortcutsWindow.

Synopsis

Declaration

unit class Gnome::Gtk3::ShortcutsShortcut;
also is Gnome::Gtk3::Box;

Types

enum GtkShortcutType

GtkShortcutType specifies the kind of shortcut that is being described. More values may be added to this enumeration over time.

  • GTK_SHORTCUT_ACCELERATOR: The shortcut is a keyboard accelerator. The accelerator property will be used.

  • GTK_SHORTCUT_GESTURE_PINCH: The shortcut is a pinch gesture. GTK+ provides an icon and subtitle.

  • GTK_SHORTCUT_GESTURE_STRETCH: The shortcut is a stretch gesture. GTK+ provides an icon and subtitle.

  • GTK_SHORTCUT_GESTURE_ROTATE_CLOCKWISE: The shortcut is a clockwise rotation gesture. GTK+ provides an icon and subtitle.

  • GTK_SHORTCUT_GESTURE_ROTATE_COUNTERCLOCKWISE: The shortcut is a counterclockwise rotation gesture. GTK+ provides an icon and subtitle.

  • GTK_SHORTCUT_GESTURE_TWO_FINGER_SWIPE_LEFT: The shortcut is a two-finger swipe gesture. GTK+ provides an icon and subtitle.

  • GTK_SHORTCUT_GESTURE_TWO_FINGER_SWIPE_RIGHT: The shortcut is a two-finger swipe gesture. GTK+ provides an icon and subtitle.

  • GTK_SHORTCUT_GESTURE: The shortcut is a gesture. The icon property will be used.

Methods

new

:native-object

Create a ShortcutsShortcut object using a native object from elsewhere. See also Gnome::N::TopLevelClassSupport.

multi method new ( N-GObject :$native-object! )

:build-id

Create a ShortcutsShortcut object using a native object returned from a builder. See also Gnome::GObject::Object.

multi method new ( Str :$build-id! )

Properties

An example of using a string type property of a Gnome::Gtk3::Label object. This is just showing how to set/read a property, not that it is the best way to do it. This is because a) The class initialization often provides some options to set some of the properties and b) the classes provide many methods to modify just those properties. In the case below one can use new(:label('my text label')) or .set-text('my text label').

my Gnome::Gtk3::Label $label .= new;
my Gnome::GObject::Value $gv .= new(:init(G_TYPE_STRING));
$label.get-property( 'label', $gv);
$gv.set-string('my text label');

Supported properties

Accelerator Size Group: accel-size-group

The size group for the accelerator portion of this shortcut. This is used internally by GTK+, and must not be modified by applications. Widget type: GTK_TYPE_SIZE_GROUP

The Gnome::GObject::Value type of property accel-size-group is G_TYPE_OBJECT.

Accelerator: accelerator

The accelerator(s) represented by this object. This property is used if shortcut-type is set to Gnome::Gtk3::TK_SHORTCUT_ACCELERATOR.

The syntax of this property is (an extension of) the syntax understood by gtk_accelerator_parse(). Multiple accelerators can be specified by separating them with a space, but keep in mind that the available width is limited. It is also possible to specify ranges of shortcuts, using ... between the keys. Sequences of keys can be specified using a + or & between the keys.

Examples:

  • A single shortcut: <ctl><alt>delete

  • Two alternative shortcuts: <shift>a Home

  • A range of shortcuts: <alt>1...<alt>9

  • Several keys pressed together: Control_L&Control_R

  • A sequence of shortcuts or keys: <ctl>c+<ctl>x

Use + instead of & when the keys may (or have to be) pressed sequentially (e.g use t+t for 'press the t key twice').

Note that <, > and & need to be escaped as &lt;, &gt; and &amp; when used in .ui files.

The Gnome::GObject::Value type of property accelerator is G_TYPE_STRING.

Action Name: action-name

A detailed action name. If this is set for a shortcut of type GTK_SHORTCUT_ACCELERATOR, then GTK+ will use the accelerators that are associated with the action via Gnome::Gtk3::Application.set-accels-for-action(), and setting accelerator is not necessary.

The Gnome::GObject::Value type of property action-name is G_TYPE_STRING.

Direction: direction

The text direction for which this shortcut is active. If the shortcut is used regardless of the text direction, set this property to GTK_TEXT_DIR_NONE. Widget enum type: GtkTextDirection

The Gnome::GObject::Value type of property direction is G_TYPE_ENUM.

Icon: icon

An icon to represent the shortcut or gesture. This property is used if shortcut-type is set to Gnome::Gtk3::TK_SHORTCUT_GESTURE. For the other predefined gesture types, GTK+ provides an icon on its own.Widget type: G_TYPE_ICON

The Gnome::GObject::Value type of property icon is G_TYPE_OBJECT.

Icon Set: icon-set

True if an icon has been set.

The Gnome::GObject::Value type of property icon-set is G_TYPE_BOOLEAN.

Shortcut Type: shortcut-type

The type of shortcut that is represented.Widget type: GTK_TYPE_SHORTCUT_TYPE

The Gnome::GObject::Value type of property shortcut-type is G_TYPE_ENUM.

Subtitle: subtitle

The subtitle for the shortcut or gesture.

This is typically used for gestures and should be a short, one-line text that describes the gesture itself. For the predefined gesture types, GTK+ provides a subtitle on its own.

The Gnome::GObject::Value type of property subtitle is G_TYPE_STRING.

Subtitle Set: subtitle-set

True if a subtitle has been set.

The Gnome::GObject::Value type of property subtitle-set is G_TYPE_BOOLEAN.

Title: title

The textual description for the shortcut or gesture represented by this object. This should be a short string that can fit in a single line.

The Gnome::GObject::Value type of property title is G_TYPE_STRING.

Title Size Group: title-size-group

The size group for the textual portion of this shortcut. This is used internally by GTK+, and must not be modified by applications. Widget type: GTK_TYPE_SIZE_GROUP

The Gnome::GObject::Value type of property title-size-group is G_TYPE_OBJECT.