:right-sidebar: True ActionRow =================================================================== .. currentmodule:: gi.repository.Adw .. class:: ActionRow(**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` Subclasses: :class:`~gi.repository.Adw.ComboRow`, :class:`~gi.repository.Adw.SpinRow`, :class:`~gi.repository.Adw.SwitchRow` 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 present actions. .. image:: https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/action-row.png 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. AdwActionRow as GtkBuildable -------------------------------------------------------------------------------- The ``AdwActionRow`` implementation of the :obj:`~gi.repository.Gtk.Buildable` interface supports adding a child at its end by specifying “suffix” or omitting the “type” attribute of a element. It also supports adding a child as a prefix widget by specifying “prefix” as the “type” attribute of a 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. Style classes -------------------------------------------------------------------------------- ``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. .. image:: https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/property-row.png 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:: ActionRow :no-index: .. classmethod:: new() -> ~gi.repository.Gtk.Widget Creates a new ``AdwActionRow``\. Methods ------- .. rst-class:: interim-class .. class:: ActionRow :no-index: .. method:: activate() -> None Activates ``self``\. .. method:: add_prefix(widget: ~gi.repository.Gtk.Widget) -> None Adds a prefix widget to ``self``\. :param widget: a widget .. method:: add_suffix(widget: ~gi.repository.Gtk.Widget) -> None Adds a suffix widget to ``self``\. :param widget: a widget .. method:: do_activate(self) -> None .. method:: get_activatable_widget() -> ~gi.repository.Gtk.Widget | None Gets the widget activated when ``self`` is activated. .. method:: get_icon_name() -> str | None Gets the icon name for ``self``\. .. deprecated:: 1.3 Use :obj:`~gi.repository.ActionRow.add_prefix` to add an icon. .. method:: get_subtitle() -> str | None 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. .. method:: get_subtitle_selectable() -> bool Gets whether the user can copy the subtitle from the label .. versionadded:: 1.3 .. method:: get_title_lines() -> int Gets the number of lines at the end of which the title label will be ellipsized. .. method:: remove(widget: ~gi.repository.Gtk.Widget) -> None Removes a child from ``self``\. :param widget: the child to be removed .. method:: set_activatable_widget(widget: ~gi.repository.Gtk.Widget | None = None) -> None Sets the widget to activate when ``self`` is activated. The row can be activated either by clicking on it, calling :obj:`~gi.repository.ActionRow.activate`\, or via mnemonics in the title. See the :obj:`~gi.repository.Adw.PreferencesRow.props.use_underline` property to enable mnemonics. The target widget will be activated by emitting the :obj:`~gi.repository.Gtk.Widget.signals.mnemonic_activate` signal on it. :param widget: the target widget .. method:: set_icon_name(icon_name: str | None = None) -> None Sets the icon name for ``self``\. .. deprecated:: 1.3 Use :obj:`~gi.repository.ActionRow.add_prefix` to add an icon. :param icon_name: the icon name .. 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. :param subtitle_lines: the number of lines at the end of which the subtitle label will be ellipsized .. method:: set_subtitle_selectable(subtitle_selectable: bool) -> None Sets whether the user can copy the subtitle from the label See also :obj:`~gi.repository.Gtk.Label.props.selectable`\. .. versionadded:: 1.3 :param subtitle_selectable: ``TRUE`` if the user can copy the subtitle from the label .. 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. :param title_lines: the number of lines at the end of which the title label will be ellipsized Properties ---------- .. rst-class:: interim-class .. class:: ActionRow :no-index: .. attribute:: props.activatable_widget :type: ~gi.repository.Gtk.Widget 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.ActionRow.add_prefix` to add an icon. .. attribute:: props.subtitle :type: str The type of the None singleton. .. attribute:: props.subtitle_lines :type: int The type of the None singleton. .. attribute:: props.subtitle_selectable :type: bool The type of the None singleton. .. versionadded:: 1.3 .. attribute:: props.title_lines :type: int The type of the None singleton. Signals ------- .. rst-class:: interim-class .. class:: ActionRow.signals :no-index: .. method:: activated() -> None The type of the None singleton. Virtual Methods --------------- .. rst-class:: interim-class .. class:: ActionRow :no-index: .. method:: do_activate() -> None Activates ``self``\. Fields ------ .. rst-class:: interim-class .. class:: ActionRow :no-index: .. attribute:: parent_instance