mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
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>
This commit is contained in:
parent
bf2df951e6
commit
1ff309c9a1
1 changed files with 6 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue