:right-sidebar: True ExpanderRow =================================================================== .. currentmodule:: gi.repository.Adw .. class:: ExpanderRow(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.Adw.PreferencesRow`, :class:`~gi.repository.Gtk.ListBoxRow`, :class:`~gi.repository.Gtk.Widget`, :class:`~gi.repository.GObject.InitiallyUnowned`, :class:`~gi.repository.GObject.Object` Implemented Interfaces: :class:`~gi.repository.Gtk.Accessible`, :class:`~gi.repository.Gtk.Actionable`, :class:`~gi.repository.Gtk.Buildable`, :class:`~gi.repository.Gtk.ConstraintTarget` A :obj:`~gi.repository.Gtk.ListBoxRow` used to reveal widgets. .. image:: 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 :obj:`~gi.repository.Gtk.Buildable` interface supports adding a child as an suffix widget by specifying “suffix” as the “type” attribute of a element. It also supports adding it as a prefix widget by specifying “prefix” as the “type” attribute of a 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. Style classes -------------------------------------------------------------------------------- ``AdwExpanderRow`` can use the ```.`` `__ style class to emphasize the row subtitle instead of the row title, which is useful for displaying read-only properties. When used together with the ``.monospace`` style class, only the subtitle becomes monospace, not the title or any extra widgets. Constructors ------------ .. rst-class:: interim-class .. class:: ExpanderRow :no-index: .. classmethod:: new() -> ~gi.repository.Gtk.Widget Creates a new ``AdwExpanderRow``\. Methods ------- .. rst-class:: interim-class .. class:: ExpanderRow :no-index: .. method:: add_action(widget: ~gi.repository.Gtk.Widget) -> None Adds an action widget to ``self``\. .. deprecated:: 1.4 Use :obj:`~gi.repository.ExpanderRow.add_suffix` to add a suffix. :param widget: a widget .. method:: add_prefix(widget: ~gi.repository.Gtk.Widget) -> None Adds a prefix widget to ``self``\. :param widget: a widget .. method:: add_row(child: ~gi.repository.Gtk.Widget) -> None Adds a widget to ``self``\. The widget will appear in the expanding list below ``self``\. :param child: a widget .. method:: add_suffix(widget: ~gi.repository.Gtk.Widget) -> None Adds an suffix widget to ``self``\. .. versionadded:: 1.4 :param widget: a widget .. method:: get_enable_expansion() -> bool Gets whether the expansion of ``self`` is enabled. .. method:: get_expanded() -> bool Gets whether ``self`` is expanded. .. method:: get_icon_name() -> str | None Gets the icon name for ``self``\. .. deprecated:: 1.3 Use :obj:`~gi.repository.ExpanderRow.add_prefix` to add an icon. .. method:: get_show_enable_switch() -> bool Gets whether the switch enabling the expansion of ``self`` is visible. .. method:: get_subtitle() -> str Gets the subtitle for ``self``\. .. method:: get_subtitle_lines() -> int Gets the number of lines at the end of which the subtitle label will be ellipsized. .. versionadded:: 1.3 .. method:: get_title_lines() -> int Gets the number of lines at the end of which the title label will be ellipsized. .. versionadded:: 1.3 .. method:: remove(child: ~gi.repository.Gtk.Widget) -> None Removes a child from ``self``\. :param child: the child to be removed .. method:: set_enable_expansion(enable_expansion: bool) -> None Sets whether the expansion of ``self`` is enabled. :param enable_expansion: whether to enable the expansion .. method:: set_expanded(expanded: bool) -> None Sets whether ``self`` is expanded. :param expanded: whether to expand the row .. method:: set_icon_name(icon_name: str | None = None) -> None Sets the icon name for ``self``\. .. deprecated:: 1.3 Use :obj:`~gi.repository.ExpanderRow.add_prefix` to add an icon. :param icon_name: the icon name .. method:: set_show_enable_switch(show_enable_switch: bool) -> None Sets whether the switch enabling the expansion of ``self`` is visible. :param show_enable_switch: whether to show the switch enabling the expansion .. method:: set_subtitle(subtitle: str) -> None Sets the subtitle for ``self``\. The subtitle is interpreted as Pango markup unless :obj:`~gi.repository.Adw.PreferencesRow.props.use_markup` is set to ``FALSE``\. :param subtitle: the subtitle .. method:: 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. .. versionadded:: 1.3 :param subtitle_lines: the number of lines at the end of which the subtitle label will be ellipsized .. method:: 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. .. versionadded:: 1.3 :param title_lines: the number of lines at the end of which the title label will be ellipsized Properties ---------- .. rst-class:: interim-class .. class:: ExpanderRow :no-index: .. attribute:: props.enable_expansion :type: bool The type of the None singleton. .. attribute:: props.expanded :type: bool The type of the None singleton. .. attribute:: props.icon_name :type: str The type of the None singleton. .. deprecated:: 1.3 Use :obj:`~gi.repository.ExpanderRow.add_prefix` to add an icon. .. attribute:: props.show_enable_switch :type: bool The type of the None singleton. .. attribute:: props.subtitle :type: str The type of the None singleton. .. attribute:: props.subtitle_lines :type: int The type of the None singleton. .. versionadded:: 1.3 .. attribute:: props.title_lines :type: int The type of the None singleton. .. versionadded:: 1.3 Fields ------ .. rst-class:: interim-class .. class:: ExpanderRow :no-index: .. attribute:: parent_instance