A transient, dismissible notification anchored to an edge of the window.
More...
#include <Malena/Graphics/Controls/Toast.h>
A transient, dismissible notification anchored to an edge of the window.
A Toast shows a short message with an optional action button (e.g. "Connect") and a dismiss button. It is hidden by default; call show() to reveal it and hide() to remove it. While hidden it draws nothing and its buttons are disabled so they never intercept clicks.
Unlike Modal, a Toast does not block the rest of the UI — it sits in a corner and the user can ignore it. Typical use is a non-intrusive prompt:
toast.
onAction ([
this]{ connectToHub(); });
A transient, dismissible notification anchored to an edge of the window.
void setMessage(const std::string &text)
void onDismiss(std::function< void()> cb)
void setActionLabel(const std::string &label)
void onAction(std::function< void()> cb)
- See also
- Modal
Definition at line 42 of file Toast.h.
◆ Anchor
◆ Toast()
◆ draw()
◆ getGlobalBounds()
◆ getPosition()
◆ hide()
◆ isVisible()
| bool ml::Toast::isVisible |
( |
| ) |
const |
|
inlinenodiscard |
◆ onAction()
| void ml::Toast::onAction |
( |
std::function< void()> | cb | ) |
|
|
inline |
◆ onDismiss()
| void ml::Toast::onDismiss |
( |
std::function< void()> | cb | ) |
|
|
inline |
◆ setActionLabel()
| void ml::Toast::setActionLabel |
( |
const std::string & | label | ) |
|
◆ setAnchor()
| void ml::Toast::setAnchor |
( |
Anchor | a | ) |
|
|
inline |
◆ setMessage()
| void ml::Toast::setMessage |
( |
const std::string & | text | ) |
|
◆ setPosition()
◆ show()
The documentation for this class was generated from the following file: