ExpanderRow

class ExpanderRow(**properties: Any)

Superclasses: PreferencesRow, ListBoxRow, Widget, InitiallyUnowned, Object

Implemented Interfaces: Accessible, Actionable, Buildable, ConstraintTarget

A ListBoxRow used to reveal widgets.

https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/expander-row.png

The AdwExpanderRow widget allows the user to reveal or hide widgets below it. It also allows the user to enable the expansion of the row, allowing to disable all that the row contains.

AdwExpanderRow as GtkBuildable

The AdwExpanderRow implementation of the Buildable interface supports adding a child as an suffix widget by specifying “suffix” as the “type” attribute of a <child> element.

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

CSS nodes

AdwExpanderRow has a main CSS node with name row and the .expander style class. It has the .empty style class when it contains no children.

It contains the subnodes row.header for its main embedded row, list.nested for the list it can expand, and image.expander-row-arrow for its arrow.

Constructors

class ExpanderRow
classmethod new() Widget

Creates a new AdwExpanderRow.

Methods

class ExpanderRow
add_action(widget: Widget) None

Adds an action widget to self.

Deprecated since version 1.4: Use add_suffix to add a suffix.

Parameters:

widget – a widget

add_prefix(widget: Widget) None

Adds a prefix widget to self.

Parameters:

widget – a widget

add_row(child: Widget) None

Adds a widget to self.

The widget will appear in the expanding list below self.

Parameters:

child – a widget

add_suffix(widget: Widget) None

Adds an suffix widget to self.

Added in version 1.4.

Parameters:

widget – a widget

get_enable_expansion() bool

Gets whether the expansion of self is enabled.

get_expanded() bool

Gets whether self is expanded.

get_icon_name() str | None

Gets the icon name for self.

Deprecated since version 1.3: Use add_prefix to add an icon.

get_show_enable_switch() bool

Gets whether the switch enabling the expansion of self is visible.

get_subtitle() str

Gets the subtitle for self.

get_subtitle_lines() bool

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

Added in version 1.3.

get_title_lines() bool

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

Added in version 1.3.

remove(child: Widget) None
Parameters:

child

set_enable_expansion(enable_expansion: bool) None

Sets whether the expansion of self is enabled.

Parameters:

enable_expansion – whether to enable the expansion

set_expanded(expanded: bool) None

Sets whether self is expanded.

Parameters:

expanded – whether to expand the row

set_icon_name(icon_name: str | None = None) None

Sets the icon name for self.

Deprecated since version 1.3: Use add_prefix to add an icon.

Parameters:

icon_name – the icon name

set_show_enable_switch(show_enable_switch: bool) None

Sets whether the switch enabling the expansion of self is visible.

Parameters:

show_enable_switch – whether to show the switch enabling the expansion

set_subtitle(subtitle: str) None

Sets the subtitle for self.

The subtitle is interpreted as Pango markup unless use_markup is set to FALSE.

Parameters:

subtitle – the subtitle

set_subtitle_lines(subtitle_lines: int) None

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.

Added in version 1.3.

Parameters:

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

set_title_lines(title_lines: int) None

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.

Added in version 1.3.

Parameters:

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

Properties

class ExpanderRow
props.enable_expansion: bool

Whether expansion is enabled.

props.expanded: bool

Whether the row is expanded.

props.icon_name: str

The icon name for this row.

Deprecated since version 1.3: Use add_prefix to add an icon.

props.show_enable_switch: bool

Whether the switch enabling the expansion is visible.

props.subtitle: str

The subtitle for this row.

The subtitle is interpreted as Pango markup unless use_markup is set to FALSE.

props.subtitle_lines: int

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.

Added in version 1.3.

props.title_lines: int

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.

Added in version 1.3.

Fields

class ExpanderRow
parent_instance