Struct libadwaita::builders::ToastBuilder
source · pub struct ToastBuilder { /* private fields */ }
Expand description
A builder-pattern type to construct Toast
objects.
Implementations§
source§impl ToastBuilder
impl ToastBuilder
sourcepub fn action_name(self, action_name: impl Into<GString>) -> Self
pub fn action_name(self, action_name: impl Into<GString>) -> Self
The name of the associated action.
It will be activated when clicking the button.
See action-target
.
sourcepub fn action_target(self, action_target: &Variant) -> Self
pub fn action_target(self, action_target: &Variant) -> Self
The parameter for action invocations.
The label to show on the button.
Underlines in the button text can be used to indicate a mnemonic.
If set to NULL
, the button won’t be shown.
See action-name
.
sourcepub fn custom_title(self, custom_title: &impl IsA<Widget>) -> Self
Available on crate feature v1_2
only.
pub fn custom_title(self, custom_title: &impl IsA<Widget>) -> Self
v1_2
only.sourcepub fn priority(self, priority: ToastPriority) -> Self
pub fn priority(self, priority: ToastPriority) -> Self
The priority of the toast.
Priority controls how the toast behaves when another toast is already being displayed.
If the priority is ADW_TOAST_PRIORITY_NORMAL
, the toast will be queued.
If the priority is ADW_TOAST_PRIORITY_HIGH
, the toast will be displayed
immediately, pushing the previous toast into the queue instead.
sourcepub fn timeout(self, timeout: u32) -> Self
pub fn timeout(self, timeout: u32) -> Self
The timeout of the toast, in seconds.
If timeout is 0, the toast is displayed indefinitely until manually dismissed.
Toasts cannot disappear while being hovered, pressed (on touchscreen), or have keyboard focus inside them.
sourcepub fn title(self, title: impl Into<GString>) -> Self
pub fn title(self, title: impl Into<GString>) -> Self
The title of the toast.
The title can be marked up with the Pango text markup language.
Setting a title will unset custom-title
.
If custom-title
is set, it will be used instead.
sourcepub fn use_markup(self, use_markup: bool) -> Self
Available on crate feature v1_4
only.
pub fn use_markup(self, use_markup: bool) -> Self
v1_4
only.Whether to use Pango markup for the toast title.
See also parse_markup()
.