Dazzle.ShortcutTheme

g Dazzle.ShortcutTheme Dazzle.ShortcutTheme GObject.Object GObject.Object GObject.Object->Dazzle.ShortcutTheme

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new (name)

add_command (accelerator, command)

add_context (context)

add_css_resource (path)

find_context_by_name (name)

find_default_context (widget)

get_chord_for_action (detailed_action_name)

get_chord_for_command (command)

get_name ()

get_parent ()

get_parent_name ()

get_subtitle ()

get_title ()

load_from_data (data, len)

load_from_file (file, cancellable)

load_from_path (path, cancellable)

remove_css_resource (path)

save_to_file (file, cancellable)

save_to_path (path, cancellable)

save_to_stream (stream, cancellable)

set_accel_for_action (detailed_action_name, accel, phase)

set_accel_for_command (command, accel, phase)

set_chord_for_action (detailed_action_name, chord, phase)

set_chord_for_command (command, chord, phase)

set_parent_name (parent_name)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Name

Type

Flags

Short Description

name

str

r/w/co

The name of the theme

parent-name

str

r/w

The name of the parent shortcut theme

subtitle

str

r/w

The subtitle of the theme as used for UI elements

title

str

r/w

The title of the theme as used for UI elements

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent_instance

GObject.Object

r

Class Details

class Dazzle.ShortcutTheme(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

Dazzle.ShortcutThemeClass

classmethod new(name)
Parameters:

name (str) –

Return type:

Dazzle.ShortcutTheme

add_command(accelerator, command)
Parameters:
  • accelerator (str) –

  • command (str) –

add_context(context)
Parameters:

context (Dazzle.ShortcutContext) –

add_css_resource(path)
Parameters:

path (str) –

find_context_by_name(name)
Parameters:

name (str) – The name of the context

Returns:

An Dazzle.ShortcutContext

Return type:

Dazzle.ShortcutContext

Gets the context named name. If the context does not exist, it will be created.

find_default_context(widget)
Parameters:

widget (Gtk.Widget) –

Returns:

An Dazzle.ShortcutContext or None.

Return type:

Dazzle.ShortcutContext or None

Finds the default context in the theme for widget.

get_chord_for_action(detailed_action_name)
Parameters:

detailed_action_name (str) –

Return type:

Dazzle.ShortcutChord

get_chord_for_command(command)
Parameters:

command (str) –

Return type:

Dazzle.ShortcutChord

get_name()
Return type:

str

get_parent()
Returns:

A Dazzle.ShortcutTheme or None.

Return type:

Dazzle.ShortcutTheme or None

If the Dazzle.ShortcutTheme :parent-name property has been set, this will fetch the parent Dazzle.ShortcutTheme.

get_parent_name()
Returns:

The name of the parent theme, or None if none is set.

Return type:

str or None

Gets the name of the parent shortcut theme.

This is used to resolve shortcuts from the parent theme without having to copy them directly into this shortcut theme. It allows for some level of copy-on-write (CoW).

get_subtitle()
Return type:

str

get_title()
Return type:

str

load_from_data(data, len)
Parameters:
  • data (str) –

  • len (int) –

Raises:

GLib.Error

Return type:

bool

load_from_file(file, cancellable)
Parameters:
Raises:

GLib.Error

Return type:

bool

load_from_path(path, cancellable)
Parameters:
Raises:

GLib.Error

Return type:

bool

remove_css_resource(path)
Parameters:

path (str) –

save_to_file(file, cancellable)
Parameters:
Raises:

GLib.Error

Return type:

bool

save_to_path(path, cancellable)
Parameters:
Raises:

GLib.Error

Return type:

bool

save_to_stream(stream, cancellable)
Parameters:
Raises:

GLib.Error

Return type:

bool

set_accel_for_action(detailed_action_name, accel, phase)
Parameters:
set_accel_for_command(command, accel, phase)
Parameters:
  • command (str or None) – the command to be executed

  • accel (str or None) – the shortcut accelerator

  • phase (Dazzle.ShortcutPhase) – the phase to activate within, or 0 for the default

This will set the command to execute when accel is pressed. If command is None, the accelerator will be cleared. If accelerator is None, all accelerators for command will be cleared.

set_chord_for_action(detailed_action_name, chord, phase)
Parameters:
set_chord_for_command(command, chord, phase)
Parameters:

This will set the command to execute when chord is pressed. If command is None, the accelerator will be cleared. If chord is None, all accelerators for command will be cleared.

set_parent_name(parent_name)
Parameters:

parent_name (str) –

Property Details

Dazzle.ShortcutTheme.props.name
Name:

name

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The name of the theme

Dazzle.ShortcutTheme.props.parent_name
Name:

parent-name

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

The name of the parent shortcut theme

Dazzle.ShortcutTheme.props.subtitle
Name:

subtitle

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

The subtitle of the theme as used for UI elements

Dazzle.ShortcutTheme.props.title
Name:

title

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

The title of the theme as used for UI elements