From 134543728ec3bd99e7282e1cc71b02759fea11be Mon Sep 17 00:00:00 2001 From: miruka Date: Sat, 7 Sep 2019 16:46:30 -0400 Subject: [PATCH] Add escape to exit and clear room filter field --- TODO.md | 1 - src/python/config_files.py | 1 + src/qml/SidePane/SidePane.qml | 6 ++++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/TODO.md b/TODO.md index 71d36f3a..92ecdd25 100644 --- a/TODO.md +++ b/TODO.md @@ -26,7 +26,6 @@ - Verify big avatars aren't downloaded uselessly - UI - - Esc in sidepane to focus chat again - Set an explicit placeholder text color for text field/area - Change typing bar background - Show error if uploading avatar fails or file is corrupted diff --git a/src/python/config_files.py b/src/python/config_files.py index 5642674b..97e3a9a8 100644 --- a/src/python/config_files.py +++ b/src/python/config_files.py @@ -106,6 +106,7 @@ class UISettings(JSONConfigFile): return { "alertOnMessageForMsec": 4000, "clearRoomFilterOnEnter": True, + "clearRoomFilterOnEscape": True, "theme": "Default.qpl", "writeAliases": {}, "keys": { diff --git a/src/qml/SidePane/SidePane.qml b/src/qml/SidePane/SidePane.qml index a5833a47..c4958bc8 100644 --- a/src/qml/SidePane/SidePane.qml +++ b/src/qml/SidePane/SidePane.qml @@ -95,6 +95,12 @@ Rectangle { sidePaneList.activate() } + Keys.onEscapePressed: { + if (window.settings.clearRoomFilterOnEscape) { + mainUI.sidePane.toolBar.roomFilter = "" + } + mainUI.pageLoader.forceActiveFocus() + } HColumnLayout {