From 5b3d52acecbe9aac8dd6641fe04703696fa49380 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Wed, 23 Sep 2015 16:03:28 -0300 Subject: 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 Signed-off-by: Dirk Hohndel --- qt-ui/locationinformation.cpp | 6 +++++- qt-ui/locationinformation.h | 2 +- qt-ui/maintab.cpp | 3 +++ 3 files changed, 9 insertions(+), 2 deletions(-) (limited to 'qt-ui') 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; } -- cgit v1.2.3-70-g09d2