From b3f29f592b26806d4a82067bbb64f9ffd044d474 Mon Sep 17 00:00:00 2001 From: Jedi18 Date: Thu, 28 Jan 2021 23:35:02 +0530 Subject: Changed edit method from double clicking to an edit button --- resources/qml/UserProfile.qml | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'resources/qml/UserProfile.qml') diff --git a/resources/qml/UserProfile.qml b/resources/qml/UserProfile.qml index 0ced5498..5e577099 100644 --- a/resources/qml/UserProfile.qml +++ b/resources/qml/UserProfile.qml @@ -42,15 +42,23 @@ ApplicationWindow { color: TimelineManager.userColor(profile.userid, colors.window) font.bold: true Layout.alignment: Qt.AlignHCenter - focus: true + selectByMouse: true - onEditingFinished: profile.changeUsername(displayUsername.text) + Keys.priority: Keys.BeforeItem + Keys.onReturnPressed: profile.changeUsername(displayUsername.text) - MouseArea { - enabled: !profile.isUsernameEditingAllowed - anchors.fill: parent - onDoubleClicked: { - profile.allowUsernameEditing(true) + ImageButton { + anchors.leftMargin: 5 + anchors.left: displayUsername.right + anchors.verticalCenter: displayUsername.verticalCenter + image: profile.isUsernameEditingAllowed ? ":/icons/icons/ui/checkmark.png" : ":/icons/icons/ui/edit.png" + + onClicked: { + if(profile.isUsernameEditingAllowed) { + profile.changeUsername(displayUsername.text) + }else{ + profile.allowUsernameEditing(true) + } } } } -- cgit 1.5.1