Add MultyMessageDialog.
This commit is contained in:
55
src/dialogs/MultyMessageDialog.h
Normal file
55
src/dialogs/MultyMessageDialog.h
Normal file
@@ -0,0 +1,55 @@
|
||||
#ifndef MULTYMESSAGEDIALOG_H
|
||||
#define MULTYMESSAGEDIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
#include <QTimer>
|
||||
#include <QLabel>
|
||||
#include <QPropertyAnimation>
|
||||
|
||||
enum MessageLevel:unsigned int
|
||||
{
|
||||
Info = 0,
|
||||
Warning,
|
||||
Error,
|
||||
Sucess,
|
||||
};
|
||||
|
||||
class MultyMessageDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
MultyMessageDialog(const QString& aMessage = "",MessageLevel aMessageLevel = MessageLevel::Info,QWidget* aParent = nullptr);
|
||||
~MultyMessageDialog() override;
|
||||
void setAutoDisappearTime(int aAutoDisappearTime);
|
||||
void setMessage(const QString& aMessage);
|
||||
void stopShowAnimation();
|
||||
|
||||
signals:
|
||||
void dialogDestroyed();
|
||||
|
||||
public slots:
|
||||
void hideDialog();
|
||||
void startHideAnimation();
|
||||
|
||||
protected:
|
||||
void showEvent(QShowEvent* aEvent) override;
|
||||
|
||||
private:
|
||||
void initializeAnimation();
|
||||
void initializeIcon();
|
||||
|
||||
private:
|
||||
int mAutoDisappearTime;
|
||||
QTimer* mTimer;
|
||||
QSize mSize;
|
||||
QPropertyAnimation* mDisappearAnimation;
|
||||
QPropertyAnimation* mShowAnimation;
|
||||
QLabel* mMessage;
|
||||
QLabel* mIcon;
|
||||
MessageLevel mLevel;
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif // MULTYMESSAGEDIALOG_H
|
||||
Reference in New Issue
Block a user