┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/statusbar/dolphinstatusbar.cpp
diff options
context:
space:
mode:
authorFabio D'Urso <[email protected]>2013-08-01 14:17:26 +0200
committerFabio D'Urso <[email protected]>2013-08-05 02:12:09 +0200
commit87f830302347e9773404f51de73afc7041829374 (patch)
treedc82018252d2cb1009ae5b7f393f0a71de8b61ac /src/statusbar/dolphinstatusbar.cpp
parent254ab4b579094c6c8af6b4d34d4e0c0faf4acadd (diff)
dolphin: Escape text in statusbar tooltip
This fixes the same issue as 4450f8449af91e491636728a4669e2a9e27b49fa, but for the status bar's tooltip text. BUG: 323170 FIXED-IN: 4.11.0 REVIEW: 111836
Diffstat (limited to 'src/statusbar/dolphinstatusbar.cpp')
-rw-r--r--src/statusbar/dolphinstatusbar.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/statusbar/dolphinstatusbar.cpp b/src/statusbar/dolphinstatusbar.cpp
index 148919172..bff956642 100644
--- a/src/statusbar/dolphinstatusbar.cpp
+++ b/src/statusbar/dolphinstatusbar.cpp
@@ -34,6 +34,7 @@
#include <QHBoxLayout>
#include <QLabel>
#include <QProgressBar>
+#include <QTextDocument>
#include <QToolButton>
#include <QTime>
#include <QTimer>
@@ -324,10 +325,17 @@ void DolphinStatusBar::updateLabelText()
{
const QString text = m_text.isEmpty() ? m_defaultText : m_text;
+ // Set status bar text and elide it if too long
QFontMetrics fontMetrics(m_label->font());
const QString elidedText = fontMetrics.elidedText(text, Qt::ElideRight, m_label->width());
m_label->setText(elidedText);
- m_label->setToolTip(text == elidedText ? QString() : text);
+
+ // If the text has been elided, set the original text as tooltip
+ if (text != elidedText) {
+ m_label->setToolTip(Qt::convertFromPlainText(text));
+ } else {
+ m_label->setToolTip(QString());
+ }
}
void DolphinStatusBar::slotResetToDefaultText()