From 6e63569ad7fd16556f5f562cb5dc87a6f19638c6 Mon Sep 17 00:00:00 2001 From: miruka Date: Sat, 28 Mar 2020 12:50:09 -0400 Subject: [PATCH] Add leaveRoom and forgetRoom keybinds --- src/backend/user_files.py | 2 ++ src/gui/Pages/Chat/Chat.qml | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/src/backend/user_files.py b/src/backend/user_files.py index 14268a34..b81c56b9 100644 --- a/src/backend/user_files.py +++ b/src/backend/user_files.py @@ -288,6 +288,8 @@ class UISettings(JSONDataFile): "sendFile": ["Alt+S"], "sendFileFromPathInClipboard": ["Alt+Shift+S"], "inviteToRoom": ["Alt+I"], + "leaveRoom": ["Alt+Escape"], + "forgetRoom": ["Alt+Shift+Escape"], "toggleFocusRoomPane": ["Alt+R"], }, diff --git a/src/gui/Pages/Chat/Chat.qml b/src/gui/Pages/Chat/Chat.qml index 923dee06..4095e3e6 100644 --- a/src/gui/Pages/Chat/Chat.qml +++ b/src/gui/Pages/Chat/Chat.qml @@ -26,6 +26,24 @@ Item { readonly property alias roomPane: roomPaneLoader.item + HShortcut { + sequences: window.settings.keys.leaveRoom + onActivated: utils.makePopup( + "Popups/LeaveRoomPopup.qml", + chat, + {userId, roomId, roomName: roomInfo.display_name}, + ) + } + + HShortcut { + sequences: window.settings.keys.forgetRoom + onActivated: utils.makePopup( + "Popups/ForgetRoomPopup.qml", + chat, + {userId, roomId, roomName: roomInfo.display_name}, + ) + } + Timer { interval: 100 running: ! userInfo