diff --git a/src/app/mainview/components/ChatViewFooter.qml b/src/app/mainview/components/ChatViewFooter.qml index a50391167e2f55e43bde6f6fed3b1cc290a5e826..a15ef68a5f7b776b0893a9b85263b91169d78990 100644 --- a/src/app/mainview/components/ChatViewFooter.qml +++ b/src/app/mainview/components/ChatViewFooter.qml @@ -217,6 +217,20 @@ Rectangle { messageBar.textAreaObj.clearText(); MessagesAdapter.replyToId = ""; } + + Keys.onShortcutOverride: function (keyEvent) { + if (keyEvent.key === Qt.Key_Escape) { + if (emojiPicker != null && emojiPicker.opened) { + emojiPicker.closeEmojiPicker(); + } + else if (recordBox != null && recordBox.opened) { + recordBox.closeRecorder(); + } + else if (PositionManager.isMapActive(CurrentAccount.id)){ + PositionManager.setMapInactive(CurrentAccount.id) + } + } + } } FilesToSendContainer { diff --git a/src/app/positionmanager.cpp b/src/app/positionmanager.cpp index c4d30770a6204920db0704228729e064abf8cb9b..3b92fa6caa3de0333ff867a9a1c184f96f323b56 100644 --- a/src/app/positionmanager.cpp +++ b/src/app/positionmanager.cpp @@ -261,6 +261,13 @@ PositionManager::unPinMap(const QString& key) } } +bool +PositionManager::isMapActive(const QString& key) +{ + QMutexLocker lk(&mapStatusMutex_); + return (mapStatus_.find(key) != mapStatus_.end()); +} + void PositionManager::pinMap(const QString& key) { diff --git a/src/app/positionmanager.h b/src/app/positionmanager.h index 1dcf9d65581d39acfd35f40c3e7109aab1cbba0a..7208b98bb18e89fdb82f30118f9aecf5c9484e86 100644 --- a/src/app/positionmanager.h +++ b/src/app/positionmanager.h @@ -77,6 +77,7 @@ protected: Q_INVOKABLE void unPinMap(const QString& key); Q_INVOKABLE void setMapActive(const QString& key); Q_INVOKABLE void setMapInactive(const QString& key); + Q_INVOKABLE bool isMapActive(const QString& key); Q_INVOKABLE void sharePosition(int maximumTime, const QString& accountId, const QString& convId); Q_INVOKABLE void stopSharingPosition(const QString& accountId = "", const QString& convId = ""); diff --git a/src/app/webengine/emojipicker/EmojiPicker.qml b/src/app/webengine/emojipicker/EmojiPicker.qml index 0bc1ebe31673418ccb05b7e19834aa56e2224ab9..c268e36069b44e7e73e96cd4c0662e654c85c1d0 100644 --- a/src/app/webengine/emojipicker/EmojiPicker.qml +++ b/src/app/webengine/emojipicker/EmojiPicker.qml @@ -30,7 +30,6 @@ Popup { id: root required property ListView listView - signal emojiIsPicked(string content) // Close the picker when attached to a listView that receives height/scroll