From e5a196dcf82d15300654f8adf5dab3806fd8aae4 Mon Sep 17 00:00:00 2001 From: miruka Date: Fri, 10 Jul 2020 12:20:02 -0400 Subject: [PATCH] Clear default member list highlight on focus loss --- .../Chat/RoomPane/MemberView/MemberView.qml | 21 ++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/src/gui/Pages/Chat/RoomPane/MemberView/MemberView.qml b/src/gui/Pages/Chat/RoomPane/MemberView/MemberView.qml index a48e8044..694e6b3c 100644 --- a/src/gui/Pages/Chat/RoomPane/MemberView/MemberView.qml +++ b/src/gui/Pages/Chat/RoomPane/MemberView/MemberView.qml @@ -84,11 +84,22 @@ HColumnLayout { py.callCoro("set_substring_filter", [modelSyncId, text]) } - onFocusChanged: if ( - focus && - stackView.depth === 1 && - stackView.currentItem.currentIndex === -1 - ) stackView.currentItem.currentIndex = 0 + onActiveFocusChanged: { + if ( + activeFocus && + stackView.depth === 1 && + stackView.currentItem.currentIndex === -1 + ) { + stackView.currentItem.currentIndex = 0 + } else if ( + ! activeFocus && + stackView.depth === 1 && + stackView.currentItem.currentIndex === 0 + ) { + stackView.currentItem.currentIndex = -1 + } + } + Keys.forwardTo: [stackView.currentItem] Keys.priority: Keys.AfterItem