2025-01-17 15:03:19 +01:00
|
|
|
import QtQuick 2.15
|
2025-01-13 09:43:29 +01:00
|
|
|
|
|
|
|
import StatusQ 0.1
|
|
|
|
import StatusQ.Core.Theme 0.1
|
|
|
|
import StatusQ.Controls 0.1
|
|
|
|
import StatusQ.Popups 0.1
|
|
|
|
|
|
|
|
import utils 1.0
|
|
|
|
|
|
|
|
StatusFlatButton {
|
|
|
|
id: root
|
|
|
|
|
2025-01-17 15:03:19 +01:00
|
|
|
/** Input property holding selected recipient address **/
|
2025-01-13 09:43:29 +01:00
|
|
|
required property string recipientAddress
|
2025-01-17 15:03:19 +01:00
|
|
|
/** Input property holding selected network name **/
|
2025-01-13 09:43:29 +01:00
|
|
|
required property string networkName
|
2025-01-17 15:03:19 +01:00
|
|
|
/** Input property holding selected network short name **/
|
2025-01-13 09:43:29 +01:00
|
|
|
required property string networkShortName
|
2025-01-17 15:03:19 +01:00
|
|
|
/** Input property holding selected network explorer url **/
|
2025-01-13 09:43:29 +01:00
|
|
|
required property string networkBlockExplorerUrl
|
|
|
|
|
2025-01-17 15:03:19 +01:00
|
|
|
/** Signal to launch link **/
|
2025-01-13 09:43:29 +01:00
|
|
|
signal openLink(string link)
|
|
|
|
|
2025-01-17 15:03:19 +01:00
|
|
|
QtObject {
|
|
|
|
id: d
|
|
|
|
|
|
|
|
function getExplorerName() {
|
|
|
|
return Utils.getChainExplorerName(root.networkShortName)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2025-01-13 09:43:29 +01:00
|
|
|
icon.name: "more"
|
|
|
|
icon.color: highlighted ? Theme.palette.directColor1 : Theme.palette.directColor5
|
|
|
|
highlighted: moreMenu.opened
|
|
|
|
onClicked: moreMenu.popup(root, 0, height + 4)
|
|
|
|
|
|
|
|
StatusMenu {
|
|
|
|
id: moreMenu
|
|
|
|
objectName: "moreMenu"
|
|
|
|
|
|
|
|
StatusAction {
|
|
|
|
objectName: "externalLink"
|
|
|
|
//: e.g. "View receiver address on Etherscan"
|
2025-01-17 15:03:19 +01:00
|
|
|
text: qsTr("View receiver address on %1").arg(d.getExplorerName())
|
2025-01-13 09:43:29 +01:00
|
|
|
icon.name: "external-link"
|
|
|
|
onTriggered: {
|
|
|
|
var link = "%1/%2/%3".arg(root.networkBlockExplorerUrl).arg(Constants.networkExplorerLinks.addressPath).arg(root.recipientAddress)
|
|
|
|
root.openLink(link)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
StatusSuccessAction {
|
|
|
|
objectName: "copyButton"
|
|
|
|
text: qsTr("Copy receiver address")
|
|
|
|
successText: qsTr("Copied")
|
|
|
|
icon.name: "copy"
|
|
|
|
autoDismissMenu: true
|
|
|
|
onTriggered: ClipboardUtils.setText(root.recipientAddress)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|