From 3b9ada93d0f082085743eeef466b51747209887f Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Wed, 22 Jul 2020 16:40:32 -0400 Subject: [PATCH] fix: fix dark theme for the wallet --- .../Wallet/AccountSettingsModal.qml | 2 +- ui/app/AppLayouts/Wallet/SetCurrencyModal.qml | 29 ++--- .../components/SetCurrencyModalContent.qml | 123 +++++------------- .../components/TokenSettingsModalContent.qml | 1 - ui/shared/Select.qml | 4 +- 5 files changed, 47 insertions(+), 112 deletions(-) diff --git a/ui/app/AppLayouts/Wallet/AccountSettingsModal.qml b/ui/app/AppLayouts/Wallet/AccountSettingsModal.qml index f6bbf53d80..1ff0dabc2b 100644 --- a/ui/app/AppLayouts/Wallet/AccountSettingsModal.qml +++ b/ui/app/AppLayouts/Wallet/AccountSettingsModal.qml @@ -12,7 +12,7 @@ ModalPopup { // TODO add icon when we have that feature //% "Status account settings" title: qsTrId("status-account-settings") - height: 635 + height: 675 property int marginBetweenInputs: 35 property string selectedColor: currentAccount.iconColor diff --git a/ui/app/AppLayouts/Wallet/SetCurrencyModal.qml b/ui/app/AppLayouts/Wallet/SetCurrencyModal.qml index 5774eeedcd..ec27697e8e 100644 --- a/ui/app/AppLayouts/Wallet/SetCurrencyModal.qml +++ b/ui/app/AppLayouts/Wallet/SetCurrencyModal.qml @@ -16,26 +16,25 @@ Item { popup.close() } - Popup { + ModalPopup { id: popup - modal: true - closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside - Overlay.modal: Rectangle { - color: "#60000000" - } - parent: Overlay.overlay - x: Math.round((parent.width - width) / 2) - y: Math.round((parent.height - height) / 2) width: 480 height: 510 - background: Rectangle { - color: Style.current.background - radius: Style.current.radius - } - padding: 0 - contentItem: SetCurrencyModalContent { + + title: qsTr("Settings") + + SetCurrencyModalContent { id: setCurrencyModalContent } + + footer: StyledButton { + anchors.right: parent.right + label: qsTr("Save") + onClicked: { + console.log("TODO: apply all accounts") + popup.close() + } + } } } diff --git a/ui/app/AppLayouts/Wallet/components/SetCurrencyModalContent.qml b/ui/app/AppLayouts/Wallet/components/SetCurrencyModalContent.qml index a450f5d5ac..3e13bd155a 100644 --- a/ui/app/AppLayouts/Wallet/components/SetCurrencyModalContent.qml +++ b/ui/app/AppLayouts/Wallet/components/SetCurrencyModalContent.qml @@ -5,113 +5,50 @@ import "../../../../shared" import "../data/" Item { - id: element property string currency: "USD" - - StyledText { - id: modalDialogTitle - text: "Settings" - anchors.top: parent.top - anchors.left: parent.left - font.bold: true - font.pixelSize: 17 - anchors.leftMargin: 16 - anchors.topMargin: 16 - } - - SVGImage { - id: closeModalImg - anchors.top: parent.top - anchors.right: parent.right - anchors.rightMargin: 16 - anchors.topMargin: 16 - source: "../../../../shared/img/close.svg" - width: 25 - height: 25 - MouseArea { - id: closeModalMouseArea - cursorShape: Qt.PointingHandCursor - anchors.fill: parent - onClicked: { - popup.close() - } - } - } - - Separator { - id: headerSeparator - anchors.top: modalDialogTitle.bottom - } + id: modalBody + anchors.fill: parent ButtonGroup { id: currencyGroup } - Item { - id: modalBody - anchors.right: parent.right - anchors.rightMargin: 32 - anchors.top: headerSeparator.top - anchors.topMargin: Style.current.padding - anchors.bottom: footerSeparator.top - anchors.bottomMargin: Style.current.padding + ListView { + anchors.top: parent.top + anchors.topMargin: 10 anchors.left: parent.left - anchors.leftMargin: 32 + anchors.right: parent.right + anchors.bottom: parent.bottom + clip: true + spacing: 10 + id: tokenListView + model: Currencies {} + ScrollBar.vertical: ScrollBar { active: true } - ListView { - anchors.top: parent.top - anchors.topMargin: 10 - anchors.left: parent.left - anchors.right: parent.right - anchors.bottom: parent.bottom - spacing: 10 - id: tokenListView - model: Currencies {} - ScrollBar.vertical: ScrollBar { active: true } + delegate: Component { + Item { + anchors.right: parent.right + anchors.rightMargin: 0 + anchors.left: parent.left + anchors.leftMargin: 10 + width: parent.width + height: 52 - delegate: Component { - Item { - id: element + StyledText { + text: name + " (" + code + ")" + font.pixelSize: 15 + } + + RadioButton { + checked: currency === key anchors.right: parent.right - anchors.rightMargin: 0 - anchors.left: parent.left - anchors.leftMargin: 10 - width: parent.width - height: 52 - - StyledText { - text: name + " (" + code + ")" - font.pixelSize: 15 - } - - RadioButton { - checked: currency === key - anchors.right: parent.right - ButtonGroup.group: currencyGroup - onClicked: { walletModel.setDefaultCurrency(key) } - } + anchors.rightMargin: 4 + ButtonGroup.group: currencyGroup + onClicked: { walletModel.setDefaultCurrency(key) } } } } } - - Separator { - id: footerSeparator - anchors.bottom: parent.bottom - anchors.bottomMargin: 76 - } - - StyledButton { - anchors.right: parent.right - anchors.rightMargin: Style.current.padding - label: "Save" - anchors.bottom: parent.bottom - anchors.bottomMargin: Style.current.padding - onClicked: { - console.log("TODO: apply all accounts") - popup.close() - } - } } /*##^## diff --git a/ui/app/AppLayouts/Wallet/components/TokenSettingsModalContent.qml b/ui/app/AppLayouts/Wallet/components/TokenSettingsModalContent.qml index c0245837f1..9ee797b96a 100644 --- a/ui/app/AppLayouts/Wallet/components/TokenSettingsModalContent.qml +++ b/ui/app/AppLayouts/Wallet/components/TokenSettingsModalContent.qml @@ -58,7 +58,6 @@ Item { anchors.leftMargin: Style.current.smallPadding anchors.top: assetInfoImage.top anchors.topMargin: 0 - color: Style.current.black font.pixelSize: 15 } StyledText { diff --git a/ui/shared/Select.qml b/ui/shared/Select.qml index 3102dd7108..31fae36105 100644 --- a/ui/shared/Select.qml +++ b/ui/shared/Select.qml @@ -141,9 +141,9 @@ Item { StyledText { id: itemText text: itemContainer.label - anchors.left: parent.left + anchors.left: parent ? parent.left : undefined anchors.leftMargin: 5 - anchors.verticalCenter: parent.verticalCenter + anchors.verticalCenter: parent ? parent.verticalCenter : undefined } onTriggered: function () {