diff options
author | Kevin Smith <git@kismith.co.uk> | 2010-05-25 17:15:30 (GMT) |
---|---|---|
committer | Kevin Smith <git@kismith.co.uk> | 2010-05-25 17:15:30 (GMT) |
commit | 2a5340bd4c758a1e61c10aaaf5ebed725243a151 (patch) | |
tree | ad638f996b8d121499babdc0714a84973d35b45e | |
parent | fe1c7fc8a8b1eb29f92795d760bbfc8f3cf618e8 (diff) | |
download | swift-contrib-2a5340bd4c758a1e61c10aaaf5ebed725243a151.zip swift-contrib-2a5340bd4c758a1e61c10aaaf5ebed725243a151.tar.bz2 |
Display the status changer on the right screen.
Resolves: #365
-rw-r--r-- | Swift/QtUI/QtStatusWidget.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/Swift/QtUI/QtStatusWidget.cpp b/Swift/QtUI/QtStatusWidget.cpp index 6281b52..4801ff9 100644 --- a/Swift/QtUI/QtStatusWidget.cpp +++ b/Swift/QtUI/QtStatusWidget.cpp @@ -133,13 +133,16 @@ void QtStatusWidget::generateList() { void QtStatusWidget::handleClicked() { editing_ = true; + QDesktopWidget* desktop = QApplication::desktop(); + int screen = desktop->screenNumber(this); QPoint point = mapToGlobal(QPoint(0, height())); + QRect geometry = desktop->availableGeometry(screen); int x = point.x(); int y = point.y(); int width = 200; int height = 80; - int desktop = QApplication::desktop()->screenNumber(this); - int screenWidth = QApplication::desktop()->screenGeometry(desktop).width(); + + int screenWidth = geometry.x() + geometry.width(); if (x + width > screenWidth) { x = screenWidth - width; } @@ -147,15 +150,14 @@ void QtStatusWidget::handleClicked() { height = menu_->sizeHintForRow(0) * menu_->count(); menu_->setGeometry(x, y, width, height); + menu_->move(x, y); menu_->setMaximumWidth(width); - - menu_->show(); activateWindow(); statusEdit_->selectAll(); stack_->setCurrentIndex(1); statusEdit_->setFocus(); - connect(qApp, SIGNAL(focusChanged(QWidget*, QWidget*)), this, SLOT(handleApplicationFocusChanged(QWidget*, QWidget*)), Qt/*::ConnectionType*/::QueuedConnection); + connect(qApp, SIGNAL(focusChanged(QWidget*, QWidget*)), this, SLOT(handleApplicationFocusChanged(QWidget*, QWidget*)), Qt::QueuedConnection); } void QtStatusWidget::viewMode() { |