summaryrefslogtreecommitdiffstats
path: root/qt-ui
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2015-09-23 16:03:28 -0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-09-23 14:15:49 -0700
commit5b3d52acecbe9aac8dd6641fe04703696fa49380 (patch)
tree332a5d06e7600a4e736208eac191de4900ad8b0d /qt-ui
parentd586970f3145106d444af8c54651af6563b92a66 (diff)
downloadsubsurface-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>
Diffstat (limited to 'qt-ui')
-rw-r--r--qt-ui/locationinformation.cpp6
-rw-r--r--qt-ui/locationinformation.h2
-rw-r--r--qt-ui/maintab.cpp3
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;
}