Class ActionRow

All Implemented Interfaces:
PointerInterface
Direct Known Subclasses:
ComboRow

public class ActionRow extends PreferencesRow
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.

## AdwActionRow as GtkBuildable

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.

https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.ActionRow.html

  • Field Details

  • Constructor Details

    • ActionRow

      public ActionRow(PointerContainer pointer)
    • ActionRow

      public ActionRow()
      Creates a new `AdwActionRow`.
  • Method Details

    • getClassHandler

      public static ClassHandler getClassHandler()
    • addPrefix

      public void addPrefix(@Nonnull Widget widget)
      Adds a prefix widget to @self.
      Parameters:
      widget - a widget
    • addSuffix

      public void addSuffix(@Nonnull Widget widget)
      Adds a suffix widget to @self.
      Parameters:
      widget - a widget
    • getActivatableWidget

      public Widget getActivatableWidget()
      Gets the widget activated when @self is activated.
      Returns:
      the activatable widget for @self
    • getIconName

      public Str getIconName()
      Gets the icon name for @self.
      Returns:
      the icon name for @self
    • getSubtitle

      public Str getSubtitle()
      Gets the subtitle for @self.
      Returns:
      the subtitle for @self
    • getSubtitleLines

      public int getSubtitleLines()
      Gets the number of lines at the end of which the subtitle label will be
      ellipsized.
      Returns:
      the number of lines at the end of which the subtitle label will be ellipsized
    • getTitleLines

      public int getTitleLines()
      Gets the number of lines at the end of which the title label will be
      ellipsized.
      Returns:
      the number of lines at the end of which the title label will be ellipsized
    • remove

      public void remove(@Nonnull Widget widget)
      Removes a child from @self.
      Parameters:
      widget - the child to be removed
    • setActivatableWidget

      public void setActivatableWidget(@Nullable Widget 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 or the subtitle.
      See the [property@PreferencesRow:use-underline] property to enable mnemonics.

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

      public void setIconName(@Nullable Str icon_name)
      Sets the icon name for @self.
      Parameters:
      icon_name - the icon name
    • setIconName

      public void setIconName(String icon_name)
      Sets the icon name for @self.
      Parameters:
      icon_name - the icon name
    • setSubtitle

      public void setSubtitle(@Nonnull Str subtitle)
      Sets the subtitle for @self.

      The subtitle is interpreted as Pango markup unless
      [property@PreferencesRow:use-markup] is set to `FALSE`.
      Parameters:
      subtitle - the subtitle
    • setSubtitle

      public void setSubtitle(String subtitle)
      Sets the subtitle for @self.

      The subtitle is interpreted as Pango markup unless
      [property@PreferencesRow:use-markup] is set to `FALSE`.
      Parameters:
      subtitle - the subtitle
    • setSubtitleLines

      public void setSubtitleLines(int subtitle_lines)
      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.
      Parameters:
      subtitle_lines - the number of lines at the end of which the subtitle label will be ellipsized
    • setTitleLines

      public void setTitleLines(int title_lines)
      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.
      Parameters:
      title_lines - the number of lines at the end of which the title label will be ellipsized
    • onActivated

      public SignalHandler onActivated(ActionRow.OnActivated signal)
      Connect to signal "activated".
      See ActionRow.OnActivated.onActivated() for signal description.
      Field SIGNAL_ON_ACTIVATED contains original signal name and can be used as resource reference.
      Parameters:
      signal - callback function (lambda).
      Returns:
      SignalHandler. Can be used to disconnect signal and to release callback function.
    • asAccessible

      public Accessible asAccessible()
      Implements interface Accessible. Call this to get access to interface functions.
      Overrides:
      asAccessible in class PreferencesRow
      Returns:
      Accessible
    • asActionable

      public Actionable asActionable()
      Implements interface Actionable. Call this to get access to interface functions.
      Overrides:
      asActionable in class PreferencesRow
      Returns:
      Actionable
    • asBuildable

      public Buildable asBuildable()
      Implements interface Buildable. Call this to get access to interface functions.
      Overrides:
      asBuildable in class PreferencesRow
      Returns:
      Buildable
    • asConstraintTarget

      public ConstraintTarget asConstraintTarget()
      Implements interface ConstraintTarget. Call this to get access to interface functions.
      Overrides:
      asConstraintTarget in class PreferencesRow
      Returns:
      ConstraintTarget
    • getTypeID

      public static long getTypeID()
    • getParentTypeID

      public static long getParentTypeID()
    • getTypeSize

      public static TypeSystem.TypeSize getTypeSize()
    • getParentTypeSize

      public static TypeSystem.TypeSize getParentTypeSize()
    • getInstanceSize

      public static int getInstanceSize()