Class ToastOverlay

All Implemented Interfaces:
PointerInterface

public class ToastOverlay extends Widget
A widget showing toasts above its content.

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

Much like [class@Gtk.Overlay], `AdwToastOverlay` is a container with a single
main child, on top of which it can display a [class@Toast], overlaid.
Toasts can be shown with [method@ToastOverlay.add_toast].

See [class@Toast] for details.

## CSS nodes

```
toastoverlay
├── [child]
├── toast
┊ ├── widget
┊ │ ├── [label.heading]
│ ╰── [custom title]
├── [button]
╰── button.circular.flat
```

`AdwToastOverlay`'s CSS node is called `toastoverlay`. It contains the child,
as well as zero or more `toast` subnodes.

Each of the `toast` nodes contains a `widget` subnode, optionally a `button`
subnode, and another `button` subnode with `.circular` and `.flat` style
classes.

The `widget` subnode contains a `label` subnode with the `.heading` style
class, or a custom widget provided by the application.

## Accessibility

`AdwToastOverlay` uses the `GTK_ACCESSIBLE_ROLE_TAB_GROUP` role.

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

  • Constructor Details

    • ToastOverlay

      public ToastOverlay(PointerContainer pointer)
    • ToastOverlay

      public ToastOverlay()
      Creates a new `AdwToastOverlay`.
  • Method Details

    • getClassHandler

      public static ClassHandler getClassHandler()
    • addToast

      public void addToast(@Nonnull Toast toast)
      Displays @toast.

      Only one toast can be shown at a time; if a toast is already being displayed,
      either @toast or the original toast will be placed in a queue, depending on
      the priority of @toast. See [property@Toast:priority].

      If called on a toast that's already displayed, its timeout will be reset.

      If called on a toast currently in the queue, the toast will be bumped
      forward to be shown as soon as possible.
      Parameters:
      toast - a toast
    • getChild

      public Widget getChild()
      Gets the child widget of @self.
      Returns:
      the child widget of @self
    • setChild

      public void setChild(@Nullable Widget child)
      Sets the child widget of @self.
      Parameters:
      child - the child widget
    • 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()