From 42791f32d3e2091ecdd4917635ecac8f6d784af9 Mon Sep 17 00:00:00 2001 From: miruka Date: Thu, 16 Jul 2020 18:17:44 -0400 Subject: [PATCH] =?UTF-8?q?Enter=20member=20profile=20=E2=86=92=20focus=20?= =?UTF-8?q?power=20level=20control?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TODO.md | 1 - src/gui/Base/PowerLevelControl.qml | 1 + src/gui/Pages/Chat/RoomPane/MemberView/MemberProfile.qml | 3 +++ src/gui/Pages/Chat/RoomPane/MemberView/MemberView.qml | 6 ------ 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/TODO.md b/TODO.md index a7bf81e2..ec27752e 100644 --- a/TODO.md +++ b/TODO.md @@ -1,7 +1,6 @@ # TODO - global presence control -- power level control keyboard focus - idlemanager: what if setPresence call fails due to network? - fix power level control button layout when apply button is loading diff --git a/src/gui/Base/PowerLevelControl.qml b/src/gui/Base/PowerLevelControl.qml index f8b9f95f..27fabf4e 100644 --- a/src/gui/Base/PowerLevelControl.qml +++ b/src/gui/Base/PowerLevelControl.qml @@ -24,6 +24,7 @@ AutoDirectionLayout { rowSpacing: theme.spacing + onActiveFocusChanged: if (activeFocus) field.forceActiveFocus() HSpacer {} diff --git a/src/gui/Pages/Chat/RoomPane/MemberView/MemberProfile.qml b/src/gui/Pages/Chat/RoomPane/MemberView/MemberProfile.qml index 4ad614ff..a50c2c7f 100644 --- a/src/gui/Pages/Chat/RoomPane/MemberView/MemberProfile.qml +++ b/src/gui/Pages/Chat/RoomPane/MemberView/MemberProfile.qml @@ -208,9 +208,12 @@ HListView { defaultLevel: member.power_level maximumLevel: root.ownPowerLevel rowSpacing: powerLevel.spacing + onAccepted: applyButton.clicked() onFieldFocusedChanged: root.powerLevelFieldFocused = fieldFocused + Component.onCompleted: forceActiveFocus() + } } diff --git a/src/gui/Pages/Chat/RoomPane/MemberView/MemberView.qml b/src/gui/Pages/Chat/RoomPane/MemberView/MemberView.qml index cdb397ea..77306756 100644 --- a/src/gui/Pages/Chat/RoomPane/MemberView/MemberView.qml +++ b/src/gui/Pages/Chat/RoomPane/MemberView/MemberView.qml @@ -96,12 +96,6 @@ HColumnLayout { onActiveFocusChanged: { if ( - activeFocus && - stackView.depth === 1 && - stackView.currentItem.currentIndex === -1 - ) { - stackView.currentItem.currentIndex = 0 - } else if ( ! activeFocus && stackView.depth === 1 && stackView.currentItem.currentIndex === 0