mirror of
https://github.com/monero-project/monero-gui.git
synced 2025-01-05 10:29:30 +00:00
Improve copy text handling
This commit is contained in:
parent
e6ada22611
commit
2170f6a46d
6 changed files with 36 additions and 3 deletions
|
@ -144,8 +144,10 @@ ListView {
|
||||||
onOptionClicked: {
|
onOptionClicked: {
|
||||||
// Ensure tooltip is closed
|
// Ensure tooltip is closed
|
||||||
appWindow.toolTip.visible = false;
|
appWindow.toolTip.visible = false;
|
||||||
if(option === 0)
|
if(option === 0) {
|
||||||
clipboard.setText(address)
|
clipboard.setText(address)
|
||||||
|
appWindow.showStatusMessage(qsTr("Address copied to clipboard"),3)
|
||||||
|
}
|
||||||
else if(option === 1){
|
else if(option === 1){
|
||||||
console.log("Sending to: ", address +" "+ paymentId);
|
console.log("Sending to: ", address +" "+ paymentId);
|
||||||
middlePanel.sendTo(address, paymentId, description);
|
middlePanel.sendTo(address, paymentId, description);
|
||||||
|
|
|
@ -113,6 +113,21 @@ Rectangle {
|
||||||
textFormat: TextEdit.AutoText
|
textFormat: TextEdit.AutoText
|
||||||
readOnly: true
|
readOnly: true
|
||||||
font.pixelSize: 12 * scaleRatio
|
font.pixelSize: 12 * scaleRatio
|
||||||
|
selectByMouse: false
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
anchors.fill: parent
|
||||||
|
onClicked: {
|
||||||
|
appWindow.showStatusMessage(qsTr("Double tap to copy"),3)
|
||||||
|
}
|
||||||
|
onDoubleClicked: {
|
||||||
|
parent.selectAll()
|
||||||
|
parent.copy()
|
||||||
|
parent.deselect()
|
||||||
|
console.log("copied to clipboard");
|
||||||
|
appWindow.showStatusMessage(qsTr("Content copied to clipboard"),3)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
3
main.qml
3
main.qml
|
@ -1481,10 +1481,11 @@ ApplicationWindow {
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: statusMessage
|
id: statusMessage
|
||||||
|
z: 99
|
||||||
visible: false
|
visible: false
|
||||||
property alias text: statusMessageText.text
|
property alias text: statusMessageText.text
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
width: 200 * scaleRatio
|
width: statusMessageText.contentWidth + 20 * scaleRatio
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
color: "black"
|
color: "black"
|
||||||
height: 40 * scaleRatio
|
height: 40 * scaleRatio
|
||||||
|
|
|
@ -75,10 +75,14 @@ Rectangle {
|
||||||
MouseArea {
|
MouseArea {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
onClicked: {
|
onClicked: {
|
||||||
|
appWindow.showStatusMessage(qsTr("Double tap to copy"),3)
|
||||||
|
}
|
||||||
|
onDoubleClicked: {
|
||||||
parent.selectAll()
|
parent.selectAll()
|
||||||
parent.copy()
|
parent.copy()
|
||||||
parent.deselect()
|
parent.deselect()
|
||||||
console.log("copied to clipboard");
|
console.log("copied to clipboard");
|
||||||
|
appWindow.showStatusMessage(qsTr("Seed copied to clipboard"),3)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -105,10 +109,14 @@ Rectangle {
|
||||||
MouseArea {
|
MouseArea {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
onClicked: {
|
onClicked: {
|
||||||
|
appWindow.showStatusMessage(qsTr("Double tap to copy"),3)
|
||||||
|
}
|
||||||
|
onDoubleClicked: {
|
||||||
parent.selectAll()
|
parent.selectAll()
|
||||||
parent.copy()
|
parent.copy()
|
||||||
parent.deselect()
|
parent.deselect()
|
||||||
console.log("copied to clipboard");
|
console.log("copied to clipboard");
|
||||||
|
appWindow.showStatusMessage(qsTr("Keys copied to clipboard"),3)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -205,6 +205,7 @@ Rectangle {
|
||||||
if (addressLine.text.length > 0) {
|
if (addressLine.text.length > 0) {
|
||||||
console.log(addressLine.text + " copied to clipboard")
|
console.log(addressLine.text + " copied to clipboard")
|
||||||
clipboard.setText(addressLine.text)
|
clipboard.setText(addressLine.text)
|
||||||
|
appWindow.showStatusMessage(qsTr("Address copied to clipboard"),3)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -237,6 +238,7 @@ Rectangle {
|
||||||
onClicked: {
|
onClicked: {
|
||||||
if (paymentIdLine.text.length > 0) {
|
if (paymentIdLine.text.length > 0) {
|
||||||
clipboard.setText(paymentIdLine.text)
|
clipboard.setText(paymentIdLine.text)
|
||||||
|
appWindow.showStatusMessage(qsTr("Payment ID copied to clipboard"),3)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -289,6 +291,7 @@ Rectangle {
|
||||||
onClicked: {
|
onClicked: {
|
||||||
if (integratedAddressLine.text.length > 0) {
|
if (integratedAddressLine.text.length > 0) {
|
||||||
clipboard.setText(integratedAddressLine.text)
|
clipboard.setText(integratedAddressLine.text)
|
||||||
|
appWindow.showStatusMessage(qsTr("Integrated address copied to clipboard"),3)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,7 +59,11 @@ Column {
|
||||||
MouseArea {
|
MouseArea {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
cursorShape: Qt.PointingHandCursor
|
cursorShape: Qt.PointingHandCursor
|
||||||
onClicked: clipboard.setText(memoTextInput.text)
|
onClicked: {
|
||||||
|
clipboard.setText(memoTextInput.text)
|
||||||
|
appWindow.showStatusMessage(qsTr("Seed copied to clipboard"),3)
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Rectangle {
|
Rectangle {
|
||||||
|
|
Loading…
Reference in a new issue