mirror of
https://github.com/status-im/status-desktop.git
synced 2025-02-19 18:18:38 +00:00
fix(@desktop/wallet): Hide disabled copy address action (#11269)
fixes #10507
This commit is contained in:
parent
f01359de76
commit
91e0d3f0cd
@ -59,6 +59,9 @@ StatusMenuItem {
|
|||||||
/*! \internal Overriden signal to not close menu on click */
|
/*! \internal Overriden signal to not close menu on click */
|
||||||
signal triggered()
|
signal triggered()
|
||||||
|
|
||||||
|
// Hide disabled item when hiding is enabled
|
||||||
|
visible: !root.menu.hideDisabledItems || enabled
|
||||||
|
height: visible || enabled ? implicitHeight : 0
|
||||||
onVisibleChanged: {
|
onVisibleChanged: {
|
||||||
if (!visible)
|
if (!visible)
|
||||||
success = false
|
success = false
|
||||||
|
@ -2,9 +2,6 @@ import QtQuick 2.15
|
|||||||
import QtQuick.Controls 2.15
|
import QtQuick.Controls 2.15
|
||||||
|
|
||||||
import StatusQ.Popups 0.1
|
import StatusQ.Popups 0.1
|
||||||
import StatusQ.Core.Theme 0.1
|
|
||||||
|
|
||||||
import utils 1.0
|
|
||||||
|
|
||||||
import "../stores"
|
import "../stores"
|
||||||
|
|
||||||
@ -21,44 +18,15 @@ StatusMenu {
|
|||||||
|
|
||||||
width: 204
|
width: 204
|
||||||
|
|
||||||
onAboutToShow: {
|
StatusSuccessAction {
|
||||||
d.resetCopyAddressAction()
|
|
||||||
}
|
|
||||||
|
|
||||||
QtObject {
|
|
||||||
id: d
|
|
||||||
|
|
||||||
function resetCopyAddressAction() {
|
|
||||||
copyAddressAction.action.text = qsTr("Copy address")
|
|
||||||
copyAddressAction.action.type = StatusAction.Type.Normal
|
|
||||||
copyAddressAction.action.icon.name = "copy"
|
|
||||||
copyAddressAction.action.icon.color = Theme.palette.primaryColor1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
StatusMenuItem {
|
|
||||||
id: copyAddressAction
|
id: copyAddressAction
|
||||||
objectName: "AccountMenu-CopyAddressAction-%1".arg(root.uniqueIdentifier)
|
objectName: "AccountMenu-CopyAddressAction-%1".arg(root.uniqueIdentifier)
|
||||||
enabled: !!root.account
|
successText: qsTr("Address copied")
|
||||||
text: qsTr("Copy address")
|
text: qsTr("Copy address")
|
||||||
action: StatusAction {}
|
icon.name: "copy"
|
||||||
MouseArea {
|
timeout: 1500
|
||||||
anchors.fill: parent
|
enabled: !!root.account
|
||||||
hoverEnabled: true
|
onTriggered: RootStore.copyToClipboard(root.account.address?? "")
|
||||||
cursorShape: containsMouse ? Qt.PointingHandCursor : Qt.ArrowCursor
|
|
||||||
onClicked: {
|
|
||||||
RootStore.copyToClipboard(root.account.address?? "")
|
|
||||||
copyAddressAction.action.text = qsTr("Address copied")
|
|
||||||
copyAddressAction.action.type = StatusAction.Type.Success
|
|
||||||
copyAddressAction.action.icon.name = "tiny/checkmark"
|
|
||||||
copyAddressAction.action.icon.color = Theme.palette.successColor1
|
|
||||||
|
|
||||||
Backpressure.debounce(root, 1500, function () {
|
|
||||||
d.resetCopyAddressAction()
|
|
||||||
root.dismiss()
|
|
||||||
})()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
StatusMenuSeparator {
|
StatusMenuSeparator {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user