diff --git a/src/app/mainview/components/ChatViewFooter.qml b/src/app/mainview/components/ChatViewFooter.qml index a5039116..a15ef68a 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 c4d30770..3b92fa6c 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 1dcf9d65..7208b98b 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 0bc1ebe3..c268e360 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