From 7495dabc15d5a3a2c7a1e81657227f936a59144f Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Tue, 30 Jan 2007 19:38:44 +0000 Subject: Improvements for error messages: - increase/decrease size on demand and hide progress bar or space information if required - provide close button TODO: the code is far from being finished (e. g. no queueing of pending error messages, close button looks fugly, ...), but I decided to commit the changes to prevent getting an inconsistent state in combination with other commits... svn path=/trunk/playground/utils/dolphin/; revision=628642 --- src/statusbarmessagelabel.h | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) (limited to 'src/statusbarmessagelabel.h') diff --git a/src/statusbarmessagelabel.h b/src/statusbarmessagelabel.h index 03683c107..b75e499fb 100644 --- a/src/statusbarmessagelabel.h +++ b/src/statusbarmessagelabel.h @@ -21,13 +21,15 @@ #ifndef STATUSBARMESSAGELABEL_H #define STATUSBARMESSAGELABEL_H -#include -#include -#include -//Added by qt3to4: -#include -#include #include + +#include +#include +#include + +class QPaintEvent; +class QResizeEvent; +class QPushButton; class QTimer; /** @@ -84,6 +86,12 @@ private slots: */ int availableTextWidth() const; + /** + * Moves the close button to the upper right corner + * of the message label. + */ + void updateCloseButtonPosition(); + private: enum State { Default, @@ -101,12 +109,13 @@ private: QTimer* m_timer; QString m_text; QPixmap m_pixmap; + QPushButton* m_closeButton; QColor mixColors(const QColor& c1, const QColor& c2, int percent) const; - int pixmapGap() const { return 3; } + int borderGap() const { return 3; } }; #endif -- cgit v1.3.1