summary refs log tree commit diff
path: root/resources/qml/UserProfile.qml
diff options
context:
space:
mode:
authorJedi18 <targetakhil@gmail.com>2021-01-28 23:35:02 +0530
committerJedi18 <targetakhil@gmail.com>2021-01-28 23:35:02 +0530
commitb3f29f592b26806d4a82067bbb64f9ffd044d474 (patch)
tree939a32a835c8867da9e038c41e61b0a041ce0a21 /resources/qml/UserProfile.qml
parentUsername can be edited by double clicking on text, added global user profile ... (diff)
downloadnheko-b3f29f592b26806d4a82067bbb64f9ffd044d474.tar.xz
Changed edit method from double clicking to an edit button
Diffstat (limited to 'resources/qml/UserProfile.qml')
-rw-r--r--resources/qml/UserProfile.qml22
1 files changed, 15 insertions, 7 deletions
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) + } } } }