X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fstatusbarmessagelabel.h;h=a0f491df6994f8e7d912f02455713b9d116a46f3;hb=bb32a23e9e4ed5b55320c7074b3eca686ef8c0c5;hp=51312cae62f438079e6f3921e40f9d16f2a20c51;hpb=f5584dd222f8bda079f31c903b2b59ce82747ed9;p=kdenlive diff --git a/src/statusbarmessagelabel.h b/src/statusbarmessagelabel.h index 51312cae..a0f491df 100644 --- a/src/statusbarmessagelabel.h +++ b/src/statusbarmessagelabel.h @@ -24,16 +24,16 @@ #define STATUSBARMESSAGELABEL_H -#include -#include +#include +#include +#include +#include -#include #include class QPaintEvent; class QResizeEvent; class QPushButton; -class QTimer; /** * @brief Represents a message text label as part of the status bar. @@ -43,7 +43,8 @@ class QTimer; * DolphinStatusBar::Error a dynamic color blending is done to get the * attention from the user. */ -class StatusBarMessageLabel : public QWidget { +class StatusBarMessageLabel : public QWidget +{ Q_OBJECT public: @@ -54,20 +55,10 @@ public: const QString& text() const; - void setDefaultText(const QString& text); - const QString& defaultText() const; - // TODO: maybe a better approach is possible with the size hint void setMinimumTextHeight(int min); int minimumTextHeight() const; - /** - * Returns the gap of the width of the current set text to the - * width of the message label. A gap <= 0 means that the text - * fits into the available width. - */ - int widthGap() const; - protected: /** @see QWidget::paintEvent() */ virtual void paintEvent(QPaintEvent* event); @@ -133,31 +124,26 @@ private: State m_state; int m_illumination; int m_minTextHeight; - QTimer* m_timer; + QTimer m_timer; + QTimer m_hidetimer; QString m_text; - QString m_defaultText; QList m_pendingMessages; QPixmap m_pixmap; QPushButton* m_closeButton; }; -inline MessageType StatusBarMessageLabel::type() const { +inline MessageType StatusBarMessageLabel::type() const +{ return m_type; } -inline const QString& StatusBarMessageLabel::text() const { +inline const QString& StatusBarMessageLabel::text() const +{ return m_text; } -inline void StatusBarMessageLabel::setDefaultText(const QString& text) { - m_defaultText = text; -} - -inline const QString& StatusBarMessageLabel::defaultText() const { - return m_defaultText; -} - -inline int StatusBarMessageLabel::minimumTextHeight() const { +inline int StatusBarMessageLabel::minimumTextHeight() const +{ return m_minTextHeight; }