status-desktop/ui/app/AppLayouts/Wallet/components/AddAccount.qml

89 lines
2.2 KiB
QML
Raw Normal View History

2020-06-17 19:18:31 +00:00
import QtQuick 2.13
import QtQuick.Controls 2.13
2020-06-01 14:59:46 +00:00
import "../../../../shared"
import "../../../../shared/status"
2020-06-01 14:59:46 +00:00
import "../../../../imports"
StatusRoundButton {
id: btnAdd
icon.name: "plusSign"
pressedIconRotation: 45
size: "medium"
type: "secondary"
width: 36
height: 36
onClicked: {
btnAdd.state = "pressed"
let x = btnAdd.iconX + btnAdd.icon.width / 2 - newAccountMenu.width / 2
newAccountMenu.popup(x, btnAdd.icon.height + 10)
2020-06-01 14:59:46 +00:00
}
GenerateAccountModal {
id: generateAccountModal
}
AddAccountWithSeed {
id: addAccountWithSeedModal
}
AddAccountWithPrivateKey {
id: addAccountWithPrivateKeydModal
}
AddWatchOnlyAccount {
id: addWatchOnlyAccountModal
}
2020-06-04 14:53:10 +00:00
PopupMenu {
id: newAccountMenu
width: 260
Action {
//% "Generate an account"
text: qsTrId("generate-a-new-account")
icon.source: "../../../img/generate_account.svg"
icon.width: 19
icon.height: 19
onTriggered: {
generateAccountModal.open()
2020-06-01 14:59:46 +00:00
}
}
Action {
//% "Add a watch-only address"
text: qsTrId("add-a-watch-account")
icon.source: "../../../img/add_watch_only.svg"
icon.width: 19
icon.height: 19
onTriggered: {
addWatchOnlyAccountModal.open()
2020-06-01 14:59:46 +00:00
}
}
Action {
//% "Enter a seed phrase"
text: qsTrId("enter-a-seed-phrase")
icon.source: "../../../img/enter_seed_phrase.svg"
icon.width: 19
icon.height: 19
onTriggered: {
addAccountWithSeedModal.open()
2020-06-01 14:59:46 +00:00
}
}
Action {
//% "Enter a private key"
text: qsTrId("enter-a-private-key")
icon.source: "../../../img/enter_private_key.svg"
icon.width: 19
icon.height: 19
onTriggered: {
addAccountWithPrivateKeydModal.open()
2020-06-01 14:59:46 +00:00
}
}
onAboutToHide: {
btnAdd.state = "default"
}
2020-06-01 14:59:46 +00:00
}
}
/*##^##
Designer {
2020-06-04 14:53:10 +00:00
D{i:0;height:36;width:36}
2020-06-01 14:59:46 +00:00
}
##^##*/