Maki
Formally verfied low-code orchestration
Loading...
Searching...
No Matches
notification_widget.h
1// notificationwidget.h
2#pragma once
3
4#include <QFrame>
5#include <QLabel>
6#include <QPropertyAnimation>
7#include <QPushButton>
8#include <QTimer>
9#include <QVBoxLayout>
10#include <oclero/qlementine/widgets/StatusBadgeWidget.hpp>
11
12#include "clickable_icon.h"
13#include "expanding_widget.h"
14#include "frame.h"
15#include "logging.h"
16
29{
30 Q_OBJECT
31
39 Q_PROPERTY(qreal opacity READ opacity WRITE setOpacity)
40
41public:
50 NotificationWidget(const QString& title, const QString& text, logging::LogLevel level, QWidget* parent = nullptr);
51
56 qreal opacity() const;
57
62 void setOpacity(qreal o);
63
64 virtual bool disappearing() const;
65
66 int duration() const;
67 void setBadge(oclero::qlementine::StatusBadge badge);
68
69 void minimize(bool minimize);
70
71signals:
77
78public slots:
82 void showAnimated();
83
87 void hideAnimated();
88
89protected:
90 bool mAlarmSetup;
92 QPropertyAnimation* mFadeAnim;
93
94 ExpandingWidget* mBody;
95
96 void setupAlarm(int msec);
97
98private:
101
103 qreal mOpacity;
104
105 oclero::qlementine::StatusBadgeWidget* mStatusBadge;
106
107 void toggleMinimized();
108 void setMinimized(bool minimized);
109};
A clickable icon widget that can be checked or unchecked.
Definition clickable_icon.h:10
A widget that expands and collapses its content area.
Definition expanding_widget.h:17
bool mMinimized
Whether the widget is expanded or minimized.
Definition notification_widget.h:102
void setOpacity(qreal o)
Sets the opacity of the widget.
Definition notification_widget.cpp:165
void dismissed(NotificationWidget *self)
Emitted when the notification is dismissed.
qreal mOpacity
Current opacity value of the widget.
Definition notification_widget.h:103
ClickableIcon * mCloseButton
Button used to manually dismiss the notification.
Definition notification_widget.h:100
void showAnimated()
Shows the notification with a fade-in animation.
Definition notification_widget.cpp:208
ClickableIcon * mMinimizeButton
Button used to manually minimize the notification.
Definition notification_widget.h:99
void hideAnimated()
Hides the notification with a fade-out animation.
Definition notification_widget.cpp:221
qreal opacity
Controls the visual opacity of the widget.
Definition notification_widget.h:39
QTimer mAutoCloseTimer
Timer used to automatically dismiss the notification.
Definition notification_widget.h:91
QPropertyAnimation * mFadeAnim
Animation used to control opacity transitions.
Definition notification_widget.h:92
NotificationWidget(const QString &title, const QString &text, logging::LogLevel level, QWidget *parent=nullptr)
Constructs a notification widget.
Definition notification_widget.cpp:16
StyledFrame(QWidget *parent=nullptr)
Constructs a StyledFrame with the given parent.
Definition frame.cpp:3