|
Maki
Formally verfied low-code orchestration
|
A transient UI widget for displaying notifications with animation and auto-dismiss support. More...
#include <notification_widget.h>
Public Slots | |
| void | showAnimated () |
| Shows the notification with a fade-in animation. | |
| void | hideAnimated () |
| Hides the notification with a fade-out animation. | |
Signals | |
| void | dismissed (NotificationWidget *self) |
| Emitted when the notification is dismissed. | |
Public Member Functions | |
| NotificationWidget (const QString &title, const QString &text, logging::LogLevel level, QWidget *parent=nullptr) | |
| Constructs a notification widget. | |
| qreal | opacity () const |
| Returns the current opacity of the widget. | |
| void | setOpacity (qreal o) |
| Sets the opacity of the widget. | |
| Public Member Functions inherited from StyledFrame | |
| StyledFrame (QWidget *parent=nullptr) | |
| Constructs a StyledFrame with the given parent. | |
| void | setBackgroundRole (BackgroundRole role) |
| Sets the background role of the frame. | |
| void | setBorderRole (BorderRole role) |
| Sets the border role of the frame. | |
| void | setCustomBackgroundColor (const QColor &color) |
| Sets a custom background color for the frame. | |
| void | setCustomBorderColor (const QColor &color) |
| Sets a custom border color for the frame. | |
| void | setBorderWidth (int width) |
| Sets the width of the border. | |
| void | setRadius (qreal radius) |
| Sets the radius for rounded corners. | |
Protected Attributes | |
| QTimer | mAutoCloseTimer |
| Timer used to automatically dismiss the notification. | |
| QPropertyAnimation * | mFadeAnim |
| Animation used to control opacity transitions. | |
Properties | |
| qreal | opacity |
| Controls the visual opacity of the widget. | |
Private Attributes | |
| ClickableIcon * | mMinimizeButton |
| Button used to manually minimize the notification. | |
| ClickableIcon * | mCloseButton |
| Button used to manually dismiss the notification. | |
| bool | mMinimized |
| Whether the widget is expanded or minimized. | |
| qreal | mOpacity |
| Current opacity value of the widget. | |
Additional Inherited Members | |
| Protected Member Functions inherited from StyledFrame | |
| void | paintEvent (QPaintEvent *event) override |
| Handles the paint event to draw the styled frame. | |
A transient UI widget for displaying notifications with animation and auto-dismiss support.
This widget displays a message with a title and severity level, and supports:
The widget exposes an opacity property used for animation.
| NotificationWidget::NotificationWidget | ( | const QString & | title, |
| const QString & | text, | ||
| logging::LogLevel | level, | ||
| QWidget * | parent = nullptr ) |
Constructs a notification widget.
| title | The title of the notification. |
| text | The main message text. |
| level | The log level determining the visual style (e.g., info, warning, error). |
| parent | The parent widget. |
|
signal |
Emitted when the notification is dismissed.
| self | Pointer to this notification widget. |
| qreal NotificationWidget::opacity | ( | ) | const |
Returns the current opacity of the widget.
| void NotificationWidget::setOpacity | ( | qreal | o | ) |
Sets the opacity of the widget.
| o | The opacity value to set (typically between 0.0 and 1.0). |
|
readwrite |
Controls the visual opacity of the widget.
This property is typically animated using QPropertyAnimation to create fade-in and fade-out effects.