Skip to content
Snippets Groups Projects
Commit d7200cc8 authored by Liam Coursodon's avatar Liam Coursodon Committed by Sébastien Blin
Browse files

ChatViewFooter : use Escape for closing box

Closing emoji box, record box and location box by pressing Esc Key
Using opened that already exists instead of creating isOpen

GitLab: #1197
Change-Id: I8461a7f2e8acaffe4ab66647d3e98701c608f270
parent 3383f436
No related branches found
No related tags found
No related merge requests found
......@@ -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 {
......
......@@ -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)
{
......
......@@ -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 = "");
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment