summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2015-10-25 10:38:16 +0900
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-10-25 12:19:18 +0900
commit1ff309c9a1f1d6a4bcbb7afb2561a412ae64903d (patch)
treeaa06925bb694c589a164e41da07b19081f458a59
parentbf2df951e67758eece18499e8edf86cb779692b5 (diff)
downloadsubsurface-1ff309c9a1f1d6a4bcbb7afb2561a412ae64903d.tar.gz
Fix location edit UI issue on Mac
For some reason the Mac doesn't create an "activated" signal when hitting enter/return on the drop down. So we simply manually send this and now you can select the site with enter/return just like on Linux or Windows. Fixes #953 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--qt-ui/locationinformation.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/qt-ui/locationinformation.cpp b/qt-ui/locationinformation.cpp
index e581757dd..aee0b7328 100644
--- a/qt-ui/locationinformation.cpp
+++ b/qt-ui/locationinformation.cpp
@@ -425,6 +425,12 @@ bool DiveLocationLineEdit::eventFilter(QObject *o, QEvent *e)
if (keyEv->key() == Qt::Key_Return ||
keyEv->key() == Qt::Key_Enter) {
+#if __APPLE__
+ // for some reason it seems like on a Mac hitting return/enter
+ // doesn't call 'activated' for that index. so let's do it manually
+ if (view->currentIndex().isValid())
+ itemActivated(view->currentIndex());
+#endif
view->hide();
return false;
}