Adw.ActionRow

g Adw.ActionRow Adw.ActionRow Adw.PreferencesRow Adw.PreferencesRow Adw.PreferencesRow->Adw.ActionRow GObject.GInterface GObject.GInterface Gtk.Accessible Gtk.Accessible GObject.GInterface->Gtk.Accessible Gtk.Actionable Gtk.Actionable GObject.GInterface->Gtk.Actionable Gtk.Buildable Gtk.Buildable GObject.GInterface->Gtk.Buildable Gtk.ConstraintTarget Gtk.ConstraintTarget GObject.GInterface->Gtk.ConstraintTarget GObject.InitiallyUnowned GObject.InitiallyUnowned Gtk.Widget Gtk.Widget GObject.InitiallyUnowned->Gtk.Widget GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned Gtk.Accessible->Gtk.Widget Gtk.ListBoxRow Gtk.ListBoxRow Gtk.Actionable->Gtk.ListBoxRow Gtk.Buildable->Gtk.Widget Gtk.ConstraintTarget->Gtk.Widget Gtk.ListBoxRow->Adw.PreferencesRow Gtk.Widget->Gtk.ListBoxRow

Subclasses:

Adw.ComboRow, Adw.SpinRow, Adw.SwitchRow

Methods

Inherited:

Adw.PreferencesRow (9), Gtk.ListBoxRow (12), Gtk.Widget (181), GObject.Object (37), Gtk.Accessible (15), Gtk.Buildable (1), Gtk.Actionable (5)

Structs:

Gtk.WidgetClass (18), GObject.ObjectClass (5)

class

new ()

activate ()

add_prefix (widget)

add_suffix (widget)

get_activatable_widget ()

get_icon_name ()

get_subtitle ()

get_subtitle_lines ()

get_subtitle_selectable ()

get_title_lines ()

remove (widget)

set_activatable_widget (widget)

set_icon_name (icon_name)

set_subtitle (subtitle)

set_subtitle_lines (subtitle_lines)

set_subtitle_selectable (subtitle_selectable)

set_title_lines (title_lines)

Virtual Methods

Inherited:

Gtk.ListBoxRow (1), Gtk.Widget (25), GObject.Object (7), Gtk.Accessible (6), Gtk.Buildable (9), Gtk.Actionable (4)

do_activate ()

Properties

Inherited:

Adw.PreferencesRow (4), Gtk.ListBoxRow (3), Gtk.Widget (34), Gtk.Accessible (1), Gtk.Actionable (2)

Name

Type

Flags

Short Description

activatable-widget

Gtk.Widget

r/w/en

icon-name

str

d/r/w/en

deprecated

subtitle

str

r/w/en

subtitle-lines

int

r/w/en

subtitle-selectable

bool

r/w/en

title-lines

int

r/w/en

Signals

Inherited:

Gtk.ListBoxRow (1), Gtk.Widget (13), GObject.Object (1)

Name

Short Description

activated

This signal is emitted after the row has been activated.

Fields

Inherited:

Gtk.ListBoxRow (1), Gtk.Widget (13), GObject.Object (1)

Name

Type

Access

Description

parent_instance

Adw.PreferencesRow

r

Class Details

class Adw.ActionRow(**kwargs)
Bases:

Adw.PreferencesRow

Abstract:

No

Structure:

Adw.ActionRowClass

A [class`Gtk`.ListBoxRow] used to present actions.

<picture> <source srcset=”action-row-dark.png” media=”(prefers-color-scheme: dark)”> <img src=”action-row.png” alt=”action-row”> </picture>

The AdwActionRow widget can have a title, a subtitle and an icon. The row can receive additional widgets at its end, or prefix widgets at its start.

It is convenient to present a preference and its related actions.

AdwActionRow is unactivatable by default, giving it an activatable widget will automatically make it activatable, but unsetting it won’t change the row’s activatability.

Adw.ActionRow as Gtk.Buildable

The AdwActionRow implementation of the [iface`Gtk`.Buildable] interface supports adding a child at its end by specifying “suffix” or omitting the “type” attribute of a <child> element.

It also supports adding a child as a prefix widget by specifying “prefix” as the “type” attribute of a <child> element.

CSS nodes

AdwActionRow has a main CSS node with name row.

It contains the subnode box.header for its main horizontal box, and box.title for the vertical box containing the title and subtitle labels.

It contains subnodes label.title and label.subtitle representing respectively the title label and subtitle label.

AdwActionRow can use the .property style class to emphasize the row subtitle instead of the row title, which is useful for displaying read-only properties.

classmethod new()
Returns:

the newly created AdwActionRow

Return type:

Gtk.Widget

Creates a new AdwActionRow.

activate()

Activates self.

add_prefix(widget)
Parameters:

widget (Gtk.Widget) – a widget

Adds a prefix widget to self.

add_suffix(widget)
Parameters:

widget (Gtk.Widget) – a widget

Adds a suffix widget to self.

get_activatable_widget()
Returns:

the activatable widget for self

Return type:

Gtk.Widget or None

Gets the widget activated when self is activated.

get_icon_name()
Returns:

the icon name for self

Return type:

str or None

Gets the icon name for self.

Deprecated since version 1.3: Use [method`ActionRow`.add_prefix] to add an icon.

get_subtitle()
Returns:

the subtitle for self

Return type:

str or None

Gets the subtitle for self.

get_subtitle_lines()
Returns:

the number of lines at the end of which the subtitle label will be ellipsized

Return type:

int

Gets the number of lines at the end of which the subtitle label will be ellipsized.

get_subtitle_selectable()
Returns:

whether the user can copy the subtitle from the label

Return type:

bool

Gets whether the user can copy the subtitle from the label

New in version 1.3.

get_title_lines()
Returns:

the number of lines at the end of which the title label will be ellipsized

Return type:

int

Gets the number of lines at the end of which the title label will be ellipsized.

remove(widget)
Parameters:

widget (Gtk.Widget) – the child to be removed

Removes a child from self.

set_activatable_widget(widget)
Parameters:

widget (Gtk.Widget or None) – the target widget

Sets the widget to activate when self is activated.

The row can be activated either by clicking on it, calling [method`ActionRow`.activate], or via mnemonics in the title. See the [property`PreferencesRow`:py:data::use-underline<Adw.ActionRow.props.use_underline>] property to enable mnemonics.

The target widget will be activated by emitting the [signal`Gtk`.Widget::mnemonic-activate] signal on it.

set_icon_name(icon_name)
Parameters:

icon_name (str or None) – the icon name

Sets the icon name for self.

Deprecated since version 1.3: Use [method`ActionRow`.add_prefix] to add an icon.

set_subtitle(subtitle)
Parameters:

subtitle (str) – the subtitle

Sets the subtitle for self.

The subtitle is interpreted as Pango markup unless [property`PreferencesRow`:py:data::use-markup<Adw.ActionRow.props.use_markup>] is set to FALSE.

set_subtitle_lines(subtitle_lines)
Parameters:

subtitle_lines (int) – the number of lines at the end of which the subtitle label will be ellipsized

Sets the number of lines at the end of which the subtitle label will be ellipsized.

If the value is 0, the number of lines won’t be limited.

set_subtitle_selectable(subtitle_selectable)
Parameters:

subtitle_selectable (bool) – TRUE if the user can copy the subtitle from the label

Sets whether the user can copy the subtitle from the label

See also [property`Gtk`.Label:selectable].

New in version 1.3.

set_title_lines(title_lines)
Parameters:

title_lines (int) – the number of lines at the end of which the title label will be ellipsized

Sets the number of lines at the end of which the title label will be ellipsized.

If the value is 0, the number of lines won’t be limited.

do_activate() virtual

Activates self.

Signal Details

Adw.ActionRow.signals.activated(action_row)
Signal Name:

activated

Flags:

RUN_LAST

Parameters:

action_row (Adw.ActionRow) – The object which received the signal

This signal is emitted after the row has been activated.

Property Details

Adw.ActionRow.props.activatable_widget
Name:

activatable-widget

Type:

Gtk.Widget

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The widget to activate when the row is activated.

The row can be activated either by clicking on it, calling [method`ActionRow`.activate], or via mnemonics in the title. See the [property`PreferencesRow`:py:data::use-underline<Adw.ActionRow.props.use_underline>] property to enable mnemonics.

The target widget will be activated by emitting the [signal`Gtk`.Widget::mnemonic-activate] signal on it.

Adw.ActionRow.props.icon_name
Name:

icon-name

Type:

str

Default Value:

''

Flags:

DEPRECATED, READABLE, WRITABLE, EXPLICIT_NOTIFY

The icon name for this row.

Deprecated since version 1.3: Use [method`ActionRow`.add_prefix] to add an icon.

Adw.ActionRow.props.subtitle
Name:

subtitle

Type:

str

Default Value:

''

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The subtitle for this row.

The subtitle is interpreted as Pango markup unless [property`PreferencesRow`:py:data::use-markup<Adw.ActionRow.props.use_markup>] is set to FALSE.

Adw.ActionRow.props.subtitle_lines
Name:

subtitle-lines

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The number of lines at the end of which the subtitle label will be ellipsized.

If the value is 0, the number of lines won’t be limited.

Adw.ActionRow.props.subtitle_selectable
Name:

subtitle-selectable

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Whether the user can copy the subtitle from the label.

See also [property`Gtk`.Label:selectable].

New in version 1.3.

Adw.ActionRow.props.title_lines
Name:

title-lines

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The number of lines at the end of which the title label will be ellipsized.

If the value is 0, the number of lines won’t be limited.