diff options
author | Tomaz Canabrava <tomaz.canabrava@intel.com> | 2015-09-23 16:03:28 -0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-09-23 14:15:49 -0700 |
commit | 5b3d52acecbe9aac8dd6641fe04703696fa49380 (patch) | |
tree | 332a5d06e7600a4e736208eac191de4900ad8b0d | |
parent | d586970f3145106d444af8c54651af6563b92a66 (diff) | |
download | subsurface-5b3d52acecbe9aac8dd6641fe04703696fa49380.tar.gz |
Correctly fix the popup position
When the message to 'This dive site is being edited' was
being show while the popup to choose the dive site, the
line edit was being covered. now it correctly moves to
the correct place.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r-- | qt-ui/locationinformation.cpp | 6 | ||||
-rw-r--r-- | qt-ui/locationinformation.h | 2 | ||||
-rw-r--r-- | qt-ui/maintab.cpp | 3 |
3 files changed, 9 insertions, 2 deletions
diff --git a/qt-ui/locationinformation.cpp b/qt-ui/locationinformation.cpp index 3b3e02b12..56ef2d7f3 100644 --- a/qt-ui/locationinformation.cpp +++ b/qt-ui/locationinformation.cpp @@ -489,7 +489,7 @@ void DiveLocationLineEdit::keyPressEvent(QKeyEvent *ev) } } -void DiveLocationLineEdit::showPopup() +void DiveLocationLineEdit::fixPopupPosition() { const QRect screen = QApplication::desktop()->availableGeometry(this); const int maxVisibleItems = 5; @@ -522,7 +522,11 @@ void DiveLocationLineEdit::showPopup() } view->setGeometry(pos.x(), pos.y(), w, h); +} +void DiveLocationLineEdit::showPopup() +{ + fixPopupPosition(); if (!view->isVisible()) { setTemporaryDiveSiteName(text()); proxy->invalidate(); diff --git a/qt-ui/locationinformation.h b/qt-ui/locationinformation.h index db6809015..3e8adeae2 100644 --- a/qt-ui/locationinformation.h +++ b/qt-ui/locationinformation.h @@ -85,7 +85,7 @@ public: void itemActivated(const QModelIndex& index); DiveSiteType currDiveSiteType() const; uint32_t currDiveSiteUuid() const; - + void fixPopupPosition(); signals: void diveSiteSelected(uint32_t uuid); diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp index 8dca49eee..867d7a172 100644 --- a/qt-ui/maintab.cpp +++ b/qt-ui/maintab.cpp @@ -195,6 +195,9 @@ MainTab::MainTab(QWidget *parent) : QTabWidget(parent), connect(ReverseGeoLookupThread::instance(), &QThread::finished, this, &MainTab::setCurrentLocationIndex); + connect(ui.diveNotesMessage, &KMessageWidget::showAnimationFinished, + ui.location, &DiveLocationLineEdit::fixPopupPosition); + acceptingEdit = false; } |