┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/statusbarmessagelabel.h
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2007-01-26 19:38:32 +0000
committerPeter Penz <[email protected]>2007-01-26 19:38:32 +0000
commit9877bef7c56b07e715d1f7a6dddc8529387b689b (patch)
tree5b0f47847ee43bd1af000851c040dddfe823db71 /src/statusbarmessagelabel.h
parentdcc41b4ad4a082301a711612934233ee2c22c5d0 (diff)
Further optimizations for the status bar: hide the space information if the status bar text does not fit into the remaining width.
svn path=/trunk/playground/utils/dolphin/; revision=627486
Diffstat (limited to 'src/statusbarmessagelabel.h')
-rw-r--r--src/statusbarmessagelabel.h23
1 files changed, 19 insertions, 4 deletions
diff --git a/src/statusbarmessagelabel.h b/src/statusbarmessagelabel.h
index 9aa8ac47d..922465584 100644
--- a/src/statusbarmessagelabel.h
+++ b/src/statusbarmessagelabel.h
@@ -37,8 +37,6 @@ class QTimer;
* is shown in front of the text. For message texts having the type
* DolphinStatusBar::Error a dynamic color blending is done to get the
* attention from the user.
- *
- * @author Peter Penz
*/
class StatusBarMessageLabel : public QWidget
{
@@ -58,17 +56,34 @@ public:
void setMinimumTextHeight(int min);
int minimumTextHeight() const { return m_minTextHeight; }
+ /**
+ * 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 */
+ /** @see QWidget::paintEvent() */
virtual void paintEvent(QPaintEvent* event);
- /** @see QWidget::resizeEvent */
+ /** @see QWidget::resizeEvent() */
virtual void resizeEvent(QResizeEvent* event);
private slots:
void timerDone();
+
+ /**
+ * Increases the height of the message label so that
+ * the given text fits into given area.
+ */
void assureVisibleText();
+ /**
+ * Returns the available width in pixels for the text.
+ */
+ int availableTextWidth() const;
+
private:
enum State {
Default,