Class PreferencesGroup

All Implemented Interfaces:
PointerInterface

public class PreferencesGroup extends Widget
A group of preference rows.

<picture>
<source srcset="preferences-group-dark.png" media="(prefers-color-scheme: dark)">
<img src="preferences-group.png" alt="preferences-group">
</picture>

An `AdwPreferencesGroup` represents a group or tightly related preferences,
which in turn are represented by [class@PreferencesRow].

To summarize the role of the preferences it gathers, a group can have both a
title and a description. The title will be used by [class@PreferencesWindow]
to let the user look for a preference.

## AdwPreferencesGroup as GtkBuildable

The `AdwPreferencesGroup` implementation of the [iface@Gtk.Buildable] interface
supports adding [class@PreferencesRow]s to the list by omitting "type". If "type"
is omitted and the widget isn't a [class@PreferencesRow] the child is added to
a box below the list.

When the "type" attribute of a child is `header-suffix`, the child
is set as the suffix on the end of the title and description.

## CSS nodes

`AdwPreferencesGroup` has a single CSS node with name `preferencesgroup`.

## Accessibility

`AdwPreferencesGroup` uses the `GTK_ACCESSIBLE_ROLE_GROUP` role.

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

  • Constructor Details

    • PreferencesGroup

      public PreferencesGroup(PointerContainer pointer)
    • PreferencesGroup

      public PreferencesGroup()
      Creates a new `AdwPreferencesGroup`.
  • Method Details

    • getClassHandler

      public static ClassHandler getClassHandler()
    • add

      public void add(@Nonnull Widget child)
      Adds a child to @self.
      Parameters:
      child - the widget to add
    • getDescription

      public Str getDescription()
      Gets the description of @self.
      Returns:
      the description of @self
    • getHeaderSuffix

      public Widget getHeaderSuffix()
      Gets the suffix for @self's header.
      Returns:
      the suffix for @self's header.
    • getTitle

      public Str getTitle()
      Gets the title of @self.
      Returns:
      the title of @self
    • remove

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

      public void setDescription(@Nullable Str description)
      Sets the description for @self.
      Parameters:
      description - the description
    • setDescription

      public void setDescription(String description)
      Sets the description for @self.
      Parameters:
      description - the description
    • setHeaderSuffix

      public void setHeaderSuffix(@Nullable Widget suffix)
      Sets the suffix for @self's header.

      Displayed above the list, next to the title and description.

      Suffixes are commonly used to show a button or a spinner for the whole group.
      Parameters:
      suffix - the suffix to set
    • setTitle

      public void setTitle(@Nonnull Str title)
      Sets the title for @self.
      Parameters:
      title - the title
    • setTitle

      public void setTitle(String title)
      Sets the title for @self.
      Parameters:
      title - the title
    • asAccessible

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

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

      public ConstraintTarget asConstraintTarget()
      Implements interface ConstraintTarget. Call this to get access to interface functions.
      Overrides:
      asConstraintTarget in class Widget
      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()