Commit 53638ae9 authored by Karel Slaný's avatar Karel Slaný

Added explicit copy and past menu for text fields in account settings page.

parent 182aade6
......@@ -129,6 +129,43 @@ Component {
id: accountNameTextField
width: myWidht
placeholderText: qsTr("Enter your account name")
Menu {
id: accountNameMenu
implicitWidth: 800 // Chosen to be large enough
MenuItem {
text: qsTr("Clear")
enabled: accountNameTextField.text != ""
onTriggered: {
accountNameTextField.clear()
}
}
MenuItem {
text: qsTr("Copy")
enabled: accountNameTextField.text != ""
onTriggered: {
accountNameTextField.selectAll()
accountNameTextField.copy()
accountNameTextField.deselect()
}
}
MenuItem {
text: qsTr("Paste")
onTriggered: {
accountNameTextField.paste()
}
}
}
MouseArea {
anchors.fill: parent
onPressAndHold: {
accountNameMenu.implicitWidth = computeMenuWidth(accountNameMenu)
accountNameMenu.x = mouse.x
accountNameMenu.y = mouse.y
accountNameMenu.open()
}
}
}
}
Column {
......@@ -142,6 +179,43 @@ Component {
width: myWidht
inputMethodHints: Qt.ImhLowercaseOnly
placeholderText: qsTr("Enter username")
Menu {
id: userNameMenu
implicitWidth: 800 // Chosen to be large enough
MenuItem {
text: qsTr("Clear")
enabled: userNameTextField.text != ""
onTriggered: {
userNameTextField.clear()
}
}
MenuItem {
text: qsTr("Copy")
enabled: userNameTextField.text != ""
onTriggered: {
userNameTextField.selectAll()
userNameTextField.copy()
userNameTextField.deselect()
}
}
MenuItem {
text: qsTr("Paste")
onTriggered: {
userNameTextField.paste()
}
}
}
MouseArea {
anchors.fill: parent
onPressAndHold: {
userNameMenu.implicitWidth = computeMenuWidth(userNameMenu)
userNameMenu.x = mouse.x
userNameMenu.y = mouse.y
userNameMenu.open()
}
}
}
}
Column {
......@@ -156,6 +230,34 @@ Component {
echoMode: TextInput.Password
passwordMaskDelay: 500 // milliseconds
placeholderText: qsTr("Enter password")
Menu {
id: passwordMenu
implicitWidth: 800 // Chosen to be large enough
MenuItem {
text: qsTr("Clear")
enabled: passwordTextField.text != ""
onTriggered: {
passwordTextField.clear()
}
}
MenuItem {
text: qsTr("Paste")
onTriggered: {
passwordTextField.paste()
}
}
}
MouseArea {
anchors.fill: parent
onPressAndHold: {
passwordMenu.implicitWidth = computeMenuWidth(passwordMenu)
passwordMenu.x = mouse.x
passwordMenu.y = mouse.y
passwordMenu.open()
}
}
}
}
CheckBox {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment