summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2010-05-24 15:49:03 (GMT)
committerKevin Smith <git@kismith.co.uk>2010-05-24 15:49:03 (GMT)
commit10534d5b942e7ef1e2f8e6900fb5b17411111b06 (patch)
treedad1d97e518614150b38a4f7a1e262228b732bff /Swift/QtUI/QtStatusWidget.cpp
parentc85da0a6e0448b07c51ae07e41a6714429510b83 (diff)
downloadswift-10534d5b942e7ef1e2f8e6900fb5b17411111b06.zip
swift-10534d5b942e7ef1e2f8e6900fb5b17411111b06.tar.bz2
Elide text in the roster header when it's wider than the roster.
Resolves: #369
Diffstat (limited to 'Swift/QtUI/QtStatusWidget.cpp')
-rw-r--r--Swift/QtUI/QtStatusWidget.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/Swift/QtUI/QtStatusWidget.cpp b/Swift/QtUI/QtStatusWidget.cpp
index da8b883..28df59c 100644
--- a/Swift/QtUI/QtStatusWidget.cpp
+++ b/Swift/QtUI/QtStatusWidget.cpp
@@ -19,6 +19,8 @@
#include <QListWidget>
#include <QListWidgetItem>
+#include "Swift/QtUI/QtElidingLabel.h"
+
namespace Swift {
QtStatusWidget::QtStatusWidget(QWidget *parent) : QWidget(parent), editCursor_(Qt::IBeamCursor), viewCursor_(Qt::PointingHandCursor) {
@@ -46,7 +48,7 @@ QtStatusWidget::QtStatusWidget(QWidget *parent) : QWidget(parent), editCursor_(Q
statusIcon_->setMaximumSize(16, 16);
page1Layout->addWidget(statusIcon_);
- statusTextLabel_ = new QLabel(this);
+ statusTextLabel_ = new QtElidingLabel(this);
page1Layout->addWidget(statusTextLabel_);
icons_[StatusShow::Online] = QIcon(":/icons/online.png");
@@ -103,7 +105,8 @@ void QtStatusWidget::handleClicked() {
int y = point.y();
int width = 200;
int height = 80;
- int screenWidth = QApplication::desktop()->screenGeometry().width();
+ int desktop = QApplication::desktop()->screenNumber(this);
+ int screenWidth = QApplication::desktop()->screenGeometry(desktop).width();
if (x + width > screenWidth) {
x = screenWidth - width;
}