mirror of
https://invent.kde.org/system/dolphin
synced 2024-09-12 12:54:29 +00:00
Merge remote-tracking branch 'origin/KDE/4.11'
This commit is contained in:
commit
68520f55f0
|
@ -356,7 +356,7 @@ void DolphinPart::slotRequestItemInfo(const KFileItem& item)
|
||||||
if (item.isNull()) {
|
if (item.isNull()) {
|
||||||
updateStatusBar();
|
updateStatusBar();
|
||||||
} else {
|
} else {
|
||||||
const QString escapedText = Qt::escape(item.getStatusBarInfo());
|
const QString escapedText = Qt::convertFromPlainText(item.getStatusBarInfo());
|
||||||
ReadOnlyPart::setStatusBarText(QString("<qt>%1</qt>").arg(escapedText));
|
ReadOnlyPart::setStatusBarText(QString("<qt>%1</qt>").arg(escapedText));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,6 +34,7 @@
|
||||||
#include <QHBoxLayout>
|
#include <QHBoxLayout>
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
#include <QProgressBar>
|
#include <QProgressBar>
|
||||||
|
#include <QTextDocument>
|
||||||
#include <QToolButton>
|
#include <QToolButton>
|
||||||
#include <QTime>
|
#include <QTime>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
|
@ -324,10 +325,17 @@ void DolphinStatusBar::updateLabelText()
|
||||||
{
|
{
|
||||||
const QString text = m_text.isEmpty() ? m_defaultText : m_text;
|
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());
|
QFontMetrics fontMetrics(m_label->font());
|
||||||
const QString elidedText = fontMetrics.elidedText(text, Qt::ElideRight, m_label->width());
|
const QString elidedText = fontMetrics.elidedText(text, Qt::ElideRight, m_label->width());
|
||||||
m_label->setText(elidedText);
|
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()
|
void DolphinStatusBar::slotResetToDefaultText()
|
||||||
|
|
Loading…
Reference in a new issue