From fb846226f8c7a3e8ffcb841b312a77c9626fd9a0 Mon Sep 17 00:00:00 2001 From: miruka Date: Sun, 13 Sep 2020 19:16:46 -0400 Subject: [PATCH] Focus filter field on member profile exit --- .../Pages/Chat/RoomPane/MemberView/MemberProfile.qml | 10 ++++++++-- src/gui/Pages/Chat/RoomPane/MemberView/MemberView.qml | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/gui/Pages/Chat/RoomPane/MemberView/MemberProfile.qml b/src/gui/Pages/Chat/RoomPane/MemberView/MemberProfile.qml index 34233061..2fda60c5 100644 --- a/src/gui/Pages/Chat/RoomPane/MemberView/MemberProfile.qml +++ b/src/gui/Pages/Chat/RoomPane/MemberView/MemberProfile.qml @@ -16,6 +16,7 @@ HListView { property int canSetPowerLevels property QtObject member // RoomMember model item property HStackView stackView + property Item focusOnExit property bool powerLevelFieldFocused: false @@ -31,6 +32,11 @@ HListView { }) } + function exit() { + stackView.pop() + focusOnExit.forceActiveFocus() + } + clip: true bottomMargin: theme.spacing @@ -79,7 +85,7 @@ HListView { circle: true icon.name: "close-view" iconItem.small: true - onClicked: root.stackView.pop() + onClicked: root.exit() } } @@ -297,7 +303,7 @@ HListView { currentItem.leftClicked() currentItem.clicked() } - Keys.onEscapePressed: stackView.pop() + Keys.onEscapePressed: root.exit() Connections { target: py.eventHandlers diff --git a/src/gui/Pages/Chat/RoomPane/MemberView/MemberView.qml b/src/gui/Pages/Chat/RoomPane/MemberView/MemberView.qml index 1d640b88..3d20886c 100644 --- a/src/gui/Pages/Chat/RoomPane/MemberView/MemberView.qml +++ b/src/gui/Pages/Chat/RoomPane/MemberView/MemberView.qml @@ -52,6 +52,7 @@ HColumnLayout { ), member: model, stackView: stackView, + focusOnExit: filterField, }, ) }