Adw.ToastOverlay¶
- Subclasses:
None
Methods¶
- Inherited:
Gtk.Widget (183), GObject.Object (37), Gtk.Accessible (17), Gtk.Buildable (1)
- Structs:
class |
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Gtk.Widget (25), GObject.Object (7), Gtk.Accessible (6), Gtk.Buildable (9)
Properties¶
- Inherited:
Name |
Type |
Flags |
Short Description |
|---|---|---|---|
r/w/en |
Signals¶
- Inherited:
Fields¶
- Inherited:
Class Details¶
- class Adw.ToastOverlay(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
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],
AdwToastOverlayis 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].Use [method`ToastOverlay`.dismiss_all] to dismiss all toasts at once, or [method`Toast`.dismiss] to dismiss a single 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 calledtoastoverlay. It contains the child, as well as zero or moretoastsubnodes.Each of the
toastnodes contains awidgetsubnode, optionally abuttonsubnode, and anotherbuttonsubnode with.circularand.flatstyle classes.The
widgetsubnode contains alabelsubnode with the.headingstyle class, or a custom widget provided by the application.- Accessibility
AdwToastOverlayuses the [enum`Gtk`.AccessibleRole.GROUP] role.- classmethod new()¶
- Returns:
the new created
AdwToastOverlay- Return type:
Creates a new
AdwToastOverlay.
- add_toast(toast)¶
- Parameters:
toast (
Adw.Toast) – a 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`:py:data::priority<Adw.ToastOverlay.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.
- dismiss_all()¶
Dismisses all displayed toasts.
Use [method`Toast`.dismiss] to dismiss a single toast.
New in version 1.7.
- get_child()¶
- Returns:
the child widget of self
- Return type:
Gtk.WidgetorNone
Gets the child widget of self.
- set_child(child)¶
- Parameters:
child (
Gtk.WidgetorNone) – the child widget
Sets the child widget of self.
Property Details¶
- Adw.ToastOverlay.props.child¶
- Name:
child- Type:
- Default Value:
- Flags:
The child widget.