From affd0d0bd3929d813a65978b65c06d9c229670c8 Mon Sep 17 00:00:00 2001 From: miruka Date: Thu, 9 Jul 2020 21:55:28 -0400 Subject: [PATCH] Improve member list highlighted item behavior - When focusing the "Filter members" field, highlight the first item if none already is - When pressing esc in the field, clear any highlight --- TODO.md | 2 ++ src/gui/Pages/Chat/RoomPane/MemberView/MemberView.qml | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/TODO.md b/TODO.md index cd9b2d67..d700e519 100644 --- a/TODO.md +++ b/TODO.md @@ -1,5 +1,7 @@ # TODO +- event menu key right click +- composer menu? - fix members not synced bug - fix local unread counters order - fix highlight when logging in to new account diff --git a/src/gui/Pages/Chat/RoomPane/MemberView/MemberView.qml b/src/gui/Pages/Chat/RoomPane/MemberView/MemberView.qml index 909206f0..a48e8044 100644 --- a/src/gui/Pages/Chat/RoomPane/MemberView/MemberView.qml +++ b/src/gui/Pages/Chat/RoomPane/MemberView/MemberView.qml @@ -84,10 +84,19 @@ HColumnLayout { py.callCoro("set_substring_filter", [modelSyncId, text]) } + onFocusChanged: if ( + focus && + stackView.depth === 1 && + stackView.currentItem.currentIndex === -1 + ) stackView.currentItem.currentIndex = 0 + Keys.forwardTo: [stackView.currentItem] Keys.priority: Keys.AfterItem Keys.onEscapePressed: { + if (stackView.depth === 1) + stackView.currentItem.currentIndex = -1 + roomPane.toggleFocus() if (window.settings.clearMemberFilterOnEscape) text = "" }