From b2636a080795f70252172516db7ede2a4ed67e1b Mon Sep 17 00:00:00 2001 From: Pascal Precht Date: Tue, 12 Jan 2021 11:58:53 +0100 Subject: [PATCH] uiux(Wallet): use StatusButton instead of StyledButton `StyledButton` is considered obsolete and by using `StatusButton` we're getting the expected and correct look & feel of buttons by default. Closes #1627 --- .../Wallet/components/AddAccountWithPrivateKey.qml | 11 +++++------ .../Wallet/components/AddAccountWithSeed.qml | 11 +++++------ .../Wallet/components/AddWatchOnlyAccount.qml | 11 +++++------ .../Wallet/components/GenerateAccountModal.qml | 11 +++++------ 4 files changed, 20 insertions(+), 24 deletions(-) diff --git a/ui/app/AppLayouts/Wallet/components/AddAccountWithPrivateKey.qml b/ui/app/AppLayouts/Wallet/components/AddAccountWithPrivateKey.qml index f51daa44d9..7318c5bf9d 100644 --- a/ui/app/AppLayouts/Wallet/components/AddAccountWithPrivateKey.qml +++ b/ui/app/AppLayouts/Wallet/components/AddAccountWithPrivateKey.qml @@ -3,6 +3,7 @@ import QtQuick.Controls 2.13 import QtQuick.Dialogs 1.3 import "../../../../imports" import "../../../../shared" +import "../../../../shared/status" ModalPopup { id: popup @@ -100,17 +101,15 @@ ModalPopup { anchors.right: parent.right } - footer: StyledButton { + footer: StatusButton { anchors.top: parent.top anchors.right: parent.right - anchors.rightMargin: Style.current.padding - label: loading ? + text: loading ? //% "Loading..." qsTrId("loading") : - //% "Add account >" - qsTrId("add-account") + qsTr("Add account") - disabled: loading || passwordInput.text === "" || accountNameInput.text === "" || accountPKeyInput.text === "" + enabled: !loading && passwordInput.text !== "" && accountNameInput.text !== "" && accountPKeyInput.text !== "" MessageDialog { id: accountError diff --git a/ui/app/AppLayouts/Wallet/components/AddAccountWithSeed.qml b/ui/app/AppLayouts/Wallet/components/AddAccountWithSeed.qml index 452955056d..2049a539bb 100644 --- a/ui/app/AppLayouts/Wallet/components/AddAccountWithSeed.qml +++ b/ui/app/AppLayouts/Wallet/components/AddAccountWithSeed.qml @@ -3,6 +3,7 @@ import QtQuick.Controls 2.13 import QtQuick.Dialogs 1.3 import "../../../../imports" import "../../../../shared" +import "../../../../shared/status" ModalPopup { id: popup @@ -113,17 +114,15 @@ ModalPopup { anchors.right: parent.right } - footer: StyledButton { + footer: StatusButton { anchors.top: parent.top anchors.right: parent.right - anchors.rightMargin: Style.current.padding - label: loading ? + text: loading ? //% "Loading..." qsTrId("loading") : - //% "Add account >" - qsTrId("add-account") + qsTr("Add account") - disabled: loading || passwordInput.text === "" || accountNameInput.text === "" || accountSeedInput.text === "" + enabled: !loading && passwordInput.text !== "" && accountNameInput.text !== "" && accountSeedInput.text !== "" MessageDialog { id: accountError diff --git a/ui/app/AppLayouts/Wallet/components/AddWatchOnlyAccount.qml b/ui/app/AppLayouts/Wallet/components/AddWatchOnlyAccount.qml index 3173618c4c..36ce6c9517 100644 --- a/ui/app/AppLayouts/Wallet/components/AddWatchOnlyAccount.qml +++ b/ui/app/AppLayouts/Wallet/components/AddWatchOnlyAccount.qml @@ -3,6 +3,7 @@ import QtQuick.Controls 2.13 import QtQuick.Dialogs 1.3 import "../../../../imports" import "../../../../shared" +import "../../../../shared/status" ModalPopup { id: popup @@ -74,17 +75,15 @@ ModalPopup { anchors.right: parent.right } - footer: StyledButton { + footer: StatusButton { anchors.top: parent.top anchors.right: parent.right - anchors.rightMargin: Style.current.padding - label: loading ? + text: loading ? //% "Loading..." qsTrId("loading") : - //% "Add account >" - qsTrId("add-account") + qsTr("Add account") - disabled: loading || addressInput.text === "" || accountNameInput.text === "" + enabled: !loading && addressInput.text !== "" && accountNameInput.text !== "" MessageDialog { id: accountError diff --git a/ui/app/AppLayouts/Wallet/components/GenerateAccountModal.qml b/ui/app/AppLayouts/Wallet/components/GenerateAccountModal.qml index c28231ec3e..857a3e523f 100644 --- a/ui/app/AppLayouts/Wallet/components/GenerateAccountModal.qml +++ b/ui/app/AppLayouts/Wallet/components/GenerateAccountModal.qml @@ -3,6 +3,7 @@ import QtQuick.Controls 2.13 import QtQuick.Dialogs 1.3 import "../../../../imports" import "../../../../shared" +import "../../../../shared/status" ModalPopup { id: popup @@ -73,17 +74,15 @@ ModalPopup { anchors.right: parent.right } - footer: StyledButton { + footer: StatusButton { anchors.top: parent.top anchors.right: parent.right - anchors.rightMargin: Style.current.padding - label: loading ? + text: loading ? //% "Loading..." qsTrId("loading") : - //% "Add account >" - qsTrId("add-account") + qsTr("Add account") - disabled: loading || passwordInput.text === "" || accountNameInput.text === "" + enabled: !loading && passwordInput.text !== "" && accountNameInput.text !== "" MessageDialog { id: accountError