1
0
Fork 0
mirror of https://git.jami.net/savoirfairelinux/jami-client-qt.git synced 2025-08-04 14:55:43 +02:00

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
This commit is contained in:
lcoursodon 2023-06-28 10:58:06 -04:00 committed by Sébastien Blin
parent 3383f43688
commit d7200cc8a3
4 changed files with 22 additions and 1 deletions

View file

@ -217,6 +217,20 @@ Rectangle {
messageBar.textAreaObj.clearText(); messageBar.textAreaObj.clearText();
MessagesAdapter.replyToId = ""; 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 { FilesToSendContainer {

View file

@ -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 void
PositionManager::pinMap(const QString& key) PositionManager::pinMap(const QString& key)
{ {

View file

@ -77,6 +77,7 @@ protected:
Q_INVOKABLE void unPinMap(const QString& key); Q_INVOKABLE void unPinMap(const QString& key);
Q_INVOKABLE void setMapActive(const QString& key); Q_INVOKABLE void setMapActive(const QString& key);
Q_INVOKABLE void setMapInactive(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 sharePosition(int maximumTime, const QString& accountId, const QString& convId);
Q_INVOKABLE void stopSharingPosition(const QString& accountId = "", const QString& convId = ""); Q_INVOKABLE void stopSharingPosition(const QString& accountId = "", const QString& convId = "");

View file

@ -30,7 +30,6 @@ Popup {
id: root id: root
required property ListView listView required property ListView listView
signal emojiIsPicked(string content) signal emojiIsPicked(string content)
// Close the picker when attached to a listView that receives height/scroll // Close the picker when attached to a listView that receives height/scroll