:right-sidebar: True ToastOverlay =================================================================== .. currentmodule:: gi.repository.Adw .. class:: ToastOverlay(**properties: ~typing.Any) :no-contents-entry: Superclasses: :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.Buildable`, :class:`~gi.repository.Gtk.ConstraintTarget` A widget showing toasts above its content. .. image:: https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/toast-overlay.png Much like :obj:`~gi.repository.Gtk.Overlay`\, ``AdwToastOverlay`` is a container with a single main child, on top of which it can display a :obj:`~gi.repository.Adw.Toast`\, overlaid. Toasts can be shown with :obj:`~gi.repository.ToastOverlay.add_toast`\. See :obj:`~gi.repository.Adw.Toast` for details. CSS nodes -------------------------------------------------------------------------------- .. code-block:: :dedent: 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 :obj:`~gi.repository.Gtk.AccessibleRole.GROUP` role. Constructors ------------ .. rst-class:: interim-class .. class:: ToastOverlay :no-index: .. classmethod:: new() -> ~gi.repository.Gtk.Widget Creates a new ``AdwToastOverlay``\. Methods ------- .. rst-class:: interim-class .. class:: ToastOverlay :no-index: .. method:: add_toast(toast: ~gi.repository.Adw.Toast) -> None 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 :obj:`~gi.repository.Adw.Toast.props.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. :param toast: a toast .. method:: get_child() -> ~gi.repository.Gtk.Widget | None Gets the child widget of ``self``\. .. method:: set_child(child: ~gi.repository.Gtk.Widget | None = None) -> None Sets the child widget of ``self``\. :param child: the child widget Properties ---------- .. rst-class:: interim-class .. class:: ToastOverlay :no-index: .. attribute:: props.child :type: ~gi.repository.Gtk.Widget The type of the None singleton.