mirror of
https://github.com/FAUSheppy/speech-server-client-qt
synced 2025-12-06 00:41:35 +01:00
Implement basic functionality
This commit is contained in:
38
notificationwidget.h
Normal file
38
notificationwidget.h
Normal file
@@ -0,0 +1,38 @@
|
||||
#ifndef NOTIFICATIONWIDGET_H
|
||||
#define NOTIFICATIONWIDGET_H
|
||||
|
||||
#include <QWidget>
|
||||
#include <QLabel>
|
||||
#include <QGridLayout>
|
||||
#include <QPropertyAnimation>
|
||||
|
||||
class NotificationWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
Q_PROPERTY(float popupOpacity READ getPopupOpacity WRITE setPopupOpacity)
|
||||
|
||||
void setPopupOpacity(float opacity);
|
||||
float getPopupOpacity() const;
|
||||
|
||||
public:
|
||||
explicit NotificationWidget(QWidget *parent = nullptr);
|
||||
protected:
|
||||
void paintEvent(QPaintEvent *e);
|
||||
|
||||
public slots:
|
||||
void setPopupText(const QString& text);
|
||||
void show();
|
||||
void fadeOut();
|
||||
|
||||
private slots:
|
||||
void hideAndDestroy();
|
||||
|
||||
private:
|
||||
QLabel label;
|
||||
QGridLayout layout;
|
||||
QPropertyAnimation animation;
|
||||
float popupOpacity;
|
||||
};
|
||||
|
||||
#endif // NOTIFICATIONWIDGET_H
|
||||
Reference in New Issue
Block a user