summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2011-04-03 10:17:17 +0200
committerAndrea Diamantini <adjam7@gmail.com>2011-04-03 10:17:17 +0200
commit35da197e537bee57fe50fbe675aa069047610cc6 (patch)
tree0a13c08c3e5cdb608c942018e563fab0f63d1549 /src
parentImplement/fix drag and drop handling of text & url in the webview (diff)
downloadrekonq-35da197e537bee57fe50fbe675aa069047610cc6.tar.xz
Elide notifyPopup text if it would be longer than window's width
Johannes Troscher's patch Reviewed by me ;)
Diffstat (limited to 'src')
-rw-r--r--src/mainwindow.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 75287ad7..34898411 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -1149,7 +1149,11 @@ void MainWindow::notifyMessage(const QString &msg, Rekonq::Notify status)
QLabel *label = new QLabel(msg);
m_popup->setView(label);
QSize labelSize(label->fontMetrics().width(msg) + 2*margin, label->fontMetrics().height() + 2*margin);
- if (labelSize.width() > width()) labelSize.setWidth(width());
+ if (labelSize.width() > width())
+ {
+ labelSize.setWidth(width());
+ label->setText(label->fontMetrics().elidedText(msg, Qt::ElideMiddle, width()));
+ }
m_popup->setFixedSize(labelSize);
m_popup->layout()->setAlignment(Qt::AlignTop);
m_popup->layout()->setMargin(margin);