From 93633654a2edb1d07d2d95bddaf5647ae743374f Mon Sep 17 00:00:00 2001 From: Syl Date: Mon, 28 Mar 2022 11:30:32 +0200 Subject: [PATCH 001/177] Send Modal Fix: Max button does not set correct amount when unconfirmed txes --- atomic_defi_design/Dex/Wallet/SendModal.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/atomic_defi_design/Dex/Wallet/SendModal.qml b/atomic_defi_design/Dex/Wallet/SendModal.qml index 225b2f5af4..62a1a61d63 100644 --- a/atomic_defi_design/Dex/Wallet/SendModal.qml +++ b/atomic_defi_design/Dex/Wallet/SendModal.qml @@ -429,11 +429,11 @@ MultipageModal { if (_preparePage.cryptoSendMode) { - input_amount.text = current_ticker_infos.balance; + input_amount.text = API.app.get_balance(api_wallet_page.ticker); } else { - let cryptoBalance = new BigNumber(current_ticker_infos.balance); + let cryptoBalance = new BigNumber(API.app.get_balance(api_wallet_page.ticker)); input_amount.text = cryptoBalance.multipliedBy(current_ticker_infos.current_currency_ticker_price).toFixed(8); } } From 660fd3decac7846f3ec61765fed0479730457c6c Mon Sep 17 00:00:00 2001 From: Syl Date: Mon, 4 Apr 2022 09:28:57 +0200 Subject: [PATCH 002/177] Remove useless file --- atomic_defi_design/Dex/Tests/ThemeTest.qml | 44 ---------------------- 1 file changed, 44 deletions(-) delete mode 100644 atomic_defi_design/Dex/Tests/ThemeTest.qml diff --git a/atomic_defi_design/Dex/Tests/ThemeTest.qml b/atomic_defi_design/Dex/Tests/ThemeTest.qml deleted file mode 100644 index 49ce86ac4e..0000000000 --- a/atomic_defi_design/Dex/Tests/ThemeTest.qml +++ /dev/null @@ -1,44 +0,0 @@ -import QtQuick 2.15 -import Qaterial 1.0 as Qaterial - -import Dex.Themes 1.0 as Dex - - -Item -{ - id: root - Column - { - padding: 10 - spacing: 10 - Repeater - { - model: 20 - Rectangle - { - width: 200 - height: 10 - color: Dex.CurrentTheme.backgroundColor - } - } - - } - - function listProperty(item) - { - for (var p in item) - { - if (typeof item[p] != "function") - if (p != "objectName") - console.log(p + ":" + item[p]); - } - - } - Component.onCompleted: - { - - listProperty(root) - - } - -} \ No newline at end of file From 3485126ac064a8db982dc3c208624f90c4c939c3 Mon Sep 17 00:00:00 2001 From: smk762 Date: Mon, 4 Apr 2022 18:01:38 +0800 Subject: [PATCH 003/177] add payment lock role --- .../Dex/Exchange/ProView/TradingInfo/OrderModal.qml | 4 ++++ src/core/atomicdex/api/mm2/mm2.cpp | 9 +++++++++ src/core/atomicdex/data/dex/qt.orders.data.hpp | 2 ++ src/core/atomicdex/models/qt.orders.model.cpp | 7 +++++++ src/core/atomicdex/models/qt.orders.model.hpp | 1 + src/core/atomicdex/models/qt.orders.proxy.model.cpp | 2 ++ 6 files changed, 25 insertions(+) diff --git a/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/OrderModal.qml b/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/OrderModal.qml index fba4ec8c6e..904e237b00 100644 --- a/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/OrderModal.qml +++ b/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/OrderModal.qml @@ -201,6 +201,10 @@ MultipageModal title: qsTr("Order Type") text: !details ? "" : details.is_maker ? qsTr("Maker Order") : qsTr("Taker Order") label.font.pixelSize: 13 + visible: { + console.log(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" + details.payment_lock) + return true + } } // Refund state diff --git a/src/core/atomicdex/api/mm2/mm2.cpp b/src/core/atomicdex/api/mm2/mm2.cpp index ef66bb7281..2ef312aa83 100644 --- a/src/core/atomicdex/api/mm2/mm2.cpp +++ b/src/core/atomicdex/api/mm2/mm2.cpp @@ -473,6 +473,15 @@ namespace mm2::api jf_evt["time_diff"] = res; event_timestamp_registry["Started"] = ts2; // Started finished at this time total_time_in_ms += res; + + if (jf_evt.at("data").contains("taker_payment_lock")) + { + contents.payment_lock = jf_evt.at("data").at("taker_payment_lock").get() * 1000; + } + else if (jf_evt.at("data").contains("maker_payment_lock")) + { + contents.payment_lock = jf_evt.at("data").at("maker_payment_lock").get() * 1000; + } } if (idx > 0) diff --git a/src/core/atomicdex/data/dex/qt.orders.data.hpp b/src/core/atomicdex/data/dex/qt.orders.data.hpp index 9fa08b3d50..06241b9a8d 100644 --- a/src/core/atomicdex/data/dex/qt.orders.data.hpp +++ b/src/core/atomicdex/data/dex/qt.orders.data.hpp @@ -46,6 +46,8 @@ namespace mm2::api //! eg: 1595406178 unsigned long long unix_timestamp; + unsigned long long payment_lock; + //! eg: b741646a-5738-4012-b5b0-dcd1375affd1 QString order_id; diff --git a/src/core/atomicdex/models/qt.orders.model.cpp b/src/core/atomicdex/models/qt.orders.model.cpp index 2c73a8b3b0..53149f2911 100644 --- a/src/core/atomicdex/models/qt.orders.model.cpp +++ b/src/core/atomicdex/models/qt.orders.model.cpp @@ -91,6 +91,9 @@ namespace atomic_dex case UnixTimestampRole: item.unix_timestamp = value.toULongLong(); break; + case PaymentLockRole: + item.payment_lock = value.toULongLong(); + break; case OrderIdRole: item.order_id = value.toString(); break; @@ -169,6 +172,8 @@ namespace atomic_dex return item.human_date; case UnixTimestampRole: return item.unix_timestamp; + case PaymentLockRole: + return item.payment_lock; case OrderIdRole: return item.order_id; case OrderStatusRole: @@ -232,6 +237,7 @@ namespace atomic_dex {IsMakerRole, "is_maker"}, {HumanDateRole, "date"}, {UnixTimestampRole, "timestamp"}, + {PaymentLockRole, "payment_lock"}, {OrderIdRole, "order_id"}, {OrderStatusRole, "order_status"}, {MakerPaymentIdRole, "maker_payment_id"}, @@ -418,6 +424,7 @@ namespace atomic_dex auto&& [prev_value, new_value, is_change] = update_value(OrdersRoles::OrderStatusRole, contents.order_status, idx, *this); update_value(OrdersRoles::UnixTimestampRole, contents.unix_timestamp, idx, *this); + update_value(OrdersRoles::PaymentLockRole, contents.payment_lock, idx, *this); auto&& [prev_value_d, new_value_d, _] = update_value(OrdersRoles::HumanDateRole, contents.human_date, idx, *this); if (is_change) { diff --git a/src/core/atomicdex/models/qt.orders.model.hpp b/src/core/atomicdex/models/qt.orders.model.hpp index f8f0659000..b3dfbe7b83 100644 --- a/src/core/atomicdex/models/qt.orders.model.hpp +++ b/src/core/atomicdex/models/qt.orders.model.hpp @@ -66,6 +66,7 @@ namespace atomic_dex IsMakerRole, HumanDateRole, UnixTimestampRole, + PaymentLockRole, OrderIdRole, OrderStatusRole, MakerPaymentIdRole, diff --git a/src/core/atomicdex/models/qt.orders.proxy.model.cpp b/src/core/atomicdex/models/qt.orders.proxy.model.cpp index 0801b43a0c..8dd472fff9 100644 --- a/src/core/atomicdex/models/qt.orders.proxy.model.cpp +++ b/src/core/atomicdex/models/qt.orders.proxy.model.cpp @@ -63,6 +63,8 @@ namespace atomic_dex break; case orders_model::UnixTimestampRole: return left_data.toULongLong() < right_data.toULongLong(); + case orders_model::PaymentLockRole: + break; case orders_model::OrderIdRole: break; case orders_model::OrderStatusRole: From a457f3797791510d25dfb80c8964cd418d38500e Mon Sep 17 00:00:00 2001 From: Syl Date: Tue, 5 Apr 2022 13:20:47 +0200 Subject: [PATCH 004/177] temp commit --- atomic_defi_design/Dex/Addressbook/Main.qml | 21 ++++++++++++++++++++ atomic_defi_design/Dex/Components/qmldir | 3 +++ atomic_defi_design/Dex/Screens/Dashboard.qml | 3 ++- atomic_defi_design/qml.qrc | 1 + 4 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 atomic_defi_design/Dex/Addressbook/Main.qml create mode 100644 atomic_defi_design/Dex/Components/qmldir diff --git a/atomic_defi_design/Dex/Addressbook/Main.qml b/atomic_defi_design/Dex/Addressbook/Main.qml new file mode 100644 index 0000000000..3f2f146f07 --- /dev/null +++ b/atomic_defi_design/Dex/Addressbook/Main.qml @@ -0,0 +1,21 @@ +// Qt Imports +import QtQuick 2.15 +import QtQuick.Layouts 1.15 + +// Project Imports +import Dex.Components 1.0 as Dex +import Dex.Themes 1.0 as Dex + +ColumnLayout +{ + Row + { + Layout.fillWidth: true + implicitHeight: childrenRect.height + + Dex.DefaultText + { + text: qsTr("Address Book") + } + } +} diff --git a/atomic_defi_design/Dex/Components/qmldir b/atomic_defi_design/Dex/Components/qmldir new file mode 100644 index 0000000000..e7ea93dc86 --- /dev/null +++ b/atomic_defi_design/Dex/Components/qmldir @@ -0,0 +1,3 @@ +module Dex.Components + +DefaultText 1.0 DefaultText.qml diff --git a/atomic_defi_design/Dex/Screens/Dashboard.qml b/atomic_defi_design/Dex/Screens/Dashboard.qml index a42197895a..2a810849f4 100644 --- a/atomic_defi_design/Dex/Screens/Dashboard.qml +++ b/atomic_defi_design/Dex/Screens/Dashboard.qml @@ -17,6 +17,7 @@ import "../Sidebar" as Sidebar import "../Fiat" import "../Settings" as SettingsPage import "../Screens" +import "../Addressbook" as Addressbook import Dex.Themes 1.0 as Dex //import Dex.Sidebar 1.0 as Dex @@ -145,7 +146,7 @@ Item { { id: addressbook - AddressBook {} + Addressbook.Main {} } Component diff --git a/atomic_defi_design/qml.qrc b/atomic_defi_design/qml.qrc index c45ed04f68..e8369f610c 100644 --- a/atomic_defi_design/qml.qrc +++ b/atomic_defi_design/qml.qrc @@ -492,6 +492,7 @@ Dex/Components/PasswordForm.qml Dex/Components/PlusButton.qml Dex/Components/PrimaryButton.qml + Dex/Components/qmldir Dex/Components/RestartModal.qml Dex/Components/RightClickMenu.qml Dex/Components/RoundComboBox.qml From 0ce12e8e78aa5859086cd308c3fe0b28438a1072 Mon Sep 17 00:00:00 2001 From: smk762 Date: Wed, 6 Apr 2022 18:14:25 +0800 Subject: [PATCH 005/177] add countdown text --- .../Dex/Components/DexTextField.qml | 4 +- .../Dex/Components/TextEditWithTitle.qml | 4 +- .../Dex/Components/TextFieldWithTitle.qml | 4 +- .../ProView/TradingInfo/OrderModal.qml | 46 +++++--- .../ProView/TradingInfo/SwapProgress.qml | 108 ++++++++++++++---- 5 files changed, 118 insertions(+), 48 deletions(-) diff --git a/atomic_defi_design/Dex/Components/DexTextField.qml b/atomic_defi_design/Dex/Components/DexTextField.qml index 7025abc0e4..5cabec1869 100644 --- a/atomic_defi_design/Dex/Components/DexTextField.qml +++ b/atomic_defi_design/Dex/Components/DexTextField.qml @@ -54,7 +54,7 @@ TextField RightClickMenu {} - DefaultText + DexLabel { id: left_text visible: text_value !== "" @@ -65,7 +65,7 @@ TextField font.pixelSize: text_field.font.pixelSize } - DefaultText + DexLabel { id: right_text visible: text_value !== "" diff --git a/atomic_defi_design/Dex/Components/TextEditWithTitle.qml b/atomic_defi_design/Dex/Components/TextEditWithTitle.qml index 521bba7526..d50b586a51 100644 --- a/atomic_defi_design/Dex/Components/TextEditWithTitle.qml +++ b/atomic_defi_design/Dex/Components/TextEditWithTitle.qml @@ -23,7 +23,7 @@ ComponentWithTitle { Layout.fillWidth: true - DefaultText + DexLabel { id: text @@ -32,7 +32,7 @@ ComponentWithTitle clip: true textFormat: TextEdit.AutoText opacity: show_content ? 1 : 0 - wrapMode: Text.WrapAnywhere + wrapMode: Text.WordWrap Behavior on opacity { SmoothedAnimation { duration: expand_animation.duration; velocity: -1 } } Behavior on Layout.preferredHeight { SmoothedAnimation { id: expand_animation; duration: Constants.Style.animationDuration * 2; velocity: -1 } } diff --git a/atomic_defi_design/Dex/Components/TextFieldWithTitle.qml b/atomic_defi_design/Dex/Components/TextFieldWithTitle.qml index ebaf73ff59..4b7728e740 100644 --- a/atomic_defi_design/Dex/Components/TextFieldWithTitle.qml +++ b/atomic_defi_design/Dex/Components/TextFieldWithTitle.qml @@ -9,6 +9,8 @@ import Dex.Themes 1.0 as Dex ColumnLayout { id: control + Layout.fillWidth: true + Layout.fillHeight: true property bool copyable: false property bool hidable: false @@ -47,7 +49,7 @@ ColumnLayout } } - DefaultTextField + DexTextField { id: input_field diff --git a/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/OrderModal.qml b/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/OrderModal.qml index 904e237b00..6b553ace38 100644 --- a/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/OrderModal.qml +++ b/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/OrderModal.qml @@ -16,7 +16,11 @@ MultipageModal property var details onDetailsChanged: { if (!details) root.close() } - onOpened: swap_progress.updateSimulatedTime() + onOpened: + { + swapProgress.updateSimulatedTime() + swapProgress.updateCountdownTime() + } onClosed: details = undefined MultipageModalContent @@ -44,8 +48,9 @@ MultipageModal } // Status Text - DefaultText + DexLabel { + id: statusText Layout.alignment: Qt.AlignHCenter Layout.topMargin: 5 font.pixelSize: Style.textSize1 @@ -54,6 +59,14 @@ MultipageModal text_value: !details ? "" : visible ? getStatusText(details.order_status) : '' } + DexLabel + { + Layout.alignment: Qt.AlignHCenter + visible: text_value != "" + font.pixelSize: Style.textSizeSmall2 + text_value: swapProgress.getRefundText(swapProgress.countdown_time) + } + RowLayout { Layout.topMargin: 22 @@ -86,13 +99,13 @@ MultipageModal { Layout.fillWidth: true spacing: 5 - DefaultText + DexLabel { Layout.fillWidth: true text: details ? details.base_coin : "" } - DefaultText + DexLabel { Layout.fillWidth: true text: details ? General.coinName(details.base_coin) : "" @@ -102,7 +115,7 @@ MultipageModal } } - DefaultText + DexLabel { Layout.fillWidth: true text: details ? details.base_amount : "" @@ -151,13 +164,13 @@ MultipageModal { Layout.fillWidth: true spacing: 5 - DefaultText + DexLabel { Layout.fillWidth: true text: details ? details.rel_coin : "" } - DefaultText + DexLabel { Layout.fillWidth: true text: details ? General.coinName(details.rel_coin) : "" @@ -167,7 +180,7 @@ MultipageModal } } - DefaultText + DexLabel { Layout.fillWidth: true text: details ? details.rel_amount : "" @@ -201,21 +214,16 @@ MultipageModal title: qsTr("Order Type") text: !details ? "" : details.is_maker ? qsTr("Maker Order") : qsTr("Taker Order") label.font.pixelSize: 13 - visible: { - console.log(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" + details.payment_lock) - return true - } } // Refund state - TextFieldWithTitle + TextEditWithTitle { Layout.fillWidth: true title: qsTr("Refund State") - field.text: !details ? "" : details.order_status === "refunding" ? qsTr("Your swap failed but the auto-refund process for your payment started already. Please wait and keep application opened until you receive your payment back") : "" - field.readOnly: true - field.font.pixelSize: 13 - visible: field.text !== '' + text: !details ? "" : details.order_status === "refunding" ? qsTr("Your swap failed but the auto-refund process for your payment started already. Please wait and keep application opened until you receive your payment back") : "" + label.font.pixelSize: 13 + visible: text !== '' } // Date @@ -286,14 +294,14 @@ MultipageModal HorizontalLine { - visible: swap_progress.visible + visible: swapProgress.visible Layout.fillWidth: true Layout.topMargin: 10 } SwapProgress { - id: swap_progress + id: swapProgress visible: General.exists(details) && details.order_status !== "matching" Layout.fillWidth: true details: root.details diff --git a/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/SwapProgress.qml b/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/SwapProgress.qml index 5861f09635..7ebb402cfa 100644 --- a/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/SwapProgress.qml +++ b/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/SwapProgress.qml @@ -7,7 +7,8 @@ import App 1.0 import "../../../Components" // Content -ColumnLayout { +ColumnLayout +{ id: root property @@ -16,7 +17,8 @@ ColumnLayout { readonly property var all_events: !details ? [] : has_error_event ? details.events.map(e => e.state) : details.success_events - readonly property bool has_error_event: { + readonly property bool has_error_event: + { if (!details) return false const events = details.events @@ -28,7 +30,9 @@ ColumnLayout { return false } - readonly property double total_time_passed: { + + readonly property double total_time_passed: + { if (!details) return 0 const events = details.events @@ -40,7 +44,8 @@ ColumnLayout { return sum } - readonly property double total_time_passed_estimated: { + readonly property double total_time_passed_estimated: + { const events = all_events let sum = 0 @@ -50,7 +55,8 @@ ColumnLayout { return sum } - readonly property int current_event_idx: { + readonly property int current_event_idx: + { if (!details) return -1 const events = details.events if (events.length === 0) return -1 @@ -67,48 +73,92 @@ ColumnLayout { // Simulated time of the running event property double simulated_time: 0 - function updateSimulatedTime() { - if (!details) { + function updateSimulatedTime() + { + if (!details) + { simulated_time = 0 return } const events = details.events - if (!events || events.length === 0) { + if (!events || events.length === 0) + { simulated_time = 0 return } const last_event = events[events.length - 1] - if (!last_event.timestamp) { + if (!last_event.timestamp) + { simulated_time = 0 return } - if (current_event_idx !== -1) { + if (current_event_idx !== -1) + { const diff = Date.now() - last_event.timestamp simulated_time = diff - (diff % 1000) } else simulated_time = 0 } - Timer { + Timer + { running: current_event_idx !== -1 interval: 1000 repeat: true onTriggered: updateSimulatedTime() } - function getTimeText(duration, estimated) { + // Simulated countdown time until refund unlocked + property double countdown_time: -1 + function updateCountdownTime() + { + if (!details.payment_lock) + { + countdown_time = -1 + } + else + { + const diff = details.payment_lock - Date.now() + countdown_time = diff - (diff % 1000) + if (countdown_time < 0) + { + countdown_time = 0 + } + } + } + + Timer + { + running: countdown_time != 0 + interval: 1000 + repeat: true + onTriggered: updateCountdownTime() + } + + function getTimeText(duration, estimated) + { return `` + qsTr("act", "SHORT FOR ACTUAL TIME") + ": " + `` + `` + General.durationTextShort(duration) + `` + ` | ` + qsTr("est", "SHORT FOR ESTIMATED") + ": " + General.durationTextShort(estimated) + `` } + function getRefundText(countdown_time) + { + if (countdown_time > 0) + { + return `` + qsTr(General.durationTextShort(countdown_time) + " until refund lock is released.") + `` + } + return "" + } + onTotal_time_passedChanged: updateSimulatedTime() // Title - DefaultText { + DexLabel + { text_value: `` + qsTr("Progress details") + `` + ` | ` + getTimeText(total_time_passed + simulated_time, total_time_passed_estimated) @@ -116,14 +166,17 @@ ColumnLayout { Layout.bottomMargin: 10 } - Repeater { + Repeater + { Layout.fillWidth: true Layout.fillHeight: true model: all_events - delegate: Item { + delegate: Item + { readonly property - var event: { + var event: + { if (!details) return undefined const idx = details.events.map(e => e.state).indexOf(modelData) if (idx === -1) return undefined @@ -140,16 +193,18 @@ ColumnLayout { width: root.width height: 50 - DefaultText { + DexLabel { id: icon text_value: is_active ? "●" : "○" anchors.left: parent.left anchors.leftMargin: 10 anchors.verticalCenter: col_layout.verticalCenter - color: { + color: + { // Already exists, completed event - if (event) { + if (event) + { // Red for the Finished if swap failed if (event.state === "Finished" && details.order_status === "failed") return DexTheme.redColor @@ -166,7 +221,8 @@ ColumnLayout { } } - ColumnLayout { + ColumnLayout + { id: col_layout anchors.left: icon.right @@ -174,7 +230,8 @@ ColumnLayout { anchors.verticalCenter: parent.verticalCenter anchors.right: parent.right - DefaultText { + DexLabel + { id: name font.pixelSize: Style.textSizeSmall4 @@ -183,7 +240,8 @@ ColumnLayout { color: event ? DexTheme.foregroundColor : is_current_event ? DexTheme.foregroundColorLightColor0 : DexTheme.foregroundColorLightColor2 } - AnimatedRectangle { + AnimatedRectangle + { id: bar visible: is_active width: 300 @@ -191,14 +249,16 @@ ColumnLayout { color: DexTheme.foregroundColorDarkColor3 - AnimatedRectangle { + AnimatedRectangle + { width: parent.width * (total_time_passed > 0 ? (time_passed / (total_time_passed + simulated_time)) : 0) height: parent.height color: DexTheme.greenColor } } - DefaultText { + DexLabel + { visible: bar.visible font.pixelSize: Style.textSizeSmall2 From 5c28ce644977f540177a9ed4d03e1245a6fc9c47 Mon Sep 17 00:00:00 2001 From: syl Date: Fri, 8 Apr 2022 17:14:38 +0200 Subject: [PATCH 006/177] QML: Remove some unused variables --- atomic_defi_design/Dex/Constants/DexTheme.qml | 41 +---------------- atomic_defi_design/Dex/Constants/Style.qml | 45 +------------------ 2 files changed, 2 insertions(+), 84 deletions(-) diff --git a/atomic_defi_design/Dex/Constants/DexTheme.qml b/atomic_defi_design/Dex/Constants/DexTheme.qml index 60676c431c..c708de212c 100644 --- a/atomic_defi_design/Dex/Constants/DexTheme.qml +++ b/atomic_defi_design/Dex/Constants/DexTheme.qml @@ -354,14 +354,6 @@ QtObject { readonly property string colorRectangleBorderGradient1: dark_theme ? "#2A2F48" : "#DDDDDD" readonly property string colorRectangleBorderGradient2: dark_theme ? "#0D1021" : "#EFEFEF" - readonly property string colorChartText: dark_theme ? "#405366" : "#B5B9C1" - readonly property string colorChartLegendLine: dark_theme ? "#3F5265" : "#BDC0C8" - readonly property string colorChartGrid: dark_theme ? "#202333" : "#E6E8ED" - readonly property string colorChartLineText: dark_theme ? "#405366" : "#FFFFFF" - - readonly property string colorChartMA1: dark_theme ? "#5BC6FA" : "#5BC6FA" - readonly property string colorChartMA2: dark_theme ? "#F1D17F" : "#F1D17F" - readonly property string colorLineBasic: dark_theme ? "#303344" : "#303344" readonly property string colorBusyIndicator: dark_theme ? "#405ff9" : "#405ff9" @@ -369,36 +361,7 @@ QtObject { readonly property string colorText: dark_theme ? Style.colorWhite1 : "#405366" readonly property string colorText2: dark_theme ? "#79808C" : "#3C5368" readonly property string colorTextDisabled: dark_theme ? Style.colorWhite8 : "#B5B9C1" - readonly property var colorButtonDisabled: ({ - "default": Style.colorTheme9, - "primary": Style.colorGreen3, - "danger": Style.colorRed3 - }) - readonly property var colorButtonHovered: ({ - "default": Style.colorTheme6, - "primary": Style.colorGreen, - "danger": Style.colorRed - }) - readonly property var colorButtonEnabled: ({ - "default": Style.colorRectangle, - "primary": Style.colorGreen2, - "danger": Style.colorRed2 - }) - readonly property var colorButtonTextDisabled: ({ - "default": Style.colorWhite8, - "primary": Style.colorWhite13, - "danger": Style.colorWhite13 - }) - readonly property var colorButtonTextHovered: ({ - "default": Style.colorText, - "primary": Style.colorWhite11, - "danger": Style.colorWhite11 - }) - readonly property var colorButtonTextEnabled: ({ - "default": Style.colorText, - "primary": Style.colorWhite11, - "danger": Style.colorWhite11 - }) + readonly property string colorPlaceholderText: Style.colorWhite9 readonly property string colorSelectedText: Style.colorTheme9 readonly property string colorSelection: Style.colorGreen2 @@ -406,8 +369,6 @@ QtObject { readonly property string colorTrendingLine: dark_theme ? Style.colorGreen : "#37a6ef" readonly property string colorTrendingUnderLine: dark_theme ? Style.colorGradient3 : "#e3f2fd" - readonly property string modalValueColor: colorWhite4 - function getValueColor(v) { v = parseFloat(v) if(v !== 0) diff --git a/atomic_defi_design/Dex/Constants/Style.qml b/atomic_defi_design/Dex/Constants/Style.qml index 7b0dee74b3..4344434c9f 100644 --- a/atomic_defi_design/Dex/Constants/Style.qml +++ b/atomic_defi_design/Dex/Constants/Style.qml @@ -138,10 +138,6 @@ QtObject { property string colorRectangle: dark_theme ? colorTheme7 : colorTheme7 readonly property string colorInnerBackground: dark_theme ? colorTheme7 : colorTheme7 - readonly property string colorGradient1: dark_theme ? colorTheme9 : colorTheme9 - readonly property string colorGradient2: dark_theme ? colorTheme5 : colorTheme5 - readonly property string colorGradient3: dark_theme ? "#24283D" : "#24283D" - readonly property string colorGradient4: dark_theme ? "#0D0F21" : "#0D0F21" readonly property string colorDropShadowLight: dark_theme ? "#216975a4" : "#21FFFFFF" readonly property string colorDropShadowLight2: dark_theme ? "#606975a4" : "#60FFFFFF" readonly property string colorDropShadowDark: dark_theme ? "#FF050615" : "#BECDE2" @@ -172,50 +168,13 @@ QtObject { readonly property string colorRectangleBorderGradient1: dark_theme ? "#2A2F48" : "#DDDDDD" readonly property string colorRectangleBorderGradient2: dark_theme ? "#0D1021" : "#EFEFEF" - readonly property string colorChartText: dark_theme ? "#405366" : "#B5B9C1" - readonly property string colorChartLegendLine: dark_theme ? "#3F5265" : "#BDC0C8" - readonly property string colorChartGrid: dark_theme ? "#202333" : "#E6E8ED" - readonly property string colorChartLineText: dark_theme ? "#405366" : "#FFFFFF" - - readonly property string colorChartMA1: dark_theme ? "#5BC6FA" : "#5BC6FA" - readonly property string colorChartMA2: dark_theme ? "#F1D17F" : "#F1D17F" - readonly property string colorLineBasic: dark_theme ? "#303344" : "#303344" readonly property string colorText: dark_theme ? Style.colorWhite1 : "#405366" readonly property string colorText2: dark_theme ? "#79808C" : "#3C5368" readonly property string colorTextDisabled: dark_theme ? Style.colorWhite8 : "#B5B9C1" - readonly property var colorButtonDisabled: ({ - "default": Style.colorTheme9, - "primary": Style.colorGreen3, - "danger": Style.colorRed3 - }) - readonly property var colorButtonHovered: ({ - "default": Style.colorTheme6, - "primary": Style.colorGreen, - "danger": Style.colorRed - }) - readonly property var colorButtonEnabled: ({ - "default": Style.colorRectangle, - "primary": Style.colorGreen2, - "danger": Style.colorRed2 - }) - readonly property var colorButtonTextDisabled: ({ - "default": Style.colorWhite8, - "primary": Style.colorWhite13, - "danger": Style.colorWhite13 - }) - readonly property var colorButtonTextHovered: ({ - "default": Style.colorText, - "primary": Style.colorWhite11, - "danger": Style.colorWhite11 - }) - readonly property var colorButtonTextEnabled: ({ - "default": Style.colorText, - "primary": Style.colorWhite11, - "danger": Style.colorWhite11 - }) + readonly property string colorPlaceholderText: Style.colorWhite9 readonly property string colorSelectedText: Style.colorTheme9 readonly property string colorSelection: Style.colorGreen2 @@ -223,8 +182,6 @@ QtObject { readonly property string colorTrendingLine: dark_theme ? Style.colorGreen : "#37a6ef" readonly property string colorTrendingUnderLine: dark_theme ? Style.colorGradient3 : "#e3f2fd" - readonly property string modalValueColor: colorWhite4 - function getValueColor(v) { v = parseFloat(v) if(v !== 0) From b79f741d75e8518e9e841c5104374527afec3695 Mon Sep 17 00:00:00 2001 From: syl Date: Fri, 8 Apr 2022 17:19:53 +0200 Subject: [PATCH 007/177] QML: Remove more unused variables --- atomic_defi_design/Dex/Constants/DexTheme.qml | 13 ------------- atomic_defi_design/Dex/Constants/Style.qml | 9 --------- 2 files changed, 22 deletions(-) diff --git a/atomic_defi_design/Dex/Constants/DexTheme.qml b/atomic_defi_design/Dex/Constants/DexTheme.qml index c708de212c..8d1782b31a 100644 --- a/atomic_defi_design/Dex/Constants/DexTheme.qml +++ b/atomic_defi_design/Dex/Constants/DexTheme.qml @@ -216,15 +216,6 @@ QtObject { readonly property int animationDuration: 125 - readonly property int textSizeVerySmall1: 1 - readonly property int textSizeVerySmall2: 2 - readonly property int textSizeVerySmall3: 3 - readonly property int textSizeVerySmall4: 4 - readonly property int textSizeVerySmall5: 5 - readonly property int textSizeVerySmall6: 6 - readonly property int textSizeVerySmall7: 7 - readonly property int textSizeVerySmall8: 8 - readonly property int textSizeVerySmall9: 9 readonly property int textSizeSmall: 10 readonly property int textSizeSmall1: 11 readonly property int textSizeSmall2: 12 @@ -322,10 +313,6 @@ QtObject { readonly property string colorRectangle: dark_theme ? colorTheme7 : colorTheme7 readonly property string colorInnerBackground: dark_theme ? colorTheme7 : colorTheme7 - readonly property string colorGradient1: dark_theme ? colorTheme9 : colorTheme9 - readonly property string colorGradient2: dark_theme ? colorTheme5 : colorTheme5 - readonly property string colorGradient3: dark_theme ? "#24283D" : "#24283D" - readonly property string colorGradient4: dark_theme ? "#0D0F21" : "#0D0F21" readonly property string colorDropShadowLight: dark_theme ? "#216975a4" : "#21FFFFFF" readonly property string colorDropShadowLight2: dark_theme ? "#606975a4" : "#60FFFFFF" readonly property string colorDropShadowDark: dark_theme ? "#FF050615" : "#BECDE2" diff --git a/atomic_defi_design/Dex/Constants/Style.qml b/atomic_defi_design/Dex/Constants/Style.qml index 4344434c9f..79d60af39a 100644 --- a/atomic_defi_design/Dex/Constants/Style.qml +++ b/atomic_defi_design/Dex/Constants/Style.qml @@ -32,15 +32,6 @@ QtObject { readonly property int animationDuration: 125 - readonly property int textSizeVerySmall1: 1 - readonly property int textSizeVerySmall2: 2 - readonly property int textSizeVerySmall3: 3 - readonly property int textSizeVerySmall4: 4 - readonly property int textSizeVerySmall5: 5 - readonly property int textSizeVerySmall6: 6 - readonly property int textSizeVerySmall7: 7 - readonly property int textSizeVerySmall8: 8 - readonly property int textSizeVerySmall9: 9 readonly property int textSizeSmall: 10 readonly property int textSizeSmall1: 11 readonly property int textSizeSmall2: 12 From 5f62ca5d97b6279117d9039a6d32ebe571b1d07a Mon Sep 17 00:00:00 2001 From: syl Date: Fri, 8 Apr 2022 18:10:58 +0200 Subject: [PATCH 008/177] QML: Remove more unused variables --- atomic_defi_design/Dex/Constants/DexTheme.qml | 1 - atomic_defi_design/Dex/Constants/Style.qml | 1 - 2 files changed, 2 deletions(-) diff --git a/atomic_defi_design/Dex/Constants/DexTheme.qml b/atomic_defi_design/Dex/Constants/DexTheme.qml index 8d1782b31a..8bdc9aaf6e 100644 --- a/atomic_defi_design/Dex/Constants/DexTheme.qml +++ b/atomic_defi_design/Dex/Constants/DexTheme.qml @@ -354,7 +354,6 @@ QtObject { readonly property string colorSelection: Style.colorGreen2 readonly property string colorTrendingLine: dark_theme ? Style.colorGreen : "#37a6ef" - readonly property string colorTrendingUnderLine: dark_theme ? Style.colorGradient3 : "#e3f2fd" function getValueColor(v) { v = parseFloat(v) diff --git a/atomic_defi_design/Dex/Constants/Style.qml b/atomic_defi_design/Dex/Constants/Style.qml index 79d60af39a..0609dd2b10 100644 --- a/atomic_defi_design/Dex/Constants/Style.qml +++ b/atomic_defi_design/Dex/Constants/Style.qml @@ -171,7 +171,6 @@ QtObject { readonly property string colorSelection: Style.colorGreen2 readonly property string colorTrendingLine: dark_theme ? Style.colorGreen : "#37a6ef" - readonly property string colorTrendingUnderLine: dark_theme ? Style.colorGradient3 : "#e3f2fd" function getValueColor(v) { v = parseFloat(v) From 715862de53dbcfe979244bcc5738972e59cba3f8 Mon Sep 17 00:00:00 2001 From: syl Date: Fri, 8 Apr 2022 18:29:36 +0200 Subject: [PATCH 009/177] Fix coding style --- atomic_defi_design/Dex/Screens/Dashboard.qml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/atomic_defi_design/Dex/Screens/Dashboard.qml b/atomic_defi_design/Dex/Screens/Dashboard.qml index 2a810849f4..81703fa927 100644 --- a/atomic_defi_design/Dex/Screens/Dashboard.qml +++ b/atomic_defi_design/Dex/Screens/Dashboard.qml @@ -19,10 +19,9 @@ import "../Settings" as SettingsPage import "../Screens" import "../Addressbook" as Addressbook import Dex.Themes 1.0 as Dex -//import Dex.Sidebar 1.0 as Dex - -Item { +Item +{ id: dashboard enum PageType @@ -146,7 +145,7 @@ Item { { id: addressbook - Addressbook.Main {} + Addressbook.Main { } } Component From 105524f219bccf7c1d1053852db392f3cce8e6ce Mon Sep 17 00:00:00 2001 From: syl Date: Fri, 8 Apr 2022 18:34:11 +0200 Subject: [PATCH 010/177] Update theme files --- assets/themes/Default - Dark/colors.json | 4 ++-- assets/themes/Default - Light/colors.json | 4 ++-- atomic_defi_design/Dex/Screens/Startup/WalletsView.qml | 2 +- atomic_defi_design/Dex/Themes/CurrentTheme.qml | 8 ++++---- atomic_defi_design/Dex/Themes/DefaultTheme.js | 4 ++-- atomic_defi_design/Dex/Themes/ThemeData.qml | 4 ++-- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/assets/themes/Default - Dark/colors.json b/assets/themes/Default - Dark/colors.json index c30f8ee4ec..5a31681de6 100644 --- a/assets/themes/Default - Dark/colors.json +++ b/assets/themes/Default - Dark/colors.json @@ -78,8 +78,8 @@ "rangeSliderIndicatorBackgroundStartColor": "#5A68E6FF", "rangeSliderIndicatorBackgroundEndColor": "#4986EAFF", - "loginWalletIconColorStart": "#5A68E6FF", - "loginWalletIconColorEnd": "#4986EAAD", + "userIconColorStart": "#5A68E6FF", + "userIconColorEnd": "#4986EAAD", "sidebarBgColor": "#202337", "sidebarVersionTextColor": "#2F5688", diff --git a/assets/themes/Default - Light/colors.json b/assets/themes/Default - Light/colors.json index 6fd0870058..94a19e0e65 100644 --- a/assets/themes/Default - Light/colors.json +++ b/assets/themes/Default - Light/colors.json @@ -75,8 +75,8 @@ "rangeSliderIndicatorBackgroundStartColor": "#5A68E6FF", "rangeSliderIndicatorBackgroundEndColor": "#4986EAFF", - "loginWalletIconColorStart": "#5A68E6FF", - "loginWalletIconColorEnd": "#4986EAAD", + "userIconColorStart": "#5A68E6FF", + "userIconColorEnd": "#4986EAAD", "sidebarBgColor": "#FCFCFC", "sidebarVersionTextColor": "#456078", diff --git a/atomic_defi_design/Dex/Screens/Startup/WalletsView.qml b/atomic_defi_design/Dex/Screens/Startup/WalletsView.qml index 36de794adc..86d01bdb46 100644 --- a/atomic_defi_design/Dex/Screens/Startup/WalletsView.qml +++ b/atomic_defi_design/Dex/Screens/Startup/WalletsView.qml @@ -191,7 +191,7 @@ SetupPage Qaterial.ColorIcon { anchors.fill: parent - color: Dex.CurrentTheme.loginWalletIconColorStart + color: Dex.CurrentTheme.userIconColorStart source: Qaterial.Icons.account iconSize: 28 } diff --git a/atomic_defi_design/Dex/Themes/CurrentTheme.qml b/atomic_defi_design/Dex/Themes/CurrentTheme.qml index 06fafacb7b..087f7d51eb 100644 --- a/atomic_defi_design/Dex/Themes/CurrentTheme.qml +++ b/atomic_defi_design/Dex/Themes/CurrentTheme.qml @@ -165,8 +165,8 @@ ThemeData rangeSliderIndicatorBackgroundStartColor = Dex.Color.argbStrFromRgbaStr(themeData.rangeSliderIndicatorBackgroundStartColor || defaultTheme.rangeSliderIndicatorBackgroundStartColor); rangeSliderIndicatorBackgroundEndColor = Dex.Color.argbStrFromRgbaStr(themeData.rangeSliderIndicatorBackgroundEndColor || defaultTheme.rangeSliderIndicatorBackgroundEndColor); - loginWalletIconColorStart = Dex.Color.argbStrFromRgbaStr(themeData.loginWalletIconColorStart || defaultTheme.loginWalletIconColorStart) - loginWalletIconColorEnd = Dex.Color.argbStrFromRgbaStr(themeData.loginWalletIconColorEnd || defaultTheme.loginWalletIconColorEnd) + userIconColorStart = Dex.Color.argbStrFromRgbaStr(themeData.userIconColorStart || defaultTheme.userIconColorStart) + userIconColorEnd = Dex.Color.argbStrFromRgbaStr(themeData.userIconColorEnd || defaultTheme.userIconColorEnd) sidebarBgColor = Dex.Color.argbStrFromRgbaStr(themeData.sidebarBgColor || defaultTheme.sidebarBgColor); sidebarVersionTextColor = Dex.Color.argbStrFromRgbaStr(themeData.sidebarVersionTextColor || defaultTheme.sidebarVersionTextColor); @@ -278,8 +278,8 @@ ThemeData console.info("Dex.Themes.CurrentTheme.printValues.rangeSliderIndicatorBackgroundStartColor : %1".arg(rangeSliderIndicatorBackgroundStartColor)); console.info("Dex.Themes.CurrentTheme.printValues.rangeSliderIndicatorBackgroundEndColor : %1".arg(rangeSliderIndicatorBackgroundEndColor)); - console.info("Dex.Themes.CurrentTheme.printValues.loginWalletIconColorStart : %1".arg(loginWalletIconColorStart)); - console.info("Dex.Themes.CurrentTheme.printValues.loginWalletIconColorEnd : %1".arg(loginWalletIconColorEnd)); + console.info("Dex.Themes.CurrentTheme.printValues.userIconColorStart : %1".arg(userIconColorStart)); + console.info("Dex.Themes.CurrentTheme.printValues.userIconColorEnd : %1".arg(userIconColorEnd)); console.info("Dex.Themes.CurrentTheme.printValues.sidebarBgColor : %1".arg(sidebarBgColor)); console.info("Dex.Themes.CurrentTheme.printValues.sidebarVersionTextColor : %1".arg(sidebarVersionTextColor)); diff --git a/atomic_defi_design/Dex/Themes/DefaultTheme.js b/atomic_defi_design/Dex/Themes/DefaultTheme.js index 80fccc522b..2e04332d72 100644 --- a/atomic_defi_design/Dex/Themes/DefaultTheme.js +++ b/atomic_defi_design/Dex/Themes/DefaultTheme.js @@ -81,8 +81,8 @@ function getHardcoded() rangeSliderIndicatorBackgroundStartColor: "#5A68E6FF", rangeSliderIndicatorBackgroundEndColor: "#4986EAAD", - loginWalletIconColorStart: "#5A68E6FF", - loginWalletIconColorEnd: "#4986EAAD", + userIconColorStart: "#5A68E6FF", + userIconColorEnd: "#4986EAAD", sidebarBgColor: "#FCFCFC", sidebarVersionTextColor: "#456078", diff --git a/atomic_defi_design/Dex/Themes/ThemeData.qml b/atomic_defi_design/Dex/Themes/ThemeData.qml index 9bef9da0fa..7c6f877ad7 100644 --- a/atomic_defi_design/Dex/Themes/ThemeData.qml +++ b/atomic_defi_design/Dex/Themes/ThemeData.qml @@ -81,8 +81,8 @@ QtObject property color rangeSliderIndicatorBackgroundEndColor // Login page related - property color loginWalletIconColorStart - property color loginWalletIconColorEnd // Property not yet used. + property color userIconColorStart + property color userIconColorEnd // Property not yet used. // Sidebar related property color sidebarBgColor From 43ccee519801f4fd234c94767ec0ad764cf09040 Mon Sep 17 00:00:00 2001 From: syl Date: Fri, 8 Apr 2022 18:34:24 +0200 Subject: [PATCH 011/177] QML: Add new font config --- atomic_defi_design/Dex/Constants/DexTypo.qml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/atomic_defi_design/Dex/Constants/DexTypo.qml b/atomic_defi_design/Dex/Constants/DexTypo.qml index 3d1c36a9f3..c297c5e0ed 100644 --- a/atomic_defi_design/Dex/Constants/DexTypo.qml +++ b/atomic_defi_design/Dex/Constants/DexTypo.qml @@ -69,6 +69,12 @@ QtObject { family: fontFamily, weight: Font.Medium }) + property font head8: Qt.font({ + pixelSize: 16 * fontDensity, + letterSpacing: 0.15, + family: fontFamily, + weight: Font.Medium + }) property font subtitle1: Qt.font({ pixelSize: 16 * fontDensity, letterSpacing: 0.15, From 9664909fc1630234b370fe8d112d3e615a9b9403 Mon Sep 17 00:00:00 2001 From: syl Date: Fri, 8 Apr 2022 19:15:06 +0200 Subject: [PATCH 012/177] Update theme files and arrow component --- assets/themes/Binance - Dark/colors.json | 4 ++-- assets/themes/Default - Dark/colors.json | 4 ++-- assets/themes/Default - Light/colors.json | 4 ++-- atomic_defi_design/Dex/Components/Arrow.qml | 9 +++++---- .../Dex/Components/TransactionArrow.qml | 11 +++++++++++ atomic_defi_design/Dex/Constants/DexTheme.qml | 4 ++-- .../Dex/Exchange/Trade/SimpleView/Trade.qml | 3 --- atomic_defi_design/Dex/Themes/CurrentTheme.qml | 8 ++++---- atomic_defi_design/Dex/Themes/DefaultTheme.js | 4 ++-- atomic_defi_design/Dex/Themes/ThemeData.qml | 4 ++-- atomic_defi_design/Dex/Wallet/Main.qml | 16 ++++++++-------- atomic_defi_design/Dex/Wallet/Transactions.qml | 5 ++--- 12 files changed, 42 insertions(+), 34 deletions(-) create mode 100644 atomic_defi_design/Dex/Components/TransactionArrow.qml diff --git a/assets/themes/Binance - Dark/colors.json b/assets/themes/Binance - Dark/colors.json index 2373c56ea8..9fad9f01fd 100644 --- a/assets/themes/Binance - Dark/colors.json +++ b/assets/themes/Binance - Dark/colors.json @@ -66,8 +66,8 @@ "okColor": "#74fbee", "noColor": "#d13990", - "arrowUpColor": "#F85757", - "arrowDownColor": "#845FEF", + "senderColorStart": "#F85757", + "receiverColorStart": "#845FEF", "lineSeparatorColor": "#222" } \ No newline at end of file diff --git a/assets/themes/Default - Dark/colors.json b/assets/themes/Default - Dark/colors.json index 5a31681de6..620fc12d50 100644 --- a/assets/themes/Default - Dark/colors.json +++ b/assets/themes/Default - Dark/colors.json @@ -97,8 +97,8 @@ "okColor": "#00C058", "noColor": "#E52167", - "arrowUpColor": "#F85757", - "arrowDownColor": "#845FEF", + "senderColorStart": "#F85757", + "receiverColorStart": "#845FEF", "lineSeparatorColor": "#262941" } diff --git a/assets/themes/Default - Light/colors.json b/assets/themes/Default - Light/colors.json index 94a19e0e65..7c656a9cb3 100644 --- a/assets/themes/Default - Light/colors.json +++ b/assets/themes/Default - Light/colors.json @@ -94,8 +94,8 @@ "okColor": "#00C058", "noColor": "#E52167", - "arrowUpColor": "#F85757", - "arrowDownColor": "#845FEF", + "senderColorStart": "#F85757", + "receiverColorStart": "#845FEF", "lineSeparatorColor": "#CDD3DC" } diff --git a/atomic_defi_design/Dex/Components/Arrow.qml b/atomic_defi_design/Dex/Components/Arrow.qml index 7e2df67f7e..827d13e558 100644 --- a/atomic_defi_design/Dex/Components/Arrow.qml +++ b/atomic_defi_design/Dex/Components/Arrow.qml @@ -1,8 +1,9 @@ +// Qt Imports import QtQuick 2.15 -import "../Constants" -import "../Components" -import Dex.Themes 1.0 as Dex +// Project Imports +import "../Constants" //> General.image_path +import Dex.Themes 1.0 as Dex //> CurrentTheme Item { property bool up: true @@ -27,7 +28,7 @@ Item { anchors.fill: img source: img - color: up ? Dex.CurrentTheme.arrowUpColor : Dex.CurrentTheme.arrowDownColor + color: Dex.CurrentTheme.foregroundColor } } diff --git a/atomic_defi_design/Dex/Components/TransactionArrow.qml b/atomic_defi_design/Dex/Components/TransactionArrow.qml new file mode 100644 index 0000000000..edf58a44ec --- /dev/null +++ b/atomic_defi_design/Dex/Components/TransactionArrow.qml @@ -0,0 +1,11 @@ +// Project Imports +import Dex.Themes 1.0 as Dex //> CurrentTheme + +Arrow +{ + id: root + + property alias amISender: root.up + + color: !amISender ? Dex.CurrentTheme.senderColorStart : Dex.CurrentTheme.receiverColorStart +} diff --git a/atomic_defi_design/Dex/Constants/DexTheme.qml b/atomic_defi_design/Dex/Constants/DexTheme.qml index 8bdc9aaf6e..9bee21c1b3 100644 --- a/atomic_defi_design/Dex/Constants/DexTheme.qml +++ b/atomic_defi_design/Dex/Constants/DexTheme.qml @@ -118,8 +118,8 @@ QtObject { property bool portfolioPieGradient: false - property color arrowUpColor: redColor - property color arrowDownColor: greenColor + property color senderColorStart: redColor + property color receiverColorStart: greenColor diff --git a/atomic_defi_design/Dex/Exchange/Trade/SimpleView/Trade.qml b/atomic_defi_design/Dex/Exchange/Trade/SimpleView/Trade.qml index a4a8d89cec..62a8c5785b 100644 --- a/atomic_defi_design/Dex/Exchange/Trade/SimpleView/Trade.qml +++ b/atomic_defi_design/Dex/Exchange/Trade/SimpleView/Trade.qml @@ -413,7 +413,6 @@ ClipRRect // Trade Card anchors.verticalCenter: parent.verticalCenter anchors.right: parent.right anchors.rightMargin: 5 - color: DexTheme.foregroundColor up: false } @@ -593,8 +592,6 @@ ClipRRect // Trade Card anchors.right: parent.right anchors.rightMargin: 5 - color: DexTheme.foregroundColor - up: false } } diff --git a/atomic_defi_design/Dex/Themes/CurrentTheme.qml b/atomic_defi_design/Dex/Themes/CurrentTheme.qml index 087f7d51eb..279d051eec 100644 --- a/atomic_defi_design/Dex/Themes/CurrentTheme.qml +++ b/atomic_defi_design/Dex/Themes/CurrentTheme.qml @@ -184,8 +184,8 @@ ThemeData okColor = Dex.Color.argbStrFromRgbaStr(themeData.okColor || defaultTheme.okColor); noColor = Dex.Color.argbStrFromRgbaStr(themeData.noColor || defaultTheme.noColor); - arrowUpColor = Dex.Color.argbStrFromRgbaStr(themeData.arrowUpColor || defaultTheme.arrowUpColor); - arrowDownColor = Dex.Color.argbStrFromRgbaStr(themeData.arrowDownColor || defaultTheme.arrowDownColor); + senderColorStart = Dex.Color.argbStrFromRgbaStr(themeData.senderColorStart || defaultTheme.senderColorStart); + receiverColorStart = Dex.Color.argbStrFromRgbaStr(themeData.receiverColorStart || defaultTheme.receiverColorStart); lineSeparatorColor = Dex.Color.argbStrFromRgbaStr(themeData.lineSeparatorColor || defaultTheme.lineSeparatorColor); } @@ -297,8 +297,8 @@ ThemeData console.info("Dex.Themes.CurrentTheme.printValues.okColor : %1".arg(okColor)); console.info("Dex.Themes.CurrentTheme.printValues.noColor : %1".arg(noColor)); - console.info("Dex.Themes.CurrentTheme.printValues.arrowUpColor : %1".arg(arrowUpColor)); - console.info("Dex.Themes.CurrentTheme.printValues.arrowDownColor : %1".arg(arrowDownColor)); + console.info("Dex.Themes.CurrentTheme.printValues.senderColorStart : %1".arg(senderColorStart)); + console.info("Dex.Themes.CurrentTheme.printValues.receiverColorStart : %1".arg(receiverColorStart)); console.info("Dex.Themes.CurrentTheme.printValues.lineSeparatorColor : %1".arg(lineSeparatorColor)); diff --git a/atomic_defi_design/Dex/Themes/DefaultTheme.js b/atomic_defi_design/Dex/Themes/DefaultTheme.js index 2e04332d72..0414edb9f9 100644 --- a/atomic_defi_design/Dex/Themes/DefaultTheme.js +++ b/atomic_defi_design/Dex/Themes/DefaultTheme.js @@ -100,8 +100,8 @@ function getHardcoded() okColor: "#00C058", noColor: "#E52167", - arrowUpColor: "#F85757", - arrowDownColor: "#845FEF", + senderColorStart: "#F85757", + receiverColorStart: "#845FEF", lineSeparatorColor: "#CDD3DC" } diff --git a/atomic_defi_design/Dex/Themes/ThemeData.qml b/atomic_defi_design/Dex/Themes/ThemeData.qml index 7c6f877ad7..920d59caeb 100644 --- a/atomic_defi_design/Dex/Themes/ThemeData.qml +++ b/atomic_defi_design/Dex/Themes/ThemeData.qml @@ -103,8 +103,8 @@ QtObject property color okColor property color noColor - property color arrowUpColor - property color arrowDownColor + property color senderColorStart + property color receiverColorStart property color lineSeparatorColor diff --git a/atomic_defi_design/Dex/Wallet/Main.qml b/atomic_defi_design/Dex/Wallet/Main.qml index b90737aff1..936c525e08 100644 --- a/atomic_defi_design/Dex/Wallet/Main.qml +++ b/atomic_defi_design/Dex/Wallet/Main.qml @@ -406,10 +406,10 @@ Item else enable_fees_coin_modal.open() } - Arrow + TransactionArrow { id: arrow_send - up: true + amISender: true anchors.verticalCenter: parent.verticalCenter anchors.right: parent.right anchors.rightMargin: 19 @@ -494,12 +494,12 @@ Item onClicked: receive_modal.open() - Arrow + TransactionArrow { anchors.verticalCenter: parent.verticalCenter anchors.right: parent.right anchors.rightMargin: arrow_send.anchors.rightMargin - up: false + amISender: false } } @@ -537,15 +537,15 @@ Item anchors.rightMargin: arrow_send.anchors.rightMargin spacing: 2 - Arrow + TransactionArrow { - up: true + amISender: true anchors.verticalCenter: parent.verticalCenter } - Arrow + TransactionArrow { - up: false + amISender: false anchors.verticalCenter: parent.verticalCenter } } diff --git a/atomic_defi_design/Dex/Wallet/Transactions.qml b/atomic_defi_design/Dex/Wallet/Transactions.qml index 9ad085c5d5..75e284f52b 100644 --- a/atomic_defi_design/Dex/Wallet/Transactions.qml +++ b/atomic_defi_design/Dex/Wallet/Transactions.qml @@ -52,11 +52,10 @@ DefaultListView visible: transaction_note !== "" } - Arrow + TransactionArrow { id: received_icon - up: am_i_sender ? true : false - color: !am_i_sender ? Dex.CurrentTheme.arrowUpColor : Dex.CurrentTheme.arrowDownColor + amISender: am_i_sender anchors.verticalCenter: parent.verticalCenter anchors.left: note_tag.right anchors.leftMargin: 10 From d517236a61d77e2cee10ab16cf5f1031393b33e3 Mon Sep 17 00:00:00 2001 From: syl Date: Mon, 11 Apr 2022 14:45:23 +0200 Subject: [PATCH 013/177] QML: Add Popup component --- .../Dex/Components/DefaultPopup.qml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 atomic_defi_design/Dex/Components/DefaultPopup.qml diff --git a/atomic_defi_design/Dex/Components/DefaultPopup.qml b/atomic_defi_design/Dex/Components/DefaultPopup.qml new file mode 100644 index 0000000000..e893062d08 --- /dev/null +++ b/atomic_defi_design/Dex/Components/DefaultPopup.qml @@ -0,0 +1,15 @@ +// Qt Imports +import QtQuick 2.12 +import QtQuick.Controls 2.15 //> Popup + +Popup +{ + id: popup + + y: parent.height + x: (parent.width / 2) - (width / 2) + + closePolicy: Popup.CloseOnPressOutsideParent | Popup.CloseOnEscape + + background: FloatingBackground { } +} From ee036bbeec0a8390f69b320f669d2deb0b879675 Mon Sep 17 00:00:00 2001 From: syl Date: Mon, 11 Apr 2022 14:45:57 +0200 Subject: [PATCH 014/177] QML: Add UserIcon component --- atomic_defi_design/Dex/Components/UserIcon.qml | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 atomic_defi_design/Dex/Components/UserIcon.qml diff --git a/atomic_defi_design/Dex/Components/UserIcon.qml b/atomic_defi_design/Dex/Components/UserIcon.qml new file mode 100644 index 0000000000..d557228cc7 --- /dev/null +++ b/atomic_defi_design/Dex/Components/UserIcon.qml @@ -0,0 +1,12 @@ +// 3rdParty Imports +import Qaterial 1.0 as Qaterial //> ColorIcon + +// Project Imports +import Dex.Themes 1.0 as Dex //> CurrentTheme + +Qaterial.ColorIcon +{ + color: Dex.CurrentTheme.userIconColorStart + source: Qaterial.Icons.account + iconSize: 28 +} From 70017b1c07b2a5cf7787338792dae6c3f17e2bc6 Mon Sep 17 00:00:00 2001 From: syl Date: Mon, 11 Apr 2022 14:46:12 +0200 Subject: [PATCH 015/177] QML: Add Dex.Components module --- atomic_defi_design/Dex/Components/qmldir | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/atomic_defi_design/Dex/Components/qmldir b/atomic_defi_design/Dex/Components/qmldir index e7ea93dc86..915372c2e3 100644 --- a/atomic_defi_design/Dex/Components/qmldir +++ b/atomic_defi_design/Dex/Components/qmldir @@ -1,3 +1,12 @@ module Dex.Components -DefaultText 1.0 DefaultText.qml +Button 1.0 DefaultButton.qml +GradientButton 1.0 GradientButton.qml +Image 1.0 DefaultImage.qml +Popup 1.0 DefaultPopup.qml +Rectangle 1.0 DefaultRectangle.qml +SearchField 1.0 SearchField.qml +Text 1.0 DefaultText.qml +TextField 1.0 DefaultTextField.qml +ToolTip 1.0 DefaultTooltip.qml +UserIcon 1.0 UserIcon.qml From 336ab331e29d904d4f5b5f4f2842a894b5729d4e Mon Sep 17 00:00:00 2001 From: smk762 Date: Mon, 18 Apr 2022 16:40:56 +0800 Subject: [PATCH 016/177] ready to test? --- .../Dex/Dashboard/NotificationsModal.qml | 2 +- .../ProView/TradingInfo/OrderModal.qml | 12 ++-- .../ProView/TradingInfo/SwapProgress.qml | 64 ++++++++++++++----- src/core/atomicdex/models/qt.orders.model.cpp | 5 ++ 4 files changed, 62 insertions(+), 21 deletions(-) diff --git a/atomic_defi_design/Dex/Dashboard/NotificationsModal.qml b/atomic_defi_design/Dex/Dashboard/NotificationsModal.qml index b2fc7f3a94..de85fbad5e 100644 --- a/atomic_defi_design/Dex/Dashboard/NotificationsModal.qml +++ b/atomic_defi_design/Dex/Dashboard/NotificationsModal.qml @@ -106,7 +106,7 @@ DexPopup root.open() break case "open_wallet_page": - api_wallet_page.ticker = notification.params.ticker + API.app.wallet_pg.ticker = notification.params.ticker dashboard.switchPage(Dashboard.PageType.Wallet) break case "open_swaps_page": diff --git a/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/OrderModal.qml b/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/OrderModal.qml index 6b553ace38..2988649628 100644 --- a/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/OrderModal.qml +++ b/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/OrderModal.qml @@ -64,7 +64,7 @@ MultipageModal Layout.alignment: Qt.AlignHCenter visible: text_value != "" font.pixelSize: Style.textSizeSmall2 - text_value: swapProgress.getRefundText(swapProgress.countdown_time) + text_value: !details ? "" : details.order_status === "refunding" ? swapProgress.getRefundText() : "" } RowLayout @@ -203,7 +203,7 @@ MultipageModal ColumnLayout { - width: 400 + Layout.fillWidth: true height: parent.height - 30 spacing: 12 @@ -254,8 +254,9 @@ MultipageModal Layout.fillWidth: true title: !details ? "" : details.is_maker ? qsTr("Maker Payment Sent ID") : qsTr("Maker Payment Spent ID") text: !details ? "" : details.maker_payment_id - label.font.pixelSize: 13 + label.font.pixelSize: 12 visible: text !== '' + copy: true privacy: true } @@ -265,8 +266,9 @@ MultipageModal Layout.fillWidth: true title: !details ? "" : details.is_maker ? qsTr("Taker Payment Spent ID") : qsTr("Taker Payment Sent ID") text: !details ? "" : details.taker_payment_id - label.font.pixelSize: 13 + label.font.pixelSize: 12 visible: text !== '' + copy: true privacy: true } @@ -302,8 +304,8 @@ MultipageModal SwapProgress { id: swapProgress - visible: General.exists(details) && details.order_status !== "matching" Layout.fillWidth: true + visible: General.exists(details) && details.order_status !== "matching" details: root.details } } diff --git a/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/SwapProgress.qml b/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/SwapProgress.qml index 7ebb402cfa..95a569e53b 100644 --- a/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/SwapProgress.qml +++ b/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/SwapProgress.qml @@ -99,6 +99,7 @@ ColumnLayout { const diff = Date.now() - last_event.timestamp simulated_time = diff - (diff % 1000) + } else simulated_time = 0 } @@ -111,27 +112,55 @@ ColumnLayout } // Simulated countdown time until refund unlocked - property double countdown_time: -1 + property double payment_lock_countdown_time: -1 + property double wait_until_countdown_time: -1 function updateCountdownTime() { - if (!details.payment_lock) + if (!details) { + payment_lock_countdown_time = -1 + return + } + + if (payment_lock_countdown_time == 0) { - countdown_time = -1 + console.log(">payment_lock_countdown_time at zero " + details.order_id) + if (wait_until_countdown_time < 0) + { + if (details.events[current_event_idx - 1].hasOwnProperty('data')) + { + if (details.events[current_event_idx - 1]['data'].hasOwnProperty('wait_until')) + { + console.log(">Date.now(): " + Date.now()) + console.log(">wait_until: " + details.events[current_event_idx - 1]['data']['wait_until'] * 1000) + const diff = details.events[current_event_idx - 1]['data']['wait_until'] * 1000 - Date.now() + wait_until_countdown_time = diff - (diff % 1000) + console.log(">wait_until_countdown_time: " + wait_until_countdown_time) + if (wait_until_countdown_time <= 0) + { + wait_until_countdown_time = 0 + } + } + } + } } - else + else if (details.hasOwnProperty('payment_lock')) { const diff = details.payment_lock - Date.now() - countdown_time = diff - (diff % 1000) - if (countdown_time < 0) + payment_lock_countdown_time = diff - (diff % 1000) + if (payment_lock_countdown_time <= 0) { - countdown_time = 0 + payment_lock_countdown_time = 0 } } + else + { + payment_lock_countdown_time = -1 + } } Timer { - running: countdown_time != 0 + running: details.order_status interval: 1000 repeat: true onTriggered: updateCountdownTime() @@ -145,20 +174,26 @@ ColumnLayout General.durationTextShort(estimated) + `` } - function getRefundText(countdown_time) + function getRefundText() { - if (countdown_time > 0) - { - return `` + qsTr(General.durationTextShort(countdown_time) + " until refund lock is released.") + `` + console.log(".payment_lock_countdown_time: " + payment_lock_countdown_time) + console.log(".wait_until_countdown_time: " + wait_until_countdown_time) + if (payment_lock_countdown_time > 0) + { + return `` + qsTr(General.durationTextShort(payment_lock_countdown_time) + " until refund lock is released.") + `` + } + else if (event) { + if (wait_until_countdown_time > 0 && event.state !== "Finished") { + return `` + qsTr(General.durationTextShort(wait_until_countdown_time) + " until refund completed.") + `` + } } return "" } - onTotal_time_passedChanged: updateSimulatedTime() - // Title DexLabel { + Layout.fillWidth: true text_value: `` + qsTr("Progress details") + `` + ` | ` + getTimeText(total_time_passed + simulated_time, total_time_passed_estimated) @@ -168,7 +203,6 @@ ColumnLayout Repeater { - Layout.fillWidth: true Layout.fillHeight: true model: all_events diff --git a/src/core/atomicdex/models/qt.orders.model.cpp b/src/core/atomicdex/models/qt.orders.model.cpp index 53149f2911..c53921b49e 100644 --- a/src/core/atomicdex/models/qt.orders.model.cpp +++ b/src/core/atomicdex/models/qt.orders.model.cpp @@ -716,10 +716,15 @@ namespace atomic_dex ::mm2::api::to_json(json_data, req); batch.push_back(json_data); + SPDLOG_INFO("recover_funds_of_swap request: {}", json_data.dump(-1)); + auto answer_functor = [this](web::http::http_response resp) { nlohmann::json j_out = nlohmann::json::object(); std::string body = TO_STD_STR(resp.extract_string(true).get()); + + SPDLOG_INFO("recover_funds_of_swap answer received: {}", body); + if (resp.status_code() == web::http::status_codes::OK) { auto answers = nlohmann::json::parse(body); From 1ee75b323b50d3164748eb77d910b0e582daf4dc Mon Sep 17 00:00:00 2001 From: syl Date: Mon, 18 Apr 2022 13:02:57 +0200 Subject: [PATCH 017/177] Coding style --- .../Dex/Components/DexComboBox.qml | 41 +++++++++---------- 1 file changed, 19 insertions(+), 22 deletions(-) diff --git a/atomic_defi_design/Dex/Components/DexComboBox.qml b/atomic_defi_design/Dex/Components/DexComboBox.qml index 97749ffcf8..d2adc74cfd 100644 --- a/atomic_defi_design/Dex/Components/DexComboBox.qml +++ b/atomic_defi_design/Dex/Components/DexComboBox.qml @@ -14,29 +14,17 @@ ComboBox { id: control - property alias radius: bg_rect.radius - property color lineHoverColor: DexTheme.hoverColor - property color mainBackgroundColor: Dex.CurrentTheme.floatingBackgroundColor - property int dropDownMaxHeight: 300 - property color dropdownBackgroundColor: Dex.CurrentTheme.floatingBackgroundColor - property - var dropdownLineText: m => textRole === "" ? - m.modelData : - !m.modelData ? m[textRole] : m.modelData[textRole] + property alias radius: bg_rect.radius + property color lineHoverColor: DexTheme.hoverColor + property color mainBackgroundColor: Dex.CurrentTheme.floatingBackgroundColor + property int dropDownMaxHeight: 300 + property color dropdownBackgroundColor: Dex.CurrentTheme.floatingBackgroundColor + property var dropdownLineText: m => textRole === "" ? m.modelData : + !m.modelData ? m[textRole] : m.modelData[textRole] property string mainLineText: control.displayText - readonly property bool disabled: !enabled - font.family: Style.font_family - Behavior on lineHoverColor - { - ColorAnimation - { - duration: Style.animationDuration - } - } - hoverEnabled: true // Main, selected text @@ -56,7 +44,6 @@ ComboBox } } - // Main background background: FloatingBackground { @@ -116,8 +103,10 @@ ComboBox } // Each dropdown item - delegate: ItemDelegate + delegate: Qaterial.ItemDelegate { + id: _delegate + Universal.accent: Dex.CurrentTheme.comboBoxDropdownItemHighlightedColor width: control.width highlighted: control.highlightedIndex === index @@ -156,9 +145,17 @@ ComboBox } } + Behavior on lineHoverColor + { + ColorAnimation + { + duration: Style.animationDuration + } + } + DefaultMouseArea { anchors.fill: parent acceptedButtons: Qt.NoButton } -} \ No newline at end of file +} From 815c50a8c743d319e675e134c916058e08effd53 Mon Sep 17 00:00:00 2001 From: syl Date: Mon, 18 Apr 2022 13:03:41 +0200 Subject: [PATCH 018/177] Add new addressbook --- .../Dex/Addressbook/AddAddressForm.qml | 223 ++++++++++++++++++ .../Dex/Addressbook/EditContactModal.qml | 168 +++++++++++++ atomic_defi_design/Dex/Addressbook/Main.qml | 186 ++++++++++++++- .../Dex/Addressbook/NewContactPopup.qml | 60 +++++ .../Dex/Components/Expandable.qml | 36 +++ .../Dex/Components/MultipageModalContent.qml | 1 + atomic_defi_design/Dex/Components/qmldir | 6 + .../Dex/Wallet/AddressBookNewContactModal.qml | 81 ------- src/app/app.hpp | 2 +- .../models/qt.addressbook.contact.model.cpp | 44 ++-- .../models/qt.addressbook.contact.model.hpp | 18 +- ...addressbook.contact.proxy.filter.model.hpp | 6 +- .../atomicdex/models/qt.addressbook.model.cpp | 4 +- .../atomicdex/models/qt.addressbook.model.hpp | 6 +- .../qt.addressbook.proxy.filter.model.hpp | 8 +- 15 files changed, 709 insertions(+), 140 deletions(-) create mode 100644 atomic_defi_design/Dex/Addressbook/AddAddressForm.qml create mode 100644 atomic_defi_design/Dex/Addressbook/EditContactModal.qml create mode 100644 atomic_defi_design/Dex/Addressbook/NewContactPopup.qml create mode 100644 atomic_defi_design/Dex/Components/Expandable.qml delete mode 100644 atomic_defi_design/Dex/Wallet/AddressBookNewContactModal.qml diff --git a/atomic_defi_design/Dex/Addressbook/AddAddressForm.qml b/atomic_defi_design/Dex/Addressbook/AddAddressForm.qml new file mode 100644 index 0000000000..afccc6b4ee --- /dev/null +++ b/atomic_defi_design/Dex/Addressbook/AddAddressForm.qml @@ -0,0 +1,223 @@ +import QtQuick 2.12 +import QtQuick.Layouts 1.15 +import QtQuick.Controls.Universal 2.15 //> Universal.accent + +import Qaterial 1.0 as Qaterial + +import Dex.Themes 1.0 as Dex +import Dex.Components 1.0 as Dex +import "../Constants" as Dex + +Dex.Rectangle +{ + property bool editionMode: false + property var contactModel + property var oldAddressModel // Used as a temp dump in edition mode + + signal cancel() + signal addressCreated() + + width: 500 + height: 302 + radius: 10 + + ColumnLayout + { + anchors.fill: parent + anchors.margins: 21 + spacing: 17 + + Dex.ComboBox + { + id: addressTypeComboBox + + property var currentItem: Dex.API.app.portfolio_pg.portfolio_mdl.portfolio_proxy_mdl.get(currentIndex) + + Layout.preferredWidth: 458 + Layout.preferredHeight: 44 + model: Dex.API.app.portfolio_pg.portfolio_mdl.portfolio_proxy_mdl + dropDownMaxHeight: 150 + textRole: "ticker" + + delegate: Qaterial.ItemDelegate + { + id: _delegate + + Universal.accent: Dex.CurrentTheme.comboBoxDropdownItemHighlightedColor + width: addressTypeComboBox.width + highlighted: addressTypeComboBox.highlightedIndex === index + + contentItem: Row + { + height: 36 + spacing: 10 + + Dex.Image + { + width: 25 + height: 25 + anchors.verticalCenter: parent.verticalCenter + source: Dex.General.coinIcon(ticker) + } + + Dex.Text + { + anchors.verticalCenter: parent.verticalCenter + text: name + } + + Dex.Text + { + anchors.verticalCenter: parent.verticalCenter + text: model.type + color: Dex.Style.getCoinTypeColor(model.type) + font: Dex.DexTypo.overLine + } + } + } + + contentItem: Item + { + Row + { + anchors.left: parent.left + anchors.leftMargin: 13 + anchors.verticalCenter: parent.verticalCenter + spacing: 10 + + Dex.Image + { + width: 25 + height: 25 + anchors.verticalCenter: parent.verticalCenter + source: Dex.General.coinIcon(addressTypeComboBox.currentItem.ticker) + } + + Dex.Text + { + anchors.verticalCenter: parent.verticalCenter + text: addressTypeComboBox.currentItem.name + } + + Dex.Text + { + anchors.verticalCenter: parent.verticalCenter + text: addressTypeComboBox.currentItem.type + color: Dex.Style.getCoinTypeColor(addressTypeComboBox.currentItem.type) + font: Dex.DexTypo.overLine + } + } + } + } + + Dex.TextField + { + id: addressKeyField + Layout.preferredWidth: 458 + Layout.preferredHeight: 44 + placeholderText: qsTr("Address key") + + Dex.ToolTip + { + id: addressKeyAlreadyExistsToolTip + contentItem: Dex.Text { text_value: qsTr("This key already exists.") } + } + } + + Dex.TextField + { + id: addressValueField + Layout.preferredWidth: 458 + Layout.preferredHeight: 44 + placeholderText: qsTr("Address field") + } + + Dex.Text + { + id: invalidAddressValueLabel + color: Dex.CurrentTheme.noColor + wrapMode: Dex.Text.Wrap + } + + RowLayout + { + Layout.topMargin: 10 + Layout.fillWidth: true + + Dex.Button + { + Layout.preferredWidth: 116 + Layout.preferredHeight: 38 + radius: 18 + text: qsTr("Cancel") + onClicked: cancel() + } + + Item { Layout.fillWidth: true } + + Dex.GradientButton + { + property bool isConvertMode: Dex.API.app.wallet_pg.validate_address_data.convertible + + enabled: addressKeyField.length > 0 && addressValueField.length > 0 && !Dex.API.app.wallet_pg.validate_address_busy + Layout.preferredWidth: 116 + Layout.preferredHeight: 38 + radius: 18 + text: isConvertMode ? qsTr("Convert") : qsTr("Add") + onClicked: + { + if (isConvertMode) + Dex.API.app.wallet_pg.convert_address(addressValueField.text, addressTypeComboBox.currentText, API.app.wallet_pg.validate_address_data.to_address_format); + else + Dex.API.app.wallet_pg.validate_address(addressValueField.text, addressTypeComboBox.currentText) + } + } + } + } + + Connections + { + target: Dex.API.app.wallet_pg + + function onConvertAddressBusyChanged() + { + if (Dex.API.app.wallet_pg.convert_address_busy) // Currently converting entered address + { + return; + } + + addressValueField.text = API.app.wallet_pg.converted_address + API.app.wallet_pg.validate_address_data = {} + invalidAddressValueLabel.text = "" + } + + function onValidateAddressBusyChanged() + { + if (Dex.API.app.wallet_pg.validate_address_busy) // Currently checking entered address + { + return + } + + if (!Dex.API.app.wallet_pg.validate_address_data.is_valid) // Entered address is invalid. + { + invalidAddressValueLabel.text = Dex.API.app.wallet_pg.validate_address_data.reason + return + } + + if (editionMode) // Removes old address entry before if we are in edition mode. + { + contactModel.removeAddressEntry(oldWalletType, oldKey); + } + + var createAddressResult = contactModel.addAddressEntry(addressTypeComboBox.currentText, addressKeyField.text, addressValueField.text); + if (createAddressResult === true) + { + addressCreated() + } + else + { + addressKeyAlreadyExistsToolTip.visible = true + } + } + } +} diff --git a/atomic_defi_design/Dex/Addressbook/EditContactModal.qml b/atomic_defi_design/Dex/Addressbook/EditContactModal.qml new file mode 100644 index 0000000000..40a3fcd43f --- /dev/null +++ b/atomic_defi_design/Dex/Addressbook/EditContactModal.qml @@ -0,0 +1,168 @@ +import QtQuick 2.12 +import QtQuick.Layouts 1.15 + +import Dex.Themes 1.0 as Dex +import Dex.Components 1.0 as Dex +import "../Constants" as Dex + +Dex.MultipageModal +{ + id: root + + property var contactModel: { "name": "", "categories": [] } + + Dex.MultipageModalContent + { + titleText: qsTr("Edit contact") + titleTopMargin: 0 + titleAlignment: Qt.AlignHCenter + contentSpacing: 24 + + Dex.TextFieldWithTitle + { + id: contactNameInput + title: qsTr("Contact name") + field.placeholderText: qsTr("Enter a contact name") + field.text: contactModel.name + field.onTextChanged: if (field.text.length > 30) field.text = field.text.substring(0, 30) + } + + Column + { + id: addressList + property bool contactAddAddressMode: false + + Layout.fillWidth: true + spacing: 18 + + Dex.Text + { + text: qsTr("Address list") + } + + Dex.ListView + { + visible: !addressList.contactAddAddressMode + model: contactModel.proxyFilter + spacing: 20 + height: contentHeight > 380 ? 380 : contentHeight + width: parent.width + + delegate: ColumnLayout + { + property var coinInfo: Dex.API.app.portfolio_pg.global_cfg_mdl.get_coin_info(address_type) + + Row + { + spacing: 10 + Dex.Image + { + anchors.verticalCenter: parent.verticalCenter + width: 25 + height: 25 + source: Dex.General.coinIcon(parent.parent.coinInfo.ticker) + } + + Dex.Text + { + anchors.verticalCenter: parent.verticalCenter + text: address_type + } + + Dex.Text + { + anchors.verticalCenter: parent.verticalCenter + text: parent.parent.coinInfo.type + color: Dex.Style.getCoinTypeColor(parent.parent.coinInfo.type) + font: Dex.DexTypo.overLine + } + } + + Dex.Text + { + Layout.leftMargin: 30 + text: "%1 : %2".arg(address_key).arg(address_value) + } + } + } + + Dex.Button + { + visible: !addressList.contactAddAddressMode + anchors.horizontalCenter: parent.horizontalCenter + text: qsTr("+ Add") + width: 211 + height: 38 + radius: 18 + onClicked: addressList.contactAddAddressMode = true + } + + AddAddressForm + { + visible: addressList.contactAddAddressMode + contactModel: root.contactModel + onCancel: addressList.contactAddAddressMode = false + onAddressCreated: addressList.contactAddAddressMode = false + } + } + + Column + { + Layout.fillWidth: true + spacing: 12 + + Dex.Text + { + text: qsTr("Tags") + } + + Flow + { + Layout.fillWidth: true + + Repeater + { + model: contactModel.categories + + Dex.Button + { + + } + } + } + + Dex.ClickableText + { + text: qsTr("Add tag") + } + } + + footer: + [ + Dex.Button + { + Layout.preferredWidth: 199 + Layout.preferredHeight: 48 + radius: 18 + text: qsTr("Close") + onClicked: root.close() + }, + + Item { Layout.fillWidth: true }, + + Dex.GradientButton + { + Layout.preferredWidth: 199 + Layout.preferredHeight: 48 + radius: 18 + text: qsTr("Confirm") + onClicked: + { + contactModel.name = contactNameInput.field.text + contactModel.save() + root.close() + } + } + ] + } +} diff --git a/atomic_defi_design/Dex/Addressbook/Main.qml b/atomic_defi_design/Dex/Addressbook/Main.qml index 3f2f146f07..e72016ea69 100644 --- a/atomic_defi_design/Dex/Addressbook/Main.qml +++ b/atomic_defi_design/Dex/Addressbook/Main.qml @@ -4,18 +4,192 @@ import QtQuick.Layouts 1.15 // Project Imports import Dex.Components 1.0 as Dex +import "../Components" as Dex import Dex.Themes 1.0 as Dex +import "../Constants" as Dex -ColumnLayout +Item { - Row + ColumnLayout { - Layout.fillWidth: true - implicitHeight: childrenRect.height + anchors.fill: parent + anchors.margins: 30 - Dex.DefaultText + spacing: 32 + + Row + { + Layout.fillWidth: true + + Column + { + width: parent.width * 0.5 + spacing: 34 + + Dex.Text + { + text: qsTr("Address Book") + font: Dex.DexTypo.head5 + } + + Dex.SearchField + { + id: searchbar + + width: 206 + height: 42 + textField.placeholderText: qsTr("Search contact") + + textField.onTextChanged: addressbookPg.model.proxy.searchExp = textField.text + Component.onDestruction: addressbookPg.model.proxy.searchExp = "" + } + } + + Row + { + width: parent.width * 0.5 + layoutDirection: Qt.RightToLeft + + Dex.GradientButton + { + width: 213 + height: 48.51 + radius: 18 + text: qsTr("+ NEW CONTACT") + + onClicked: newContactPopup.open() + + NewContactPopup + { + id: newContactPopup + } + } + } + } + + // Contact table header + Row + { + Layout.fillWidth: true + Layout.topMargin: 30 + + Dex.Text + { + width: parent.width * 0.3 + text: qsTr("Name") + font: Dex.DexTypo.head8 + leftPadding: 18 + } + + Dex.Text + { + text: qsTr("Tags") + font: Dex.DexTypo.head8 + leftPadding: 18 + } + } + + Dex.DefaultListView + { + id: contactTable + + Layout.fillWidth: true + Layout.fillHeight: true + + model: Dex.API.app.addressbookPg.model.proxy + + delegate: Dex.Expandable + { + id: expandable + + padding: 12 + color: index % 2 === 0 ? Dex.CurrentTheme.innerBackgroundColor : Dex.CurrentTheme.backgroundColor + width: contactTable.width + + header: Row + { + height: 66 + width: expandable.width + spacing: 0 + + Row + { + width: parent.width * 0.3 + height: parent.height + spacing: 8 + + Dex.UserIcon + { + anchors.verticalCenter: parent.verticalCenter + } + + Dex.Text + { + anchors.verticalCenter: parent.verticalCenter + text: modelData.name + } + + Dex.Arrow + { + anchors.verticalCenter: parent.verticalCenter + up: expandable.isExpanded + } + } + + + Dex.Text + { + anchors.verticalCenter: parent.verticalCenter + width: parent.width * 0.57 + visible: modelData.categories.length === 0 + text: qsTr("No tags") + } + + Flow + { + width: parent.width * 0.57 + + Repeater + { + model: modelData.categories.slice(0, 6) + + delegate: Dex.Rectangle + { + width: 83 + height: 21 + } + } + } + + Row + { + spacing: 45 + anchors.verticalCenter: parent.verticalCenter + Dex.ClickableText + { + font: Dex.DexTypo.body2 + text: qsTr("Edit") + onClicked: + { + editContactLoader.item.contactModel = modelData + editContactLoader.item.open() + } + } + Dex.ClickableText + { + font: Dex.DexTypo.body2 + text: qsTr("Delete") + onClicked: Dex.API.app.addressbookPg.model.removeContact(modelData.name) + } + } + } + } + } + + Loader { - text: qsTr("Address Book") + id: editContactLoader + sourceComponent: EditContactModal { } } } } diff --git a/atomic_defi_design/Dex/Addressbook/NewContactPopup.qml b/atomic_defi_design/Dex/Addressbook/NewContactPopup.qml new file mode 100644 index 0000000000..a0b28278f6 --- /dev/null +++ b/atomic_defi_design/Dex/Addressbook/NewContactPopup.qml @@ -0,0 +1,60 @@ +// Qt Imports +import QtQuick 2.15 +import QtQuick.Layouts 1.15 + +// Project Imports +import "../Constants" +import Dex.Components 1.0 as Dex + +Dex.Popup +{ + id: root + + width: 250 + height: 55 + + onClosed: nameField.text = "" + + contentItem: Row + { + spacing: 4 + + Dex.TextField + { + id: nameField + width: parent.width * 0.6 + height: parent.height + placeholderText: qsTr("Contact name") + + Dex.ToolTip + { + id: nameAlreadyTakenToolTip + visible: false + timeout: 3000 + contentItem: Dex.Text + { + text_value: qsTr("This contact name already exists.") + } + } + } + + Dex.Button + { + width: parent.width * 0.36 + height: parent.height + text: qsTr("+ ADD") + onClicked: + { + if (nameField.text.length === 0) + { + return + } + + var createContactResult = API.app.addressbookPg.model.addContact(nameField.text) + + if (createContactResult === false) nameAlreadyTakenToolTip.visible = true + else root.close() + } + } + } +} diff --git a/atomic_defi_design/Dex/Components/Expandable.qml b/atomic_defi_design/Dex/Components/Expandable.qml new file mode 100644 index 0000000000..96e5cb3795 --- /dev/null +++ b/atomic_defi_design/Dex/Components/Expandable.qml @@ -0,0 +1,36 @@ +import QtQuick 2.12 + +Rectangle +{ + id: root + + property bool isExpanded: false + property real padding: 10 + + property alias header: headerLoader.sourceComponent + property alias content: contentLoader.sourceComponent + + implicitHeight: padding + headerLoader.implicitHeight + contentLoader.implicitHeight + clip: true + + Loader + { + id: headerLoader + + anchors.top: parent.top + anchors.left: parent.left + anchors.margins: root.padding + } + + Loader + { + id: contentLoader + + visible: root.isExpanded + + anchors.top: headerLoader.bottom + anchors.bottom: parent.bottom + anchors.left: parent.left + anchors.margins: root.padding + } +} diff --git a/atomic_defi_design/Dex/Components/MultipageModalContent.qml b/atomic_defi_design/Dex/Components/MultipageModalContent.qml index 83de4fbc1d..adc2fb1760 100644 --- a/atomic_defi_design/Dex/Components/MultipageModalContent.qml +++ b/atomic_defi_design/Dex/Components/MultipageModalContent.qml @@ -17,6 +17,7 @@ ColumnLayout property int topMarginAfterTitle: 30 default property alias content: _innerLayout.data + property alias contentSpacing: _innerLayout.spacing property alias footer: _footer.data Layout.fillWidth: true diff --git a/atomic_defi_design/Dex/Components/qmldir b/atomic_defi_design/Dex/Components/qmldir index 915372c2e3..3c93e2fe34 100644 --- a/atomic_defi_design/Dex/Components/qmldir +++ b/atomic_defi_design/Dex/Components/qmldir @@ -1,12 +1,18 @@ module Dex.Components Button 1.0 DefaultButton.qml +ComboBox 1.0 DefaultComboBox.qml +ClickableText 1.0 ClickableText.qml GradientButton 1.0 GradientButton.qml Image 1.0 DefaultImage.qml +ListView 1.0 DefaultListView.qml +MultipageModal 1.0 MultipageModal.qml +MultipageModalContent 1.0 MultipageModalContent.qml Popup 1.0 DefaultPopup.qml Rectangle 1.0 DefaultRectangle.qml SearchField 1.0 SearchField.qml Text 1.0 DefaultText.qml TextField 1.0 DefaultTextField.qml +TextFieldWithTitle 1.0 TextFieldWithTitle.qml ToolTip 1.0 DefaultTooltip.qml UserIcon 1.0 UserIcon.qml diff --git a/atomic_defi_design/Dex/Wallet/AddressBookNewContactModal.qml b/atomic_defi_design/Dex/Wallet/AddressBookNewContactModal.qml deleted file mode 100644 index 4ecd0096c6..0000000000 --- a/atomic_defi_design/Dex/Wallet/AddressBookNewContactModal.qml +++ /dev/null @@ -1,81 +0,0 @@ -import QtQuick 2.15 -import QtQuick.Layouts 1.15 -import QtQuick.Controls 2.15 - -import "../Components" -import "../Constants" -import App 1.0 - -MultipageModal { - id: root - width: 500 - - MultipageModalContent { - Layout.topMargin: 5 - - titleText: qsTr("Create a new contact") - - // Contact name input. - DefaultTextField { - id: name_input - placeholderText: qsTr("Enter the contact name") - width: 150 - onTextChanged: { - const max_length = 50 - if(text.length > max_length) - text = text.substring(0, max_length) - } - - // Error tooltip when contact name already exists. - DefaultTooltip { - id: contact_alrady_exists_tooltip - visible: false - contentItem: DefaultText { - text_value: qsTr("This contact name already exists.") - } - } - } - - HorizontalLine { - Layout.fillWidth: true - color: Style.colorWhite8 - } - - // Footer - RowLayout { - Layout.alignment: Qt.AlignBottom | Qt.AlignRight - - // Validate button. - PrimaryButton { - text: qsTr("Confirm") - enabled: name_input.text.length > 0 - onClicked: { - if (name_input.text.length == 0) - { - return; - } - - var create_contact_result = API.app.addressbook_pg.model.add_contact(name_input.text.toString()); - - if (create_contact_result === false) - { - contact_alrady_exists_tooltip.visible = true; - } - else - { - root.close(); - } - } - } - - // Cancel button. - DefaultButton { - text: qsTr("Cancel") - - onClicked: root.close() - } - } - } - - onClosed: name_input.text = "" -} diff --git a/src/app/app.hpp b/src/app/app.hpp index 82c1b11af0..19ce6f2d8f 100644 --- a/src/app/app.hpp +++ b/src/app/app.hpp @@ -62,7 +62,7 @@ namespace atomic_dex Q_OBJECT //! Properties - Q_PROPERTY(addressbook_page* addressbook_pg READ get_addressbook_page NOTIFY addressbookPageChanged) + Q_PROPERTY(addressbook_page* addressbookPg READ get_addressbook_page NOTIFY addressbookPageChanged) Q_PROPERTY(orders_model* orders_mdl READ get_orders NOTIFY ordersChanged) Q_PROPERTY(portfolio_page_ptr portfolio_pg READ get_portfolio_page NOTIFY portfolioPageChanged) Q_PROPERTY(notification_manager* notification_mgr READ get_notification_manager) diff --git a/src/core/atomicdex/models/qt.addressbook.contact.model.cpp b/src/core/atomicdex/models/qt.addressbook.contact.model.cpp index 23965168a5..28e68d8318 100644 --- a/src/core/atomicdex/models/qt.addressbook.contact.model.cpp +++ b/src/core/atomicdex/models/qt.addressbook.contact.model.cpp @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2013-2021 The Komodo Platform Developers. * + * Copyright © 2013-2022 The Komodo Platform Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * @@ -14,13 +14,10 @@ * * ******************************************************************************/ -// STD #include -// Qt #include -// Project #include "atomicdex/pages/qt.portfolio.page.hpp" #include "atomicdex/utilities/qt.utilities.hpp" #include "atomicdex/managers/addressbook.manager.hpp" //> addressbook_manager @@ -48,8 +45,7 @@ namespace atomic_dex // QAbstractListModel Functions namespace atomic_dex { - QVariant - addressbook_contact_model::data(const QModelIndex& index, int role) const + QVariant addressbook_contact_model::data(const QModelIndex& index, int role) const { if (!hasIndex(index.row(), index.column(), index.parent())) { @@ -72,14 +68,12 @@ namespace atomic_dex } } - int - addressbook_contact_model::rowCount([[maybe_unused]] const QModelIndex& parent) const + int addressbook_contact_model::rowCount([[maybe_unused]] const QModelIndex& parent) const { return m_address_entries.size(); } - QHash - addressbook_contact_model::roleNames() const + QHash addressbook_contact_model::roleNames() const { return { {AddressTypeRole, "address_type"}, @@ -92,14 +86,12 @@ namespace atomic_dex // Getters/Setters namespace atomic_dex { - const QString& - addressbook_contact_model::get_name() const + const QString& addressbook_contact_model::get_name() const { return m_name; } - void - addressbook_contact_model::set_name(const QString& name) + void addressbook_contact_model::set_name(const QString& name) { auto& addrbook_manager = m_system_manager.get_system(); @@ -115,14 +107,12 @@ namespace atomic_dex } } - const QStringList& - addressbook_contact_model::get_categories() const + const QStringList& addressbook_contact_model::get_categories() const { return m_categories; } - void - addressbook_contact_model::set_categories(QStringList categories) + void addressbook_contact_model::set_categories(QStringList categories) { m_categories = std::move(categories); emit categoriesChanged(); @@ -142,8 +132,7 @@ namespace atomic_dex // QML API namespace atomic_dex { - bool - addressbook_contact_model::add_category(const QString& category) + bool addressbook_contact_model::addCategory(const QString& category) { if (m_categories.contains(category)) { @@ -154,15 +143,13 @@ namespace atomic_dex return true; } - void - addressbook_contact_model::remove_category(const QString& category) + void addressbook_contact_model::removeCategory(const QString& category) { m_categories.removeOne(category); emit categoriesChanged(); } - bool - addressbook_contact_model::add_address_entry(QString type, QString key, QString value) + bool addressbook_contact_model::addAddressEntry(QString type, QString key, QString value) { // Returns false if the given key already exists. auto res = match(index(0), AddressTypeAndKeyRole, type + key, 1, Qt::MatchFlag::MatchExactly); @@ -182,8 +169,7 @@ namespace atomic_dex return true; } - void - addressbook_contact_model::remove_address_entry(const QString& type, const QString& key) + void addressbook_contact_model::removeAddressEntry(const QString& type, const QString& key) { auto res = match(index(0), AddressTypeAndKeyRole, type + key, 1, Qt::MatchFlag::MatchExactly); @@ -195,8 +181,7 @@ namespace atomic_dex } } - void - addressbook_contact_model::reload() + void addressbook_contact_model::reload() { // Clears model clear(); @@ -205,8 +190,7 @@ namespace atomic_dex populate(); } - void - addressbook_contact_model::save() + void addressbook_contact_model::save() { auto& addrbook_manager = m_system_manager.get_system(); diff --git a/src/core/atomicdex/models/qt.addressbook.contact.model.hpp b/src/core/atomicdex/models/qt.addressbook.contact.model.hpp index 07525ebae8..e3538db725 100644 --- a/src/core/atomicdex/models/qt.addressbook.contact.model.hpp +++ b/src/core/atomicdex/models/qt.addressbook.contact.model.hpp @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2013-2021 The Komodo Platform Developers. * + * Copyright © 2013-2022 The Komodo Platform Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * @@ -16,11 +16,9 @@ #pragma once -// 3rdParty Headers #include //> ENTT_API #include //> ag::ecs::system_manager -// Project Headers #include "qt.addressbook.contact.proxy.filter.model.hpp" namespace atomic_dex @@ -72,17 +70,17 @@ namespace atomic_dex void clear(); // QML API - Q_INVOKABLE bool add_category(const QString& category) ; // Adds a category to the current contact. - Q_INVOKABLE void remove_category(const QString& category) ; // Removes a category from the current contact. - Q_INVOKABLE bool add_address_entry(QString type, QString key, QString value) ; // Adds an address entry to the current contact. Returns false if the key already exists in the given wallet type, false otherwise. - Q_INVOKABLE void remove_address_entry(const QString& type, const QString& key) ; // Removes an address entry from the current contact. - Q_INVOKABLE void reload(); // Reinitializes data from the persistent data ignoring pending changes. - Q_INVOKABLE void save(); // Saves the current contact pending changes in the persistent data. + Q_INVOKABLE bool addCategory(const QString& category); // Adds a category to the current contact. + Q_INVOKABLE void removeCategory(const QString& category); // Removes a category from the current contact. + Q_INVOKABLE bool addAddressEntry(QString type, QString key, QString value); // Adds an address entry to the current contact. Returns false if the key already exists in the given wallet type, false otherwise. + Q_INVOKABLE void removeAddressEntry(const QString& type, const QString& key); // Removes an address entry from the current contact. + Q_INVOKABLE void reload(); // Reinitializes data from the persistent data ignoring pending changes. + Q_INVOKABLE void save(); // Saves the current contact pending changes in the persistent data. // QML API Properties Q_PROPERTY(QString name READ get_name WRITE set_name NOTIFY nameChanged) Q_PROPERTY(QStringList categories READ get_categories WRITE set_categories NOTIFY categoriesChanged) - Q_PROPERTY(addressbook_contact_proxy_filter_model* proxy_filter READ get_proxy_filter NOTIFY proxyFilterChanged) + Q_PROPERTY(addressbook_contact_proxy_filter_model* proxyFilter READ get_proxy_filter NOTIFY proxyFilterChanged) // QML API Properties Signals signals: diff --git a/src/core/atomicdex/models/qt.addressbook.contact.proxy.filter.model.hpp b/src/core/atomicdex/models/qt.addressbook.contact.proxy.filter.model.hpp index 24aee8ddd8..21c4279889 100644 --- a/src/core/atomicdex/models/qt.addressbook.contact.proxy.filter.model.hpp +++ b/src/core/atomicdex/models/qt.addressbook.contact.proxy.filter.model.hpp @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2013-2021 The Komodo Platform Developers. * + * Copyright © 2013-2022 The Komodo Platform Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * @@ -49,8 +49,8 @@ namespace atomic_dex [[nodiscard]] bool lessThan(const QModelIndex& source_left, const QModelIndex& source_right) const final; // Sorts address entries by type then by key. // QML API Properties - Q_PROPERTY(QString search_expression READ get_search_expression WRITE set_search_expression NOTIFY searchExpressionChanged) - Q_PROPERTY(QString filter_type READ get_filter_type WRITE set_filter_type NOTIFY filterTypeChanged) + Q_PROPERTY(QString searchExpression READ get_search_expression WRITE set_search_expression NOTIFY searchExpressionChanged) + Q_PROPERTY(QString filterType READ get_filter_type WRITE set_filter_type NOTIFY filterTypeChanged) // QML API Properties Signals signals: diff --git a/src/core/atomicdex/models/qt.addressbook.model.cpp b/src/core/atomicdex/models/qt.addressbook.model.cpp index 6a4d73cade..ed372b198d 100644 --- a/src/core/atomicdex/models/qt.addressbook.model.cpp +++ b/src/core/atomicdex/models/qt.addressbook.model.cpp @@ -90,7 +90,7 @@ namespace atomic_dex } void - addressbook_model::remove_contact(const QString& name) + addressbook_model::removeContact(const QString& name) { auto& addrbook_manager = m_system_manager.get_system(); auto res = match(index(0), NameRole, name, 1, Qt::MatchFlag::MatchExactly); @@ -105,7 +105,7 @@ namespace atomic_dex } } - bool addressbook_model::add_contact(const QString& name) + bool addressbook_model::addContact(const QString& name) { auto& addrbook_manager = m_system_manager.get_system(); diff --git a/src/core/atomicdex/models/qt.addressbook.model.hpp b/src/core/atomicdex/models/qt.addressbook.model.hpp index 252e773f3a..309d82bcd2 100644 --- a/src/core/atomicdex/models/qt.addressbook.model.hpp +++ b/src/core/atomicdex/models/qt.addressbook.model.hpp @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2013-2021 The Komodo Platform Developers. * + * Copyright © 2013-2022 The Komodo Platform Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * @@ -68,8 +68,8 @@ namespace atomic_dex [[nodiscard]] addressbook_proxy_model* get_addressbook_proxy_mdl() const ; // QML API - Q_INVOKABLE bool add_contact(const QString& name); - Q_INVOKABLE void remove_contact(const QString& name); + Q_INVOKABLE bool addContact(const QString& name); + Q_INVOKABLE void removeContact(const QString& name); // QML API properties Q_PROPERTY(addressbook_proxy_model* proxy READ get_addressbook_proxy_mdl NOTIFY addressbookProxyChanged); diff --git a/src/core/atomicdex/models/qt.addressbook.proxy.filter.model.hpp b/src/core/atomicdex/models/qt.addressbook.proxy.filter.model.hpp index b2c59a5210..b7f3d2e01b 100644 --- a/src/core/atomicdex/models/qt.addressbook.proxy.filter.model.hpp +++ b/src/core/atomicdex/models/qt.addressbook.proxy.filter.model.hpp @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2013-2021 The Komodo Platform Developers. * + * Copyright © 2013-2022 The Komodo Platform Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * @@ -51,12 +51,12 @@ namespace atomic_dex void set_type_filter(QString value) ; // QML Properties - Q_PROPERTY(QString search_exp READ get_search_exp WRITE set_search_exp NOTIFY search_expChanged) - Q_PROPERTY(QString type_filter READ get_type_filter WRITE set_type_filter NOTIFY typeFilterChanged) + Q_PROPERTY(QString searchExp READ get_search_exp WRITE set_search_exp NOTIFY searchExpChanged) + Q_PROPERTY(QString typeFilter READ get_type_filter WRITE set_type_filter NOTIFY typeFilterChanged) // QML Properties Signals signals: - void search_expChanged(); + void searchExpChanged(); void typeFilterChanged(); }; } // namespace atomic_dex From e222b122f911692b174384bb5ca6c84cf887b370 Mon Sep 17 00:00:00 2001 From: smk762 Date: Thu, 28 Apr 2022 17:38:30 +0800 Subject: [PATCH 019/177] components default -> dex --- atomic_defi_design/Dex/Wallet/SendModal.qml | 38 ++++++++++----------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/atomic_defi_design/Dex/Wallet/SendModal.qml b/atomic_defi_design/Dex/Wallet/SendModal.qml index 62a1a61d63..3bbe22f1d6 100644 --- a/atomic_defi_design/Dex/Wallet/SendModal.qml +++ b/atomic_defi_design/Dex/Wallet/SendModal.qml @@ -272,7 +272,7 @@ MultipageModal property bool cryptoSendMode: true - DefaultRectangle + DexRectangle { enabled: !root.segwit && !root.is_send_busy @@ -284,7 +284,7 @@ MultipageModal color: input_address.background.color radius: input_address.background.radius - DefaultTextField + DexTextField { id: input_address @@ -307,7 +307,7 @@ MultipageModal color: addrbookIconMouseArea.containsMouse ? Dex.CurrentTheme.buttonColorHovered : "transparent" - DefaultMouseArea + DexMouseArea { id: addrbookIconMouseArea anchors.fill: parent @@ -316,7 +316,7 @@ MultipageModal } } - DefaultImage + DexImage { id: addrbookIcon anchors.right: parent.right @@ -342,7 +342,7 @@ MultipageModal Layout.alignment: Qt.AlignHCenter Layout.fillWidth: true - DefaultText + DexLabel { id: reason @@ -354,7 +354,7 @@ MultipageModal text_value: qsTr("The address has to be mixed case.") } - DefaultButton + DexButton { enabled: !root.is_send_busy visible: needFix @@ -393,7 +393,7 @@ MultipageModal } } - DefaultText + DexLabel { anchors.right: maxBut.left anchors.rightMargin: 10 @@ -403,7 +403,7 @@ MultipageModal font.pixelSize: 16 } - Rectangle + DexRectangle { id: maxBut anchors.right: parent.right @@ -414,13 +414,13 @@ MultipageModal radius: 7 color: maxButMouseArea.containsMouse ? Dex.CurrentTheme.buttonColorHovered : Dex.CurrentTheme.buttonColorEnabled - DefaultText + DexLabel { anchors.centerIn: parent text: qsTr("MAX") } - DefaultMouseArea + DexMouseArea { id: maxButMouseArea anchors.fill: parent @@ -448,7 +448,7 @@ MultipageModal Layout.alignment: Qt.AlignHCenter Layout.preferredWidth: 380 - DefaultText + DexLabel { id: equivalentAmount @@ -520,7 +520,7 @@ MultipageModal anchors.verticalCenter: parent.verticalCenter color: Dex.CurrentTheme.backgroundColor - DefaultText + DexLabel { id: fiat_symbol visible: _preparePage.cryptoSendMode && API.app.settings_pg.current_currency_sign != "KMD" @@ -529,7 +529,7 @@ MultipageModal text: API.app.settings_pg.current_currency_sign } - DefaultImage + DexImage { visible: !fiat_symbol.visible anchors.centerIn: parent @@ -539,7 +539,7 @@ MultipageModal } } - DefaultText + DexLabel { id: cryptoFiatSwitchText anchors.left: cryptoFiatSwitchIcon.right @@ -553,7 +553,7 @@ MultipageModal } } - DefaultMouseArea + DexMouseArea { id: cryptoFiatSwitchMouseArea anchors.fill: parent @@ -580,7 +580,7 @@ MultipageModal } // Custom fees warning - DefaultText + DexLabel { visible: custom_fees_switch.checked font.pixelSize: 14 @@ -646,7 +646,7 @@ MultipageModal } // Fee is higher than amount error - DefaultText + DexLabel { id: fee_error visible: feeIsHigherThanAmount() @@ -660,7 +660,7 @@ MultipageModal } // Not enough funds error - DefaultText + DexLabel { Layout.topMargin: 16 wrapMode: Text.Wrap @@ -679,7 +679,7 @@ MultipageModal Layout.alignment: Qt.AlignHCenter Layout.topMargin: 20 - DefaultButton + DexButton { text: qsTr("Close") From fc93fa4ca9efd6b82d543829974b12b5f1f6870f Mon Sep 17 00:00:00 2001 From: smk762 Date: Wed, 4 May 2022 08:21:26 +0800 Subject: [PATCH 020/177] flickable sizing in modal; prefer dex components --- .../Dex/Components/DefaultListView.qml | 31 +- .../Dex/Components/DefaultModal.qml | 4 +- .../Dex/Components/DefaultSweetComboBox.qml | 3 +- .../Dex/Components/DexModal.qml | 1 + .../Dex/Components/MultipageModalContent.qml | 15 +- .../ProView/TradingInfo/OrderLine.qml | 28 +- .../ProView/TradingInfo/OrderList.qml | 4 +- .../ProView/TradingInfo/OrderModal.qml | 416 +++++++----------- .../ProView/TradingInfo/OrdersPage.qml | 16 +- .../ProView/TradingInfo/SwapProgress.qml | 38 +- .../Dex/Exchange/Trade/ProView.qml | 2 +- .../Dex/Wallet/TransactionDetailsModal.qml | 1 + 12 files changed, 238 insertions(+), 321 deletions(-) diff --git a/atomic_defi_design/Dex/Components/DefaultListView.qml b/atomic_defi_design/Dex/Components/DefaultListView.qml index d723a2b199..107ae3076a 100644 --- a/atomic_defi_design/Dex/Components/DefaultListView.qml +++ b/atomic_defi_design/Dex/Components/DefaultListView.qml @@ -4,32 +4,5 @@ import QtQuick.Controls 2.15 import "../Constants" import App 1.0 -ListView -{ - id: root - - property bool scrollbar_visible: contentItem.childrenRect.height > height - readonly property double scrollbar_margin: scrollbar_visible ? 8 : 0 - property bool visibleBackground: true - - boundsBehavior: Flickable.StopAtBounds - ScrollBar.vertical: DefaultScrollBar - { - visibleBackground: root.visibleBackground - } - - implicitWidth: contentItem.childrenRect.width - implicitHeight: contentItem.childrenRect.height - - clip: true - - // Opacity animation - opacity: root.count === 0 ? 0 : enabled ? 1 : 0.2 - Behavior on opacity - { - SmoothedAnimation - { - duration: Style.animationDuration * 0.5;velocity: -1 - } - } -} +DexListView +{} diff --git a/atomic_defi_design/Dex/Components/DefaultModal.qml b/atomic_defi_design/Dex/Components/DefaultModal.qml index 1302c9e155..20a9c3b422 100644 --- a/atomic_defi_design/Dex/Components/DefaultModal.qml +++ b/atomic_defi_design/Dex/Components/DefaultModal.qml @@ -20,9 +20,9 @@ Popup closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside - background: DefaultRectangle { radius: root.radius; color: Dex.CurrentTheme.floatingBackgroundColor } + background: DexRectangle { radius: root.radius; color: Dex.CurrentTheme.floatingBackgroundColor } - Overlay.modal: Rectangle { color: "#AA000000" } + Overlay.modal: DexRectangle { color: "#AA000000" } // Fade in animation onVisibleChanged: diff --git a/atomic_defi_design/Dex/Components/DefaultSweetComboBox.qml b/atomic_defi_design/Dex/Components/DefaultSweetComboBox.qml index b09ae04093..b125969769 100644 --- a/atomic_defi_design/Dex/Components/DefaultSweetComboBox.qml +++ b/atomic_defi_design/Dex/Components/DefaultSweetComboBox.qml @@ -1,3 +1,4 @@ import QtQuick 2.15 -DexSweetComboBox { } \ No newline at end of file +DexSweetComboBox +{} \ No newline at end of file diff --git a/atomic_defi_design/Dex/Components/DexModal.qml b/atomic_defi_design/Dex/Components/DexModal.qml index d5d1781717..80707bc240 100644 --- a/atomic_defi_design/Dex/Components/DexModal.qml +++ b/atomic_defi_design/Dex/Components/DexModal.qml @@ -17,6 +17,7 @@ Popup { color: DexTheme.dexBoxBackgroundColor opacity: .3 } + background: ClipRRect { radius: 8 DexRectangle { diff --git a/atomic_defi_design/Dex/Components/MultipageModalContent.qml b/atomic_defi_design/Dex/Components/MultipageModalContent.qml index fe5ef551eb..d20146db30 100644 --- a/atomic_defi_design/Dex/Components/MultipageModalContent.qml +++ b/atomic_defi_design/Dex/Components/MultipageModalContent.qml @@ -18,6 +18,8 @@ ColumnLayout default property alias content: _innerLayout.data property alias footer: _footer.data + property alias header: _header.data + property var scrollable_height: window.height - _title.height - _header.height - _footer.height - titleTopMargin * 2 - topMarginAfterTitle - 180 Layout.fillWidth: true Layout.maximumHeight: window.height - 50 @@ -28,8 +30,18 @@ ColumnLayout Layout.topMargin: root.titleTopMargin Layout.alignment: root.titleAlignment font: DexTypo.head6 + visible: text != '' } + // Header + ColumnLayout + { + id: _header + Layout.topMargin: root.titleTopMargin + visible: childrenRect.height > 0 + } + + DexFlickable { flickableDirection: Flickable.VerticalFlick @@ -37,7 +49,7 @@ ColumnLayout Layout.topMargin: root.topMarginAfterTitle Layout.fillWidth: true Layout.preferredHeight: contentHeight - Layout.maximumHeight: window.height - 330 + Layout.maximumHeight: scrollable_height contentHeight: _innerLayout.height @@ -55,5 +67,6 @@ ColumnLayout id: _footer Layout.topMargin: Style.rowSpacing spacing: Style.buttonSpacing + visible: childrenRect.height > 0 } } diff --git a/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/OrderLine.qml b/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/OrderLine.qml index 7ecda52d5d..75e4b3e895 100644 --- a/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/OrderLine.qml +++ b/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/OrderLine.qml @@ -23,7 +23,7 @@ FloatingBackground color: mouse_area.containsMouse ? Dex.CurrentTheme.accentColor : Dex.CurrentTheme.floatingBackgroundColor radius: 0 - DefaultMouseArea + DexMouseArea { id: mouse_area anchors.fill: parent @@ -47,7 +47,7 @@ FloatingBackground Layout.preferredWidth: 24 Layout.alignment: Qt.AlignCenter - DefaultText + DexLabel { id: statusText anchors.centerIn: parent @@ -84,7 +84,7 @@ FloatingBackground clip: true - DefaultText + DexLabel { id: baseAmountLabel anchors.left: parent.left @@ -97,7 +97,7 @@ FloatingBackground maximumLineCount: 1 } - DefaultText + DexLabel { anchors.left: baseAmountLabel.right anchors.leftMargin: 3 @@ -120,7 +120,7 @@ FloatingBackground iconSize: 18 } - DefaultText + DexLabel { anchors.right: relAmountInCurrCurrency.left anchors.rightMargin: 3 @@ -133,7 +133,7 @@ FloatingBackground maximumLineCount: 1 } - DefaultText + DexLabel { id: relAmountInCurrCurrency @@ -153,7 +153,7 @@ FloatingBackground Layout.fillWidth: true Layout.preferredHeight: childrenRect.height - DefaultImage + DexImage { id: baseIcon @@ -166,7 +166,7 @@ FloatingBackground source: General.coinIcon(!details ? atomic_app_primary_coin : details.base_coin ?? atomic_app_primary_coin) } - DefaultText + DexLabel { anchors.left: baseIcon.right anchors.leftMargin: 2 @@ -180,7 +180,7 @@ FloatingBackground maximumLineCount: 1 } - DefaultText + DexLabel { visible: clickable @@ -194,7 +194,7 @@ FloatingBackground color: Dex.CurrentTheme.foregroundColor2 } - DefaultText + DexLabel { anchors.right: relCoin.left anchors.rightMargin: 2 @@ -208,7 +208,7 @@ FloatingBackground maximumLineCount: 1 } - DefaultImage + DexImage { id: relCoin @@ -229,7 +229,7 @@ FloatingBackground Layout.preferredWidth: 24 Layout.alignment: Qt.AlignCenter - DefaultText + DexLabel { anchors.centerIn: parent @@ -238,9 +238,9 @@ FloatingBackground text_value: Style.warningCharacter color: Style.colorYellow - DefaultTooltip + DexTooltip { - contentItem: DefaultText + contentItem: DexLabel { text_value: qsTr("Funds are recoverable") font.pixelSize: Style.textSizeSmall4 diff --git a/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/OrderList.qml b/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/OrderList.qml index 7a5a4aa007..58ab02b829 100644 --- a/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/OrderList.qml +++ b/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/OrderList.qml @@ -27,7 +27,7 @@ Item Layout.maximumWidth: 511 } - DefaultListView + DexListView { id: list @@ -102,7 +102,7 @@ Item } } - DefaultText + DexLabel { visible: list.count === 0 anchors.centerIn: parent diff --git a/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/OrderModal.qml b/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/OrderModal.qml index 2988649628..3ff9c8f7ca 100644 --- a/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/OrderModal.qml +++ b/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/OrderModal.qml @@ -14,6 +14,8 @@ MultipageModal id: root property var details + horizontalPadding: 60 + verticalPadding: 40 onDetailsChanged: { if (!details) root.close() } onOpened: @@ -26,288 +28,193 @@ MultipageModal MultipageModalContent { titleText: !details ? "" : details.is_swap ? qsTr("Swap Details") : qsTr("Order Details") + title.font.pixelSize: Style.textSize2 titleAlignment: Qt.AlignHCenter + titleTopMargin: 15 + topMarginAfterTitle: 15 + Layout.preferredHeight: window.height - 50 - // Complete image - DefaultImage - { - visible: !details ? false : details.is_swap && details.order_status === "successful" - Layout.alignment: Qt.AlignHCenter - source: General.image_path + "exchange-trade-complete.png" - } + header: [ + // Complete image + DexImage + { + visible: !details ? false : details.is_swap && details.order_status === "successful" + Layout.alignment: Qt.AlignHCenter + source: General.image_path + "exchange-trade-complete.png" + Layout.preferredHeight: 100 + }, - // Loading symbol - DefaultBusyIndicator - { - visible: !details ? false : details.is_swap && details.order_status !== "successful" - running: (!details ? false : - details.is_swap && - details.order_status !== "successful" && - details.order_status !== "failed") && Qt.platform.os != "osx" - Layout.alignment: Qt.AlignHCenter - } + // Loading symbol + DexBusyIndicator + { + visible: !details ? false : + details.is_swap && !["successful", "failed"].includes(details.order_status) + running: visible && Qt.platform.os != "osx" + Layout.alignment: Qt.AlignHCenter + Layout.preferredHeight: 100 + }, - // Status Text - DexLabel - { - id: statusText - Layout.alignment: Qt.AlignHCenter - Layout.topMargin: 5 - font.pixelSize: Style.textSize1 - font.bold: true - visible: !details ? false : details.is_swap || !details.is_maker - text_value: !details ? "" : visible ? getStatusText(details.order_status) : '' - } + RowLayout + { + Layout.topMargin: 15 + Layout.preferredHeight: 230 - DexLabel - { - Layout.alignment: Qt.AlignHCenter - visible: text_value != "" - font.pixelSize: Style.textSizeSmall2 - text_value: !details ? "" : details.order_status === "refunding" ? swapProgress.getRefundText() : "" - } + DexPairItemBadge + { + source: General.coinIcon(!details ? atomic_app_primary_coin : details.base_coin) + ticker: details ? details.base_coin : "" + fullname: details ? General.coinName(details.base_coin) : "" + amount: details ? details.base_amount : "" + } - RowLayout - { - Layout.topMargin: 22 + Qaterial.Icon + { + Layout.fillWidth: true + Layout.alignment: Qt.AlignVCenter - DefaultRectangle - { - Layout.preferredWidth: 226 - Layout.preferredHeight: 66 - radius: 10 + color: Dex.CurrentTheme.foregroundColor + icon: Qaterial.Icons.swapHorizontal + } - RowLayout + DexPairItemBadge { - anchors.fill: parent - anchors.margins: 14 - spacing: 23 - - DefaultImage - { - Layout.preferredWidth: 35 - Layout.preferredHeight: 35 - Layout.alignment: Qt.AlignVCenter - - source: General.coinIcon(!details ? atomic_app_primary_coin : details.base_coin) - } - - ColumnLayout - { - Layout.fillWidth: true - RowLayout - { - Layout.fillWidth: true - spacing: 5 - DexLabel - { - Layout.fillWidth: true - text: details ? details.base_coin : "" - } - - DexLabel - { - Layout.fillWidth: true - text: details ? General.coinName(details.base_coin) : "" - wrapMode: Text.NoWrap - elide: Text.ElideRight - font.pixelSize: 11 - } - } - - DexLabel - { - Layout.fillWidth: true - text: details ? details.base_amount : "" - font.pixelSize: 11 - wrapMode: Text.NoWrap - elide: Text.ElideRight - } - } + source: General.coinIcon(!details ? atomic_app_primary_coin : details.rel_coin) + ticker: details ? details.rel_coin : "" + fullname: details ? General.coinName(details.rel_coin) : "" + amount: details ? details.rel_amount : "" } - } - Qaterial.Icon - { - Layout.fillWidth: true - Layout.alignment: Qt.AlignVCenter - - color: Dex.CurrentTheme.foregroundColor - icon: Qaterial.Icons.swapHorizontal - } + }, - DefaultRectangle + // Status Text + DexLabel { - Layout.preferredWidth: 226 - Layout.preferredHeight: 66 - radius: 10 + id: statusText + Layout.alignment: Qt.AlignHCenter + Layout.topMargin: 5 + font.pixelSize: Style.textSizeMid1 + font.bold: true + visible: !details ? false : details.is_swap || !details.is_maker + text_value: !details ? "" : visible ? getStatusText(details.order_status) : '' + Layout.preferredHeight: 25 + }, - RowLayout - { - anchors.fill: parent - anchors.margins: 14 - spacing: 23 - - DefaultImage - { - Layout.preferredWidth: 35 - Layout.preferredHeight: 35 - Layout.alignment: Qt.AlignVCenter - - source: General.coinIcon(!details ? atomic_app_primary_coin : details.rel_coin) - } - - ColumnLayout - { - Layout.fillWidth: true - RowLayout - { - Layout.fillWidth: true - spacing: 5 - DexLabel - { - Layout.fillWidth: true - text: details ? details.rel_coin : "" - } - - DexLabel - { - Layout.fillWidth: true - text: details ? General.coinName(details.rel_coin) : "" - wrapMode: Text.NoWrap - elide: Text.ElideRight - font.pixelSize: 11 - } - } - - DexLabel - { - Layout.fillWidth: true - text: details ? details.rel_amount : "" - font.pixelSize: 11 - wrapMode: Text.NoWrap - elide: Text.ElideRight - } - } - } + DexLabel + { + Layout.alignment: Qt.AlignHCenter + visible: text_value != "" + font.pixelSize: Style.textSizeSmall2 + text_value: !details ? "" : details.order_status === "refunding" ? swapProgress.getRefundText() : "" + Layout.preferredHeight: 25 } - } + ] - DefaultScrollView + ColumnLayout { - Layout.topMargin: 20 + id: details_column Layout.fillWidth: true - Layout.preferredHeight: 300 + spacing: 12 - ScrollBar.horizontal.policy: ScrollBar.AlwaysOff - - ColumnLayout + // Maker/Taker + TextEditWithTitle { Layout.fillWidth: true - height: parent.height - 30 - spacing: 12 - - // Maker/Taker - TextEditWithTitle - { - Layout.fillWidth: true - title: qsTr("Order Type") - text: !details ? "" : details.is_maker ? qsTr("Maker Order") : qsTr("Taker Order") - label.font.pixelSize: 13 - } + title: qsTr("Order Type") + text: !details ? "" : details.is_maker ? qsTr("Maker Order") : qsTr("Taker Order") + label.font.pixelSize: 13 + } - // Refund state - TextEditWithTitle - { - Layout.fillWidth: true - title: qsTr("Refund State") - text: !details ? "" : details.order_status === "refunding" ? qsTr("Your swap failed but the auto-refund process for your payment started already. Please wait and keep application opened until you receive your payment back") : "" - label.font.pixelSize: 13 - visible: text !== '' - } + // Refund state + TextEditWithTitle + { + Layout.fillWidth: true + title: qsTr("Refund State") + text: !details ? "" : details.order_status === "refunding" ? qsTr("Your swap failed but the auto-refund process for your payment started already. Please wait and keep application opened until you receive your payment back") : "" + label.font.pixelSize: 13 + visible: text !== '' + } - // Date - TextEditWithTitle - { - Layout.fillWidth: true - title: qsTr("Date") - text: !details ? "" : details.date - label.font.pixelSize: 13 - visible: text !== '' - } + // Date + TextEditWithTitle + { + Layout.fillWidth: true + title: qsTr("Date") + text: !details ? "" : details.date + label.font.pixelSize: 13 + visible: text !== '' + } - // ID - TextEditWithTitle - { - Layout.fillWidth: true - title: qsTr("ID") - text: !details ? "" : details.order_id - label.font.pixelSize: 13 - visible: text !== '' - copy: true - privacy: true - } + // ID + TextEditWithTitle + { + Layout.fillWidth: true + title: qsTr("ID") + text: !details ? "" : details.order_id + label.font.pixelSize: 13 + visible: text !== '' + copy: true + privacy: true + } - // Payment ID - TextEditWithTitle - { - Layout.fillWidth: true - title: !details ? "" : details.is_maker ? qsTr("Maker Payment Sent ID") : qsTr("Maker Payment Spent ID") - text: !details ? "" : details.maker_payment_id - label.font.pixelSize: 12 - visible: text !== '' - copy: true - privacy: true - } + // Payment ID + TextEditWithTitle + { + Layout.fillWidth: true + title: !details ? "" : details.is_maker ? qsTr("Maker Payment Sent ID") : qsTr("Maker Payment Spent ID") + text: !details ? "" : details.maker_payment_id + label.font.pixelSize: 12 + visible: text !== '' + copy: true + privacy: true + } - // Payment ID - TextEditWithTitle - { - Layout.fillWidth: true - title: !details ? "" : details.is_maker ? qsTr("Taker Payment Spent ID") : qsTr("Taker Payment Sent ID") - text: !details ? "" : details.taker_payment_id - label.font.pixelSize: 12 - visible: text !== '' - copy: true - privacy: true - } + // Payment ID + TextEditWithTitle + { + Layout.fillWidth: true + title: !details ? "" : details.is_maker ? qsTr("Taker Payment Spent ID") : qsTr("Taker Payment Sent ID") + text: !details ? "" : details.taker_payment_id + label.font.pixelSize: 12 + visible: text !== '' + copy: true + privacy: true + } - // Error ID - TextEditWithTitle - { - Layout.fillWidth: true - title: qsTr("Error ID") - text: !details ? "" : details.order_error_state - label.font.pixelSize: 13 - visible: text !== '' - } + // Error ID + TextEditWithTitle + { + Layout.fillWidth: true + title: qsTr("Error ID") + text: !details ? "" : details.order_error_state + label.font.pixelSize: 13 + visible: text !== '' + } - // Error Details - TextEditWithTitle - { - Layout.fillWidth: true - title: qsTr("Error Log") - text: !details ? "" : details.order_error_message - label.font.pixelSize: 13 - visible: text !== '' - copy: true - onCopyNotificationTitle: qsTr("Error Log") - } + // Error Details + TextEditWithTitle + { + Layout.fillWidth: true + title: qsTr("Error Log") + text: !details ? "" : details.order_error_message + label.font.pixelSize: 13 + visible: text !== '' + copy: true + onCopyNotificationTitle: qsTr("Error Log") + } - HorizontalLine - { - visible: swapProgress.visible - Layout.fillWidth: true - Layout.topMargin: 10 - } + HorizontalLine + { + visible: swapProgress.visible + Layout.fillWidth: true + Layout.topMargin: 10 + } - SwapProgress - { - id: swapProgress - Layout.fillWidth: true - visible: General.exists(details) && details.order_status !== "matching" - details: root.details - } + SwapProgress + { + id: swapProgress + Layout.fillWidth: true + visible: General.exists(details) && details.order_status !== "matching" + details: root.details } } @@ -321,6 +228,8 @@ MultipageModal rightPadding: 20 radius: 18 onClicked: root.close() + Layout.preferredHeight: 50 + }, // Cancel button @@ -333,6 +242,7 @@ MultipageModal radius: 18 text: qsTr("Cancel Order") onClicked: cancelOrder(details.order_id) + Layout.preferredHeight: 50 }, Item @@ -353,6 +263,7 @@ MultipageModal details.recoverable && details.order_status !== "refunding" text: enabled ? qsTr("Recover Funds") : qsTr("Refunding...") onClicked: API.app.orders_mdl.recover_fund(details.order_id) + Layout.preferredHeight: 50 }, Item @@ -364,6 +275,7 @@ MultipageModal DexAppOutlineButton { text: qsTr("View on Explorer") + Layout.preferredHeight: 50 leftPadding: 20 rightPadding: 20 radius: 18 diff --git a/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/OrdersPage.qml b/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/OrdersPage.qml index ca3f99dc18..f055874ca0 100644 --- a/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/OrdersPage.qml +++ b/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/OrdersPage.qml @@ -90,7 +90,7 @@ Item { RowLayout { spacing: 10 - DefaultButton + DexButton { Layout.preferredWidth: 86 Layout.preferredHeight: 29 @@ -101,7 +101,7 @@ Item { onClicked: settings.visible = !settings.visible } - DefaultButton + DexButton { visible: root.is_history Layout.preferredWidth: 86 @@ -116,7 +116,7 @@ Item { } } - DefaultText + DexLabel { color: Dex.CurrentTheme.foregroundColor2 visible: !settings.visible @@ -133,7 +133,7 @@ Item { RowLayout { spacing: 10 - DefaultButton + DexButton { visible: root.is_history enabled: list_model_proxy.can_i_apply_filtering @@ -144,7 +144,7 @@ Item { text: qsTr("Apply Filter") onClicked: list_model_proxy.apply_all_filtering() } - DefaultButton + DexButton { visible: !root.is_history enabled: API.app.orders_mdl.length > 0 @@ -162,7 +162,7 @@ Item { { Layout.alignment: Qt.AlignHCenter - DefaultSweetComboBox + DexSweetComboBox { id: combo_base Layout.preferredWidth: parent.width / 2 - swapCoinFilterIcon.width @@ -179,7 +179,7 @@ Item { id: swapCoinFilterIcon source: Qaterial.Icons.swapHorizontal color: Dex.CurrentTheme.foregroundColor - DefaultMouseArea + DexMouseArea { id: swap_button anchors.fill: parent @@ -193,7 +193,7 @@ Item { } } - DefaultSweetComboBox + DexSweetComboBox { id: combo_rel Layout.fillWidth: true diff --git a/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/SwapProgress.qml b/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/SwapProgress.qml index 95a569e53b..08785d9be7 100644 --- a/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/SwapProgress.qml +++ b/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/SwapProgress.qml @@ -17,6 +17,7 @@ ColumnLayout readonly property var all_events: !details ? [] : has_error_event ? details.events.map(e => e.state) : details.success_events + // Is there error in swap json? readonly property bool has_error_event: { if (!details) return false @@ -30,7 +31,7 @@ ColumnLayout return false } - + // Total swaptime from sum of events duration readonly property double total_time_passed: { if (!details) return 0 @@ -44,6 +45,8 @@ ColumnLayout return sum } + + // Total swap duration estimate readonly property double total_time_passed_estimated: { const events = all_events @@ -55,6 +58,7 @@ ColumnLayout return sum } + // Current Event index readonly property int current_event_idx: { if (!details) return -1 @@ -112,27 +116,37 @@ ColumnLayout } // Simulated countdown time until refund unlocked - property double payment_lock_countdown_time: -1 - property double wait_until_countdown_time: -1 + property double payment_lock_countdown_time: -1 // First we wait for locktime expiry + property double wait_until_countdown_time: -1 // Then we count down to 'wait_until' time function updateCountdownTime() { - if (!details) { + console.log("current_event_idx: " + current_event_idx) + console.log("details: ") + console.log(details) + + if (current_event_idx !== -1 || !details) { payment_lock_countdown_time = -1 return } + const events = details.events + if (payment_lock_countdown_time == 0) { console.log(">payment_lock_countdown_time at zero " + details.order_id) - if (wait_until_countdown_time < 0) - { - if (details.events[current_event_idx - 1].hasOwnProperty('data')) + if (wait_until_countdown_time > 0) + { + console.log("current_event_idx: " + current_event_idx) + console.log("events: " + events) + if (events[current_event_idx - 1].hasOwnProperty('data')) { - if (details.events[current_event_idx - 1]['data'].hasOwnProperty('wait_until')) + console.log("event: " + events[current_event_idx - 1]) + console.log("event data: " + events[current_event_idx - 1]['data']) + if (events[current_event_idx - 1]['data'].hasOwnProperty('wait_until')) { console.log(">Date.now(): " + Date.now()) - console.log(">wait_until: " + details.events[current_event_idx - 1]['data']['wait_until'] * 1000) - const diff = details.events[current_event_idx - 1]['data']['wait_until'] * 1000 - Date.now() + console.log(">wait_until: " + events[current_event_idx - 1]['data']['wait_until'] * 1000) + const diff = events[current_event_idx - 1]['data']['wait_until'] * 1000 - Date.now() wait_until_countdown_time = diff - (diff % 1000) console.log(">wait_until_countdown_time: " + wait_until_countdown_time) if (wait_until_countdown_time <= 0) @@ -143,6 +157,7 @@ ColumnLayout } } } + else if (details.hasOwnProperty('payment_lock')) { const diff = details.payment_lock - Date.now() @@ -152,6 +167,7 @@ ColumnLayout payment_lock_countdown_time = 0 } } + else { payment_lock_countdown_time = -1 @@ -160,7 +176,7 @@ ColumnLayout Timer { - running: details.order_status + running: current_event_idx !== -1 interval: 1000 repeat: true onTriggered: updateCountdownTime() diff --git a/atomic_defi_design/Dex/Exchange/Trade/ProView.qml b/atomic_defi_design/Dex/Exchange/Trade/ProView.qml index 95fb4b98e5..60e7fcb59d 100644 --- a/atomic_defi_design/Dex/Exchange/Trade/ProView.qml +++ b/atomic_defi_design/Dex/Exchange/Trade/ProView.qml @@ -150,7 +150,7 @@ RowLayout Layout.minimumHeight: isCollapsed() ? 60 : 380 Layout.maximumHeight: chart.isCollapsed() ? -1 : 500 - Layout.fillHeight: !isCollapsed() + Layout.fillHeight: !isCollapsed() || !chart.pair_supported } } diff --git a/atomic_defi_design/Dex/Wallet/TransactionDetailsModal.qml b/atomic_defi_design/Dex/Wallet/TransactionDetailsModal.qml index f6e8e37855..e7aa9dfab3 100644 --- a/atomic_defi_design/Dex/Wallet/TransactionDetailsModal.qml +++ b/atomic_defi_design/Dex/Wallet/TransactionDetailsModal.qml @@ -27,6 +27,7 @@ MultipageModal MultipageModalContent { titleText: qsTr("Transaction Details") + Layout.preferredHeight: window.height - 50 // Amount TextEditWithTitle From 353c79624e0694649947a1cd79e91f519f50862d Mon Sep 17 00:00:00 2001 From: smk762 Date: Wed, 4 May 2022 17:48:09 +0800 Subject: [PATCH 021/177] busyindicator, scroll, footer buttons better alignment --- .../Dex/Components/DexBusyIndicator.qml | 30 ++++---- .../Dex/Components/DexPairItemBadge.qml | 73 +++++++++++++++++++ .../Dex/Components/DexScrollBarHorizontal.qml | 43 +++++++++++ .../Dex/Components/DexScrollView.qml | 23 ++++++ .../ProView/TradingInfo/OrderModal.qml | 67 +++++++++-------- .../ProView/TradingInfo/SwapProgress.qml | 5 +- atomic_defi_design/Dex/Wallet/Main.qml | 56 +++++++------- 7 files changed, 222 insertions(+), 75 deletions(-) create mode 100644 atomic_defi_design/Dex/Components/DexPairItemBadge.qml create mode 100644 atomic_defi_design/Dex/Components/DexScrollBarHorizontal.qml create mode 100644 atomic_defi_design/Dex/Components/DexScrollView.qml diff --git a/atomic_defi_design/Dex/Components/DexBusyIndicator.qml b/atomic_defi_design/Dex/Components/DexBusyIndicator.qml index 3dec670a33..875e3553ad 100644 --- a/atomic_defi_design/Dex/Components/DexBusyIndicator.qml +++ b/atomic_defi_design/Dex/Components/DexBusyIndicator.qml @@ -8,19 +8,21 @@ import App 1.0 BusyIndicator { id: control + property int indicator_size: 64 + property int indicator_dot_size: 10 contentItem: Item { - implicitWidth: 64 - implicitHeight: 64 + implicitWidth: indicator_size + implicitHeight: indicator_size Item { id: item - x: parent.width / 2 - 32 - y: parent.height / 2 - 32 - width: 64 - height: 64 + x: (parent.width - indicator_size) / 2 + y: (parent.height - indicator_size) / 2 + width: indicator_size + height: indicator_size opacity: control.running ? 1 : 0 Behavior on opacity @@ -48,22 +50,22 @@ BusyIndicator Rectangle { - x: item.width / 2 - width / 2 - y: item.height / 2 - height / 2 - implicitWidth: 10 - implicitHeight: 10 - radius: 5 + x: (item.width - width) / 2 + y: (item.height - height) / 2 + implicitWidth: indicator_dot_size + implicitHeight: indicator_dot_size + radius: indicator_dot_size / 2 color: Dex.CurrentTheme.busyIndicatorColor transform: [ Translate { - y: -Math.min(item.width, item.height) * 0.5 + 5 + y: -Math.min(item.width, item.height) * 0.5 + indicator_dot_size / 2 }, Rotation { angle: index / repeater.count * 360 - origin.x: 5 - origin.y: 5 + origin.x: indicator_dot_size / 2 + origin.y: indicator_dot_size / 2 } ] } diff --git a/atomic_defi_design/Dex/Components/DexPairItemBadge.qml b/atomic_defi_design/Dex/Components/DexPairItemBadge.qml new file mode 100644 index 0000000000..5f5077f44a --- /dev/null +++ b/atomic_defi_design/Dex/Components/DexPairItemBadge.qml @@ -0,0 +1,73 @@ +import QtQuick 2.15 +import QtQuick.Layouts 1.15 + +DexRectangle +{ + id: root + property alias source: icon.source + property alias ticker: ticker.text + property alias fullname: fullname.text + property alias amount: amount.text + + Layout.preferredWidth: 226 + Layout.preferredHeight: 66 + radius: 10 + + RowLayout + { + anchors.fill: parent + anchors.margins: 14 + spacing: 23 + + DexImage + { + id: icon + Layout.preferredWidth: 35 + Layout.preferredHeight: 35 + Layout.alignment: Qt.AlignVCenter + } + + ColumnLayout + { + Layout.fillWidth: true + RowLayout + { + Layout.fillWidth: true + spacing: 5 + + DexLabel + { + id: ticker + Layout.fillWidth: true + } + + DexLabel + { + id: fullname + Layout.fillWidth: true + wrapMode: Text.NoWrap + elide: Text.ElideRight + font.pixelSize: 11 + } + } + + DexLabel + { + id: amount + Layout.fillWidth: true + font.pixelSize: 11 + wrapMode: Text.NoWrap + elide: Text.ElideRight + } + + DexLabel + { + id: amount_fiat + Layout.fillWidth: true + font.pixelSize: 11 + wrapMode: Text.NoWrap + elide: Text.ElideRight + } + } + } +} \ No newline at end of file diff --git a/atomic_defi_design/Dex/Components/DexScrollBarHorizontal.qml b/atomic_defi_design/Dex/Components/DexScrollBarHorizontal.qml new file mode 100644 index 0000000000..858909ec33 --- /dev/null +++ b/atomic_defi_design/Dex/Components/DexScrollBarHorizontal.qml @@ -0,0 +1,43 @@ +import QtQuick 2.15 +import QtQuick.Controls 2.15 + +import App 1.0 +import Dex.Themes 1.0 as Dex + + +ScrollBar +{ + id: control + + anchors.bottom: root.bottom + anchors.bottomMargin: 0 + policy: scrollbar_visible ? ScrollBar.AlwaysOn : ScrollBar.AlwaysOff + property bool visibleBackground: true + width: 6 + + contentItem: Item + { + DexRectangle + { + width: parent.width + height: parent.height + anchors.horizontalCenter: parent.horizontalCenter + + color: Dex.CurrentTheme.scrollBarIndicatorColor + } + } + + background: Item + { + width: 6 + x: 0 + DexRectangle + { + visible: control.visibleBackground + width: parent.width + height: parent.height + anchors.horizontalCenter: parent.horizontalCenter + color: Dex.CurrentTheme.scrollBarBackgroundColor + } + } +} diff --git a/atomic_defi_design/Dex/Components/DexScrollView.qml b/atomic_defi_design/Dex/Components/DexScrollView.qml new file mode 100644 index 0000000000..286dccdf44 --- /dev/null +++ b/atomic_defi_design/Dex/Components/DexScrollView.qml @@ -0,0 +1,23 @@ +import QtQuick 2.15 +import QtQuick.Controls 2.15 + +import Dex.Themes 1.0 as Dex + +ScrollView +{ + id: control + property bool h_scrollbar_visible: contentItem.childrenRect.width > width + clip: true + + ScrollBar.vertical: DexScrollBar + { + property bool scrollbar_visible: contentItem.childrenRect.height > height + anchors.rightMargin: 3 + } + + ScrollBar.horizontal: DexScrollBar + { + property bool scrollbar_visible: h_scrollbar_visible + anchors.bottomMargin: 3 + } +} diff --git a/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/OrderModal.qml b/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/OrderModal.qml index 3ff9c8f7ca..a28516dbd3 100644 --- a/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/OrderModal.qml +++ b/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/OrderModal.qml @@ -221,40 +221,16 @@ MultipageModal // Buttons footer: [ - DexAppButton - { - text: qsTr("Close") - leftPadding: 20 - rightPadding: 20 - radius: 18 - onClicked: root.close() - Layout.preferredHeight: 50 - - }, - - // Cancel button - DexAppOutlineButton - { - id: cancelOrderButton - visible: !details ? false : details.cancellable - leftPadding: 20 - rightPadding: 20 - radius: 18 - text: qsTr("Cancel Order") - onClicked: cancelOrder(details.order_id) - Layout.preferredHeight: 50 - }, - Item { - visible: !cancelOrderButton.visible + visible: refund_button.visible || cancel_order_button.visible Layout.fillWidth: true }, // Recover Funds button DexAppButton { - id: refundButton + id: refund_button leftPadding: 20 rightPadding: 20 radius: 18 @@ -266,14 +242,24 @@ MultipageModal Layout.preferredHeight: 50 }, - Item + // Cancel button + DexAppOutlineButton { - visible: !refundButton.visible & !cancelOrderButton.visible - Layout.fillWidth: true + id: cancel_order_button + visible: !details ? false : details.cancellable + leftPadding: 20 + rightPadding: 20 + radius: 18 + text: qsTr("Cancel Order") + onClicked: cancelOrder(details.order_id) + Layout.preferredHeight: 50 }, + Item { Layout.fillWidth: true }, + DexAppOutlineButton { + id: explorer_button text: qsTr("View on Explorer") Layout.preferredHeight: 50 leftPadding: 20 @@ -290,6 +276,29 @@ MultipageModal if (maker_id !== '') General.viewTxAtExplorer(details.is_maker ? details.base_coin : details.rel_coin, maker_id) if (taker_id !== '') General.viewTxAtExplorer(details.is_maker ? details.rel_coin : details.base_coin, taker_id) } + }, + + Item + { + visible: close_order_button.visible && explorer_button.visible + Layout.fillWidth: true + }, + + DexAppButton + { + id: close_order_button + text: qsTr("Close") + leftPadding: 20 + rightPadding: 20 + radius: 18 + onClicked: root.close() + Layout.preferredHeight: 50 + }, + + Item + { + visible: close_order_button.visible || explorer_button.visible + Layout.fillWidth: true } ] } diff --git a/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/SwapProgress.qml b/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/SwapProgress.qml index 08785d9be7..333fd31cb2 100644 --- a/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/SwapProgress.qml +++ b/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/SwapProgress.qml @@ -121,8 +121,6 @@ ColumnLayout function updateCountdownTime() { console.log("current_event_idx: " + current_event_idx) - console.log("details: ") - console.log(details) if (current_event_idx !== -1 || !details) { payment_lock_countdown_time = -1 @@ -130,6 +128,9 @@ ColumnLayout } const events = details.events + console.log("events: ") + console.log(events) + console.log(JSON.parse(events)) if (payment_lock_countdown_time == 0) { diff --git a/atomic_defi_design/Dex/Wallet/Main.qml b/atomic_defi_design/Dex/Wallet/Main.qml index b90737aff1..acddf911c5 100644 --- a/atomic_defi_design/Dex/Wallet/Main.qml +++ b/atomic_defi_design/Dex/Wallet/Main.qml @@ -876,10 +876,35 @@ Item { anchors.centerIn: parent visible: current_ticker_infos.tx_state !== "InProgress" && transactions_mdl.length === 0 - text_value: api_wallet_page.tx_fetching_busy ? (qsTr("Refreshing") + "...") : qsTr("No transactions") + text_value: api_wallet_page.tx_fetching_busy ? '' : qsTr("No transactions") font.pixelSize: Style.textSize } + ColumnLayout + { + id: fetching_text_row + anchors.centerIn: parent + visible: api_wallet_page.tx_fetching_busy + + spacing: 20 + DefaultBusyIndicator + { + Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter + Layout.preferredWidth: Style.textSizeSmall3 + Layout.preferredHeight: Layout.preferredWidth + indicator_size: 32 + indicator_dot_size: 5 + } + + DefaultText + { + id: fetching_text + Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter + text_value: qsTr("Fetching transactions") + "..." + font.pixelSize: Style.textSize + } + } + Transactions { width: parent.width @@ -888,34 +913,5 @@ Item } } } - - RowLayout - { - id: fetching_text_row - visible: api_wallet_page.tx_fetching_busy - Layout.preferredHeight: fetching_text.font.pixelSize * 1.5 - - Layout.topMargin: -layout_margin*0.5 - Layout.bottomMargin: layout_margin*0.5 - - Layout.alignment: Qt.AlignHCenter - spacing: 10 - DefaultBusyIndicator - { - Layout.alignment: Qt.AlignVCenter - Layout.preferredWidth: Style.textSizeSmall3 - Layout.preferredHeight: Layout.preferredWidth - } - - DefaultText - { - id: fetching_text - Layout.alignment: Qt.AlignVCenter - text_value: qsTr("Fetching transactions") + "..." - font.pixelSize: Style.textSizeSmall3 - } - } - - implicitHeight: Math.min(contentItem.childrenRect.height, wallet.height*0.5) } } From d46e3c8aa209d94e0943ae9a989aa2eed93b9de0 Mon Sep 17 00:00:00 2001 From: smk762 Date: Thu, 5 May 2022 11:12:34 +0800 Subject: [PATCH 022/177] fix switch check --- .../Dex/Components/DexCheckBox.qml | 57 ++-- .../Dex/Components/DexSwitch.qml | 67 ++++- .../Dex/Components/EulaModal.qml | 2 + .../Dex/Components/MultipageModalContent.qml | 17 +- .../ProView/PlaceOrderForm/OrderForm.qml | 14 +- .../ProView/TradingInfo/OrderModal.qml | 1 - .../Dex/Exchange/Trade/ConfirmTradeModal.qml | 263 ++++++++++-------- .../Exchange/Trade/PriceLineSimplified.qml | 21 +- .../Dex/Portfolio/Portfolio.qml | 16 +- .../Dex/Screens/Startup/ImportWallet.qml | 12 +- .../Dex/Settings/AddCustomCoinModal.qml | 4 + .../Dex/Wallet/EnableCoinModal.qml | 129 ++++----- atomic_defi_design/Dex/Wallet/SendModal.qml | 40 +-- 13 files changed, 376 insertions(+), 267 deletions(-) diff --git a/atomic_defi_design/Dex/Components/DexCheckBox.qml b/atomic_defi_design/Dex/Components/DexCheckBox.qml index 8e801cdde9..65e87687f8 100644 --- a/atomic_defi_design/Dex/Components/DexCheckBox.qml +++ b/atomic_defi_design/Dex/Components/DexCheckBox.qml @@ -1,5 +1,6 @@ //! Qt Imports. import QtQuick 2.15 +import QtQuick.Layouts 1.15 import QtQuick.Controls 2.15 import QtQuick.Controls.Universal 2.15 @@ -12,39 +13,23 @@ CheckBox id: control property alias label: _label - property color textColor: Dex.CurrentTheme.foregroundColor - property alias boxWidth: _indicator.implicitWidth property alias boxHeight: _indicator.implicitHeight - property int labelWidth: control.width - boxWidth - - Universal.accent: Dex.CurrentTheme.accentColor - Universal.foreground: Dex.CurrentTheme.foregroundColor - Universal.background: Dex.CurrentTheme.backgroundColor + property alias mouseArea: mouse_area + property color textColor: Dex.CurrentTheme.foregroundColor + property int labelWidth: 120 font.family: Style.font_family - - contentItem: DefaultText - { - id: _label - width: labelWidth - text: control.text - font: control.font - color: control.textColor - horizontalAlignment: DexLabel.AlignLeft - verticalAlignment: DexLabel.AlignVCenter - leftPadding: control.indicator.width + control.spacing - wrapMode: Label.Wrap - } + Layout.preferredWidth: childrenRect.width + Layout.preferredHeight: childrenRect.height indicator: DexRectangle { id: _indicator + anchors.verticalCenter: control.verticalCenter implicitWidth: 26 implicitHeight: 26 - x: control.leftPadding - control.spacing - anchors.verticalCenter: control.verticalCenter radius: 20 gradient: Gradient @@ -58,16 +43,38 @@ CheckBox { visible: !control.checked anchors.centerIn: parent - implicitWidth: parent.width - 6 - implicitHeight: parent.height - 6 + width: parent.width - 6 + height: parent.height - 6 radius: parent.radius } opacity: enabled ? 1 : 0.5 } - DefaultMouseArea + contentItem: RowLayout + { + id: _content + Layout.alignment: Qt.AlignVCenter + Layout.preferredWidth: labelWidth + height: _label.height + spacing: 0 + + DexLabel + { + id: _label + text: control.text + font: control.font + color: control.textColor + Layout.alignment: Qt.AlignVCenter + verticalAlignment: Text.AlignVCenter + leftPadding: control.indicator.width + control.spacing + wrapMode: Label.Wrap + } + } + + DexMouseArea { + id: mouse_area anchors.fill: parent acceptedButtons: Qt.NoButton } diff --git a/atomic_defi_design/Dex/Components/DexSwitch.qml b/atomic_defi_design/Dex/Components/DexSwitch.qml index d3c0779f82..dd99fd8998 100644 --- a/atomic_defi_design/Dex/Components/DexSwitch.qml +++ b/atomic_defi_design/Dex/Components/DexSwitch.qml @@ -1,5 +1,6 @@ //! Qt Imports. import QtQuick 2.15 +import QtQuick.Layouts 1.15 import QtQuick.Controls 2.15 import QtQuick.Controls.Universal 2.15 @@ -12,22 +13,26 @@ Switch { id: control - property alias switchButtonWidth: indicator.width - property alias switchButtonHeight: indicator.height - property alias switchButtonRadius: indicator.radius + property alias label: _label + property alias switchButtonWidth: _indicator.width + property alias switchButtonHeight: _indicator.height + property alias switchButtonRadius: _indicator.radius property alias mouseArea: _mouseArea + property color textColor: Dex.CurrentTheme.foregroundColor + property int labelWidth: 120 - Universal.foreground: Dex.CurrentTheme.foregroundColor - Universal.background: Dex.CurrentTheme.backgroundColor + Layout.alignment: Qt.AlignVCenter + Layout.preferredWidth: childrenRect.width + Layout.preferredHeight: childrenRect.height font.family: DexTypo.fontFamily indicator: DexRectangle { - id: indicator - anchors.verticalCenter: parent.verticalCenter + id: _indicator width: 52 height: 28 radius: 13 + Layout.alignment: Qt.AlignVCenter gradient: Gradient { @@ -44,30 +49,35 @@ Switch Rectangle { + Layout.alignment: Qt.AlignVCenter visible: !control.checked - anchors.centerIn: parent width: parent.width - 4 height: parent.height - 4 radius: parent.radius + x: 2 + y: 2 gradient: Gradient { orientation: Gradient.Horizontal GradientStop { - position: 0;color: control.checked ? Dex.CurrentTheme.switchGradientStartColor : Dex.CurrentTheme.switchGradientStartColor2 + position: 0; + color: control.checked ? Dex.CurrentTheme.switchGradientStartColor : Dex.CurrentTheme.switchGradientStartColor2 } GradientStop { - position: 0.9311;color: control.checked ? Dex.CurrentTheme.switchGradientEndColor : Dex.CurrentTheme.switchGradientEndColor2 + position: 0.9311; + color: control.checked ? Dex.CurrentTheme.switchGradientEndColor : Dex.CurrentTheme.switchGradientEndColor2 } } } Rectangle { + Layout.alignment: Qt.AlignVCenter x: control.checked ? parent.width - width - 4 : 4 - anchors.verticalCenter: parent.verticalCenter + y: 3 width: parent.width / 2 - 2 height: parent.height - 6 radius: parent.radius + 2 @@ -77,20 +87,47 @@ Switch orientation: Gradient.Horizontal GradientStop { - position: 0;color: control.checked ? Dex.CurrentTheme.switchGradientStartColor2 : Dex.CurrentTheme.switchGradientStartColor + position: 0; + color: control.checked ? Dex.CurrentTheme.switchGradientStartColor2 : Dex.CurrentTheme.switchGradientStartColor } GradientStop { - position: 0.9311;color: control.checked ? Dex.CurrentTheme.switchGradientEndColor2 : Dex.CurrentTheme.switchGradientEndColor + position: 0.9311; + color: control.checked ? Dex.CurrentTheme.switchGradientEndColor2 : Dex.CurrentTheme.switchGradientEndColor } } } } - DefaultMouseArea + contentItem: DexRectangle + { + width: labelWidth + height: _indicator.height + Layout.alignment: Qt.AlignVCenter + visible: { + console.log(control.text) + control.text != '' + } + + DexLabel + { + id: _label + visible: control.text != '' + text_value: control.text + font: control.font + color: control.textColor + leftPadding: _indicator.width + control.spacing + horizontalAlignment: DexLabel.AlignLeft + verticalAlignment: DexLabel.AlignVCenter + Layout.alignment: Qt.AlignVCenter + wrapMode: Label.Wrap + } + } + + DexMouseArea { id: _mouseArea - anchors.fill: parent + anchors.fill: control acceptedButtons: Qt.NoButton } diff --git a/atomic_defi_design/Dex/Components/EulaModal.qml b/atomic_defi_design/Dex/Components/EulaModal.qml index d7461ea710..25855a1b3e 100644 --- a/atomic_defi_design/Dex/Components/EulaModal.qml +++ b/atomic_defi_design/Dex/Components/EulaModal.qml @@ -56,6 +56,7 @@ MultipageModal DexCheckBox { id: accept_eula + Layout.preferredWidth: parent.width visible: !close_only labelWidth: eula_rect.width - 80 text: qsTr("Accept EULA") @@ -64,6 +65,7 @@ MultipageModal DexCheckBox { id: accept_tac + Layout.preferredWidth: parent.width visible: !close_only labelWidth: eula_rect.width - 80 text: qsTr("Accept Terms and Conditions") diff --git a/atomic_defi_design/Dex/Components/MultipageModalContent.qml b/atomic_defi_design/Dex/Components/MultipageModalContent.qml index d20146db30..ef922b2786 100644 --- a/atomic_defi_design/Dex/Components/MultipageModalContent.qml +++ b/atomic_defi_design/Dex/Components/MultipageModalContent.qml @@ -15,15 +15,18 @@ ColumnLayout property var titleAlignment: Qt.AlignLeft property int titleTopMargin: 20 property int topMarginAfterTitle: 30 - - default property alias content: _innerLayout.data - property alias footer: _footer.data - property alias header: _header.data - property var scrollable_height: window.height - _title.height - _header.height - _footer.height - titleTopMargin * 2 - topMarginAfterTitle - 180 + property int scrollable_shrink: 180 + property alias flickable: modal_flickable + default property alias content: _innerLayout.data + property alias footer: _footer.data + property alias header: _header.data + property var scrollable_height: window.height - _title.height - _header.height - _footer.height - titleTopMargin * 2 - topMarginAfterTitle - scrollable_shrink Layout.fillWidth: true Layout.maximumHeight: window.height - 50 + visible: true + DexLabel { id: _title @@ -37,13 +40,15 @@ ColumnLayout ColumnLayout { id: _header + spacing: 10 Layout.topMargin: root.titleTopMargin + Layout.preferredHeight: childrenRect.height visible: childrenRect.height > 0 } - DexFlickable { + id: modal_flickable flickableDirection: Flickable.VerticalFlick Layout.topMargin: root.topMarginAfterTitle diff --git a/atomic_defi_design/Dex/Exchange/ProView/PlaceOrderForm/OrderForm.qml b/atomic_defi_design/Dex/Exchange/ProView/PlaceOrderForm/OrderForm.qml index 815d173264..9e25fc0ba1 100644 --- a/atomic_defi_design/Dex/Exchange/ProView/PlaceOrderForm/OrderForm.qml +++ b/atomic_defi_design/Dex/Exchange/ProView/PlaceOrderForm/OrderForm.qml @@ -195,14 +195,16 @@ ColumnLayout Layout.topMargin: 15 Layout.alignment: Qt.AlignHCenter - Layout.preferredWidth: parent.width - - boxWidth: 20.76 - boxHeight: 20.76 - labelWidth: parent.width - 40 + Layout.fillWidth: true + label.horizontalAlignment: Text.AlignLeft + label.verticalAlignment: Text.AlignVCenter + + boxWidth: 20 + boxHeight: 20 + labelWidth: 120 + label.wrapMode: Label.NoWrap text: qsTr("Use custom minimum trade amount") textColor: Dex.CurrentTheme.foregroundColor3 font.pixelSize: 13 - spacing: 3 } } diff --git a/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/OrderModal.qml b/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/OrderModal.qml index a28516dbd3..9f44bf4735 100644 --- a/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/OrderModal.qml +++ b/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/OrderModal.qml @@ -83,7 +83,6 @@ MultipageModal fullname: details ? General.coinName(details.rel_coin) : "" amount: details ? details.rel_amount : "" } - }, // Status Text diff --git a/atomic_defi_design/Dex/Exchange/Trade/ConfirmTradeModal.qml b/atomic_defi_design/Dex/Exchange/Trade/ConfirmTradeModal.qml index a8cd00f614..a030900901 100644 --- a/atomic_defi_design/Dex/Exchange/Trade/ConfirmTradeModal.qml +++ b/atomic_defi_design/Dex/Exchange/Trade/ConfirmTradeModal.qml @@ -1,6 +1,7 @@ import QtQuick 2.15 import QtQuick.Layouts 1.15 import QtQuick.Controls 2.15 +import Qaterial 1.0 as Qaterial import AtomicDEX.TradingError 1.0 import "../../Components" @@ -14,137 +15,194 @@ MultipageModal { id: root - width: 650 - - readonly property var fees: API.app.trading_pg.fees + horizontalPadding: 60 + verticalPadding: 40 MultipageModalContent { titleText: qsTr("Confirm Exchange Details") + title.font.pixelSize: Style.textSize2 + titleAlignment: Qt.AlignHCenter + titleTopMargin: 10 + topMarginAfterTitle: 0 + Layout.preferredHeight: window.height - 50 + + header: [ + RowLayout + { + id: dex_pair_badges - OrderContent - { - Layout.fillWidth: true - details: - ({ - base_coin: base_ticker, - rel_coin: rel_ticker, - base_amount: base_amount, - rel_amount: rel_amount, - order_id: '', - date: '', - }) - } + DexPairItemBadge + { + source: General.coinIcon(!base_ticker ? atomic_app_primary_coin : base_ticker) + ticker: base_ticker + fullname: General.coinName(base_ticker) + amount: base_amount + } - PriceLineSimplified { Layout.fillWidth: true } - - HorizontalLine - { - Layout.fillWidth: true - } + Qaterial.Icon + { + Layout.fillWidth: true + Layout.alignment: Qt.AlignVCenter - ColumnLayout - { - Layout.fillWidth: true + color: Dex.CurrentTheme.foregroundColor + icon: Qaterial.Icons.swapHorizontal + } - DefaultText + DexPairItemBadge + { + source: General.coinIcon(!rel_ticker ? atomic_app_primary_coin : rel_ticker) + ticker: rel_ticker + fullname: General.coinName(rel_ticker) + amount: rel_amount + } + }, + + PriceLineSimplified { - Layout.alignment: Qt.AlignLeft - text_value: qsTr("This swap request can not be undone and is a final event!") - } + id: price_line + Layout.fillWidth: true + }, - DefaultText + ColumnLayout { - Layout.alignment: Qt.AlignLeft - text_value: qsTr("This transaction can take up to 60 mins - DO NOT close this application!") - font.pixelSize: Style.textSizeSmall4 + id: warnings_text + Layout.fillWidth: true + Layout.alignment: Qt.AlignHCenter + + DexLabel + { + Layout.alignment: Qt.AlignHCenter + text_value: qsTr("This swap request can not be undone and is a final event!") + } + + DexLabel + { + Layout.alignment: Qt.AlignHCenter + text_value: qsTr("This transaction can take up to 60 mins - DO NOT close this application!") + font.pixelSize: Style.textSizeSmall4 + } } - } + ] - Item + ColumnLayout { - Layout.fillWidth: true + id: config_section + + readonly property var default_config: API.app.trading_pg.get_raw_mm2_coin_cfg(rel_ticker) + readonly property var fees: API.app.trading_pg.fees + readonly property bool is_dpow_configurable: config_section.default_config.requires_notarization || false + Layout.alignment: Qt.AlignHCenter - Layout.preferredHeight: fees_detail.height + 10 - opacity: .7 - Column + Layout.fillWidth: true + spacing: 10 + + Item { - id: fees_detail - anchors.verticalCenter: parent.verticalCenter - visible: fees.base_transaction_fees_ticker && !API.app.trading_pg.preimage_rpc_busy + Layout.fillWidth: true + Layout.alignment: Qt.AlignHCenter + Layout.preferredHeight: fees_detail.height + 10 + opacity: .7 + visible: { + console.log(config_section.fees) + config_section.fees + } - Repeater + Column { - model: fees.base_transaction_fees_ticker && !API.app.trading_pg.preimage_rpc_busy ? General.getFeesDetail(fees) : [] - delegate: DefaultText + id: fees_detail + anchors.verticalCenter: parent.verticalCenter + visible: config_section.base_transaction_fees_ticker && !API.app.trading_pg.preimage_rpc_busy + + Repeater { - font.pixelSize: Style.textSizeSmall1 - text: General.getFeesDetailText(modelData.label, modelData.fee, modelData.ticker) + model: config_section.fees.base_transaction_fees_ticker && !API.app.trading_pg.preimage_rpc_busy ? General.getFeesDetail(fees) : [] + delegate: DexLabel + { + font.pixelSize: Style.textSizeSmall1 + text: General.getFeesDetailText(modelData.label, modelData.fee, modelData.ticker) + } + anchors.horizontalCenter: parent.horizontalCenter } - anchors.horizontalCenter: parent.horizontalCenter - } - Item {width: 1; height: 10} - Repeater - { - model: fees.base_transaction_fees_ticker ? fees.total_fees : [] - delegate: DefaultText + + Item {width: 1; height: 10} + + Repeater { - text: General.getFeesDetailText( - qsTr("Total %1 fees:").arg(modelData.coin), - modelData.required_balance, - modelData.coin) + model: config_section.fees.base_transaction_fees_ticker ? config_section.fees.total_fees : [] + delegate: DexLabel + { + text: General.getFeesDetailText( + qsTr("Total %1 fees:").arg(modelData.coin), + modelData.required_balance, + modelData.coin) + } + anchors.horizontalCenter: parent.horizontalCenter } + Item {width: 1; height: 10} + } + + DexLabel + { + id: errors anchors.horizontalCenter: parent.horizontalCenter + width: parent.width + horizontalAlignment: DexLabel.AlignHCenter + font: DexTypo.caption + color: Dex.CurrentTheme.noColor + text_value: General.getTradingError( + last_trading_error, + curr_fee_info, + base_ticker, + rel_ticker, left_ticker, right_ticker) } - Item {width: 1; height: 10} - } - DefaultText - { - id: errors - anchors.horizontalCenter: parent.horizontalCenter - width: parent.width - horizontalAlignment: DefaultText.AlignHCenter - font: DexTypo.caption - color: Dex.CurrentTheme.noColor - text_value: General.getTradingError( - last_trading_error, - curr_fee_info, - base_ticker, - rel_ticker, left_ticker, right_ticker) } - } - ColumnLayout - { - id: config_section + RowLayout + { + spacing: 0 + Layout.topMargin: 10 + Layout.fillWidth: true + Layout.preferredHeight: 24 + Layout.alignment: Qt.AlignHCenter - readonly property var default_config: API.app.trading_pg.get_raw_mm2_coin_cfg(rel_ticker) + // Enable custom config + DexCheckBox + { + id: enable_custom_config - readonly property bool is_dpow_configurable: config_section.default_config.requires_notarization || false + spacing: 2 + boxWidth: 20 + boxHeight: 20 + labelWidth: parent.width - 40 + label.wrapMode: Label.NoWrap + label.horizontalAlignment: Text.AlignHCenter + label.verticalAlignment: Text.AlignVCenter - Layout.bottomMargin: 10 - Layout.alignment: Qt.AlignHCenter + text: qsTr("Use custom protection settings for incoming %1 transactions", "TICKER").arg(rel_ticker) + } + } ColumnLayout { Layout.alignment: Qt.AlignHCenter visible: !enable_custom_config.checked - DefaultText + DexLabel { Layout.alignment: Qt.AlignHCenter text_value: qsTr("Security configuration") font.weight: Font.Medium } - DefaultText + DexLabel { Layout.alignment: Qt.AlignHCenter text_value: "✅ " + (config_section.is_dpow_configurable ? qsTr("dPoW protected") : qsTr("%1 confirmations for incoming %2 transactions").arg(config_section.default_config.required_confirmations || 1).arg(rel_ticker)) } - DefaultText + DexLabel { visible: config_section.is_dpow_configurable Layout.alignment: Qt.AlignHCenter @@ -153,23 +211,6 @@ MultipageModal } } - // Enable custom config - DexCheckBox - { - Layout.alignment: Qt.AlignHCenter - Layout.fillWidth: true - Layout.maximumWidth: config_section.width - - id: enable_custom_config - - spacing: 2 - text: qsTr("Use custom protection settings for incoming %1 transactions", "TICKER").arg(rel_ticker) - labelWidth: 200 - boxWidth: 24 - boxHeight: 24 - label.horizontalAlignment: Text.AlignHCenter - } - // Configuration settings ColumnLayout { @@ -177,9 +218,10 @@ MultipageModal visible: enable_custom_config.checked Layout.alignment: Qt.AlignHCenter + Layout.fillWidth: true // dPoW configuration switch - DefaultSwitch + DexSwitch { id: enable_dpow_confs Layout.alignment: Qt.AlignHCenter @@ -189,7 +231,7 @@ MultipageModal text: qsTr("Enable Komodo dPoW security") } - DefaultText + DexLabel { visible: enable_dpow_confs.visible && enable_dpow_confs.enabled Layout.alignment: Qt.AlignHCenter @@ -211,7 +253,7 @@ MultipageModal Layout.fillWidth: true } - DefaultText + DexLabel { Layout.preferredHeight: 10 Layout.alignment: Qt.AlignHCenter @@ -240,10 +282,8 @@ MultipageModal visible: enable_custom_config.visible && enable_custom_config.enabled && enable_custom_config.checked && (config_section.is_dpow_configurable && !enable_dpow_confs.checked) Layout.alignment: Qt.AlignHCenter - Layout.bottomMargin: 10 color: Style.colorRed2 - width: dpow_off_warning.width + 20 height: dpow_off_warning.height + 20 @@ -252,25 +292,25 @@ MultipageModal id: dpow_off_warning anchors.centerIn: parent - DefaultText + DexLabel { Layout.alignment: Qt.AlignHCenter text_value: Style.warningCharacter + " " + qsTr("Warning, this atomic swap is not dPoW protected!") } } } - DefaultBusyIndicator + + DexBusyIndicator { visible: buy_sell_rpc_busy Layout.alignment: Qt.AlignCenter } } - HorizontalLine { Layout.fillWidth: true } - footer: [ Item { Layout.fillWidth: true }, + DexAppButton { text: qsTr("Cancel") @@ -280,7 +320,9 @@ MultipageModal radius: 10 onClicked: root.close() }, + Item { Layout.fillWidth: true }, + DexGradientAppButton { text: qsTr("Confirm") @@ -298,6 +340,7 @@ MultipageModal config_section.default_config) } }, + Item { Layout.fillWidth: true } ] } diff --git a/atomic_defi_design/Dex/Exchange/Trade/PriceLineSimplified.qml b/atomic_defi_design/Dex/Exchange/Trade/PriceLineSimplified.qml index 3dbe24e2d0..cfb41530bd 100644 --- a/atomic_defi_design/Dex/Exchange/Trade/PriceLineSimplified.qml +++ b/atomic_defi_design/Dex/Exchange/Trade/PriceLineSimplified.qml @@ -33,7 +33,7 @@ ColumnLayout spacing: 35 - DefaultText + DexLabel { visible: !price_entered && invalid_cex_price Layout.alignment: Qt.AlignHCenter @@ -48,14 +48,14 @@ ColumnLayout ColumnLayout { visible: price_entered - DefaultText + DexLabel { text_value: qsTr("Exchange rate") + (preffered_order.price !== undefined ? (" (" + qsTr("Selected") + ")") : "") font.pixelSize: fontSize } // Price reversed - DefaultText + DexLabel { text_value: General.formatCrypto("", "1", right_ticker) + " = " + General.formatCrypto("", price_reversed, left_ticker) font.pixelSize: fontSizeBigger @@ -63,7 +63,7 @@ ColumnLayout } // Price - DefaultText + DexLabel { text_value: General.formatCrypto("", price, right_ticker) + " = " + General.formatCrypto("", "1", left_ticker) font.pixelSize: fontSize @@ -76,7 +76,7 @@ ColumnLayout { visible: !invalid_cex_price - DefaultText + DexLabel { Layout.alignment: Qt.AlignRight text_value: General.cex_icon + " " + qsTr("CEXchange rate") @@ -86,7 +86,7 @@ ColumnLayout } // Price reversed - DefaultText + DexLabel { Layout.alignment: Qt.AlignRight text_value: General.formatCrypto("", "1", right_ticker) + " = " + General.formatCrypto("", cex_price_reversed, left_ticker) @@ -95,7 +95,7 @@ ColumnLayout } // Price - DefaultText + DexLabel { Layout.alignment: Qt.AlignRight text_value: General.formatCrypto("", cex_price, right_ticker) + " = " + General.formatCrypto("", "1", left_ticker) @@ -103,7 +103,6 @@ ColumnLayout } } } - // Price Comparison ColumnLayout @@ -132,7 +131,7 @@ ColumnLayout anchors.horizontalCenterOffset: 0.5 * parent.width * Math.min(Math.max(parseFloat(cex_price_diff) / line_scale, -1), 1) } - DefaultText + DexLabel { text_value: General.formatPercent(line_scale) font.pixelSize: fontSize @@ -140,7 +139,7 @@ ColumnLayout anchors.topMargin: -15 } - DefaultText + DexLabel { text_value: General.formatPercent(-line_scale) font.pixelSize: fontSize @@ -151,7 +150,7 @@ ColumnLayout } } - DefaultText + DexLabel { id: price_diff_text Layout.topMargin: 10 diff --git a/atomic_defi_design/Dex/Portfolio/Portfolio.qml b/atomic_defi_design/Dex/Portfolio/Portfolio.qml index 2b437fdeea..5d62c3e13d 100644 --- a/atomic_defi_design/Dex/Portfolio/Portfolio.qml +++ b/atomic_defi_design/Dex/Portfolio/Portfolio.qml @@ -226,6 +226,7 @@ Item { SearchField { + id: coin_search_field Layout.alignment: Qt.AlignVCenter Layout.preferredWidth: 206 Layout.preferredHeight: 42 @@ -242,11 +243,20 @@ Item { DexCheckBox { - Layout.alignment: Qt.AlignVCenter + id: hide_zero_balance_checkbox + + Layout.preferredWidth: 280 + Layout.alignment: Qt.AlignRight + + spacing: 2 + boxWidth: 24 + boxHeight: 24 + + label.wrapMode: Label.NoWrap + label.font.pixelSize: 14 text: qsTr("Show only coins with balance") + " %1".arg(qsTr("(%1/%2)").arg(coinsList.count).arg(portfolio_mdl.length)) textColor: Dex.CurrentTheme.foregroundColor2 - label.font.pixelSize: 14 - labelWidth: 200 + checked: portfolio_coins.with_balance onCheckedChanged: portfolio_coins.with_balance = checked Component.onDestruction: portfolio_coins.with_balance = false diff --git a/atomic_defi_design/Dex/Screens/Startup/ImportWallet.qml b/atomic_defi_design/Dex/Screens/Startup/ImportWallet.qml index 1177f81d5d..d5e174da69 100644 --- a/atomic_defi_design/Dex/Screens/Startup/ImportWallet.qml +++ b/atomic_defi_design/Dex/Screens/Startup/ImportWallet.qml @@ -207,11 +207,19 @@ SetupPage font: DexTypo.body2 } - DefaultCheckBox + DexCheckBox { id: allow_custom_seed + Layout.fillWidth: true + + boxWidth: 20 + boxHeight: 20 + leftPadding: 6 + labelWidth: 120 + label.wrapMode: Label.NoWrap + text: qsTr("Allow custom seed") - leftPadding: 15 + onToggled: { if (allow_custom_seed.checked) diff --git a/atomic_defi_design/Dex/Settings/AddCustomCoinModal.qml b/atomic_defi_design/Dex/Settings/AddCustomCoinModal.qml index eea04358cf..e2b9a01b3b 100644 --- a/atomic_defi_design/Dex/Settings/AddCustomCoinModal.qml +++ b/atomic_defi_design/Dex/Settings/AddCustomCoinModal.qml @@ -121,11 +121,13 @@ MultipageModal MultipageModalContent { titleText: qsTr("Choose the asset type") + height: 450 DexComboBox { id: input_type Layout.fillWidth: true + Layout.preferredHeight: 50 textRole: "text" valueRole: "text" model: type_model @@ -145,6 +147,7 @@ MultipageModal { text: qsTr("Cancel") Layout.preferredWidth: 220 + Layout.preferredHeight: 50 radius: 18 onClicked: root.previousPage() }, @@ -155,6 +158,7 @@ MultipageModal { text: qsTr("Next") Layout.preferredWidth: 220 + Layout.preferredHeight: 50 radius: 18 onClicked: { diff --git a/atomic_defi_design/Dex/Wallet/EnableCoinModal.qml b/atomic_defi_design/Dex/Wallet/EnableCoinModal.qml index ee696a516b..03954d055c 100644 --- a/atomic_defi_design/Dex/Wallet/EnableCoinModal.qml +++ b/atomic_defi_design/Dex/Wallet/EnableCoinModal.qml @@ -50,6 +50,8 @@ MultipageModal { titleText: qsTr("Enable assets") titleAlignment: Qt.AlignHCenter + titleTopMargin: 15 + topMarginAfterTitle: 15 // Search input SearchField @@ -66,7 +68,6 @@ MultipageModal textField.onTextChanged: filterCoins() } - RowLayout { spacing: 0 @@ -76,36 +77,21 @@ MultipageModal DexCheckBox { - Layout.leftMargin: 6 id: _selectAllCheckBox + Layout.fillWidth: true - visible: list.visible - checked: coin_cfg_model.checked_nb === setting_modal.enableable_coins_count - API.app.portfolio_pg.portfolio_mdl.length + spacing: 0 boxWidth: 20 boxHeight: 20 - width: 20 + labelWidth: parent.width - 40 + label.wrapMode: Label.NoWrap + label.leftPadding: 24 - DexMouseArea - { - anchors.fill: parent - onClicked: setCheckState(!_selectAllCheckBox.checked) - } - } - - DexLabel - { - Layout.fillWidth: true - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter text: qsTr("Select all assets") + visible: list.visible - DexMouseArea - { - anchors.fill: parent - onClicked: setCheckState(!_selectAllCheckBox.checked) - } + onToggled: root.setCheckState(checked) } - } HorizontalLine { Layout.topMargin: 5; Layout.alignment: Qt.AlignHCenter; Layout.fillWidth: true } @@ -126,17 +112,24 @@ MultipageModal height: 30 width: list.width - Row + RowLayout { + spacing: 0 + Layout.topMargin: 10 + Layout.fillWidth: true + Layout.preferredHeight: 24 + DexCheckBox { id: listInnerRowCheckbox readonly property bool backend_checked: model.checked - enabled: _selectAllCheckBox.checked ? checked : true + Layout.fillWidth: true + + spacing: 0 boxWidth: 20 boxHeight: 20 - spacing: 0 + labelWidth: parent.width - 40 onBackend_checkedChanged: if (checked !== backend_checked) checked = backend_checked onCheckStateChanged: @@ -150,55 +143,55 @@ MultipageModal } } } - } - RowLayout - { - anchors.verticalCenter: parent.verticalCenter - spacing: 0 - - // Icon - DexImage + contentItem: RowLayout { - id: icon - Layout.leftMargin: 8 Layout.alignment: Qt.AlignVCenter - source: General.coinIcon(model.ticker) - Layout.preferredWidth: 18 - Layout.preferredHeight: 18 - } + spacing: 0 - DexLabel - { - Layout.leftMargin: 4 - Layout.alignment: Qt.AlignVCenter - text: model.name + " (" + model.ticker + ")" - } + // Icon + DexImage + { + id: icon + Layout.leftMargin: 24 + Layout.alignment: Qt.AlignVCenter + source: General.coinIcon(model.ticker) + Layout.preferredWidth: 18 + Layout.preferredHeight: 18 + } - CoinTypeTag - { - id: typeTag - Layout.leftMargin: 6 - Layout.alignment: Qt.AlignVCenter - type: model.type - } + DexLabel + { + Layout.leftMargin: 4 + Layout.alignment: Qt.AlignVCenter + text: model.name + " (" + model.ticker + ")" + } - CoinTypeTag - { - Layout.leftMargin: 6 - Layout.alignment: Qt.AlignVCenter - enabled: General.isIDO(model.ticker) - visible: enabled - type: "IDO" - } + CoinTypeTag + { + id: typeTag + Layout.leftMargin: 6 + Layout.alignment: Qt.AlignVCenter + type: model.type + } - CoinTypeTag - { - Layout.leftMargin: 6 - Layout.alignment: Qt.AlignVCenter - enabled: API.app.portfolio_pg.global_cfg_mdl.get_coin_info(model.ticker).is_wallet_only - visible: enabled - type: "WALLET ONLY" + CoinTypeTag + { + Layout.leftMargin: 6 + Layout.alignment: Qt.AlignVCenter + enabled: General.isIDO(model.ticker) + visible: enabled + type: "IDO" + } + + CoinTypeTag + { + Layout.leftMargin: 6 + Layout.alignment: Qt.AlignVCenter + enabled: API.app.portfolio_pg.global_cfg_mdl.get_coin_info(model.ticker).is_wallet_only + visible: enabled + type: "WALLET ONLY" + } } } } diff --git a/atomic_defi_design/Dex/Wallet/SendModal.qml b/atomic_defi_design/Dex/Wallet/SendModal.qml index 225b2f5af4..ae2a673dd0 100644 --- a/atomic_defi_design/Dex/Wallet/SendModal.qml +++ b/atomic_defi_design/Dex/Wallet/SendModal.qml @@ -272,7 +272,7 @@ MultipageModal property bool cryptoSendMode: true - DefaultRectangle + DexRectangle { enabled: !root.segwit && !root.is_send_busy @@ -284,7 +284,7 @@ MultipageModal color: input_address.background.color radius: input_address.background.radius - DefaultTextField + DexTextField { id: input_address @@ -307,7 +307,7 @@ MultipageModal color: addrbookIconMouseArea.containsMouse ? Dex.CurrentTheme.buttonColorHovered : "transparent" - DefaultMouseArea + DexMouseArea { id: addrbookIconMouseArea anchors.fill: parent @@ -316,7 +316,7 @@ MultipageModal } } - DefaultImage + DexImage { id: addrbookIcon anchors.right: parent.right @@ -342,7 +342,7 @@ MultipageModal Layout.alignment: Qt.AlignHCenter Layout.fillWidth: true - DefaultText + DexLabel { id: reason @@ -354,7 +354,7 @@ MultipageModal text_value: qsTr("The address has to be mixed case.") } - DefaultButton + DexButton { enabled: !root.is_send_busy visible: needFix @@ -393,7 +393,7 @@ MultipageModal } } - DefaultText + DexLabel { anchors.right: maxBut.left anchors.rightMargin: 10 @@ -414,13 +414,13 @@ MultipageModal radius: 7 color: maxButMouseArea.containsMouse ? Dex.CurrentTheme.buttonColorHovered : Dex.CurrentTheme.buttonColorEnabled - DefaultText + DexLabel { anchors.centerIn: parent text: qsTr("MAX") } - DefaultMouseArea + DexMouseArea { id: maxButMouseArea anchors.fill: parent @@ -448,7 +448,7 @@ MultipageModal Layout.alignment: Qt.AlignHCenter Layout.preferredWidth: 380 - DefaultText + DexLabel { id: equivalentAmount @@ -520,7 +520,7 @@ MultipageModal anchors.verticalCenter: parent.verticalCenter color: Dex.CurrentTheme.backgroundColor - DefaultText + DexLabel { id: fiat_symbol visible: _preparePage.cryptoSendMode && API.app.settings_pg.current_currency_sign != "KMD" @@ -529,7 +529,7 @@ MultipageModal text: API.app.settings_pg.current_currency_sign } - DefaultImage + DexImage { visible: !fiat_symbol.visible anchors.centerIn: parent @@ -539,7 +539,7 @@ MultipageModal } } - DefaultText + DexLabel { id: cryptoFiatSwitchText anchors.left: cryptoFiatSwitchIcon.right @@ -553,7 +553,7 @@ MultipageModal } } - DefaultMouseArea + DexMouseArea { id: cryptoFiatSwitchMouseArea anchors.fill: parent @@ -580,7 +580,7 @@ MultipageModal } // Custom fees warning - DefaultText + DexLabel { visible: custom_fees_switch.checked font.pixelSize: 14 @@ -646,7 +646,7 @@ MultipageModal } // Fee is higher than amount error - DefaultText + DexLabel { id: fee_error visible: feeIsHigherThanAmount() @@ -660,7 +660,7 @@ MultipageModal } // Not enough funds error - DefaultText + DexLabel { Layout.topMargin: 16 wrapMode: Text.Wrap @@ -671,7 +671,7 @@ MultipageModal text_value: qsTr("Not enough funds.") + "\n" + qsTr("You have %1", "AMT TICKER").arg(General.formatCrypto("", API.app.get_balance(api_wallet_page.ticker), api_wallet_page.ticker)) } - DefaultBusyIndicator { visible: root.is_send_busy } + DexBusyIndicator { visible: root.is_send_busy } // Footer RowLayout @@ -679,7 +679,7 @@ MultipageModal Layout.alignment: Qt.AlignHCenter Layout.topMargin: 20 - DefaultButton + DexButton { text: qsTr("Close") @@ -782,7 +782,7 @@ MultipageModal send_result.withdraw_answer.date } - DefaultBusyIndicator + DexBusyIndicator { visible: root.is_broadcast_busy } From dd0d93e523c3116bc19318e57fc90f4029dd7047 Mon Sep 17 00:00:00 2001 From: smk762 Date: Fri, 6 May 2022 04:18:59 +0800 Subject: [PATCH 023/177] polish switch --- .../Dex/Components/DexSwitch.qml | 41 +-- .../Dex/Exchange/Trade/ConfirmTradeModal.qml | 288 +++++++++--------- atomic_defi_design/Dex/Sidebar/Bottom.qml | 5 +- atomic_defi_design/Dex/Wallet/SendModal.qml | 36 ++- 4 files changed, 195 insertions(+), 175 deletions(-) diff --git a/atomic_defi_design/Dex/Components/DexSwitch.qml b/atomic_defi_design/Dex/Components/DexSwitch.qml index dd99fd8998..281c25f900 100644 --- a/atomic_defi_design/Dex/Components/DexSwitch.qml +++ b/atomic_defi_design/Dex/Components/DexSwitch.qml @@ -19,11 +19,10 @@ Switch property alias switchButtonRadius: _indicator.radius property alias mouseArea: _mouseArea property color textColor: Dex.CurrentTheme.foregroundColor - property int labelWidth: 120 + property int labelWidth: label.text == '' ? 0 : 120 - Layout.alignment: Qt.AlignVCenter - Layout.preferredWidth: childrenRect.width - Layout.preferredHeight: childrenRect.height + width: labelWidth + 60 + height: 30 font.family: DexTypo.fontFamily indicator: DexRectangle @@ -32,24 +31,25 @@ Switch width: 52 height: 28 radius: 13 - Layout.alignment: Qt.AlignVCenter + anchors.verticalCenter: control.verticalCenter gradient: Gradient { orientation: Gradient.Horizontal GradientStop { - position: 0;color: Dex.CurrentTheme.switchGradientStartColor + position: 0 + color: Dex.CurrentTheme.switchGradientStartColor } GradientStop { - position: 0.9311;color: Dex.CurrentTheme.switchGradientEndColor + position: 0.9311 + color: Dex.CurrentTheme.switchGradientEndColor } } Rectangle { - Layout.alignment: Qt.AlignVCenter visible: !control.checked width: parent.width - 4 height: parent.height - 4 @@ -75,7 +75,6 @@ Switch Rectangle { - Layout.alignment: Qt.AlignVCenter x: control.checked ? parent.width - width - 4 : 4 y: 3 width: parent.width / 2 - 2 @@ -99,28 +98,31 @@ Switch } } - contentItem: DexRectangle + Item { - width: labelWidth - height: _indicator.height + Layout.preferredWidth: labelWidth + Layout.preferredHeight: _indicator.height Layout.alignment: Qt.AlignVCenter + anchors.verticalCenter: control.verticalCenter + visible: { - console.log(control.text) - control.text != '' + console.log(_label.text) + _label.text != '' } DexLabel { id: _label - visible: control.text != '' - text_value: control.text + Layout.fillHeight: true + font: control.font color: control.textColor leftPadding: _indicator.width + control.spacing - horizontalAlignment: DexLabel.AlignLeft - verticalAlignment: DexLabel.AlignVCenter - Layout.alignment: Qt.AlignVCenter + horizontalAlignment: Text.AlignLeft + verticalAlignment: Text.AlignVCenter + anchors.verticalCenter: parent.verticalCenter wrapMode: Label.Wrap + } } @@ -130,5 +132,4 @@ Switch anchors.fill: control acceptedButtons: Qt.NoButton } - } \ No newline at end of file diff --git a/atomic_defi_design/Dex/Exchange/Trade/ConfirmTradeModal.qml b/atomic_defi_design/Dex/Exchange/Trade/ConfirmTradeModal.qml index a030900901..9c89596319 100644 --- a/atomic_defi_design/Dex/Exchange/Trade/ConfirmTradeModal.qml +++ b/atomic_defi_design/Dex/Exchange/Trade/ConfirmTradeModal.qml @@ -14,6 +14,7 @@ import Dex.Themes 1.0 as Dex MultipageModal { id: root + readonly property var fees: API.app.trading_pg.fees horizontalPadding: 60 verticalPadding: 40 @@ -78,6 +79,7 @@ MultipageModal DexLabel { + id: warnings_tx_time_text Layout.alignment: Qt.AlignHCenter text_value: qsTr("This transaction can take up to 60 mins - DO NOT close this application!") font.pixelSize: Style.textSizeSmall4 @@ -90,46 +92,44 @@ MultipageModal id: config_section readonly property var default_config: API.app.trading_pg.get_raw_mm2_coin_cfg(rel_ticker) - readonly property var fees: API.app.trading_pg.fees readonly property bool is_dpow_configurable: config_section.default_config.requires_notarization || false - Layout.alignment: Qt.AlignHCenter - Layout.fillWidth: true + width: parent.width - 60 + Layout.alignment: Qt.AlignCenter + Layout.topMargin: 10 + spacing: 10 + // Fees Info Item { - Layout.fillWidth: true - Layout.alignment: Qt.AlignHCenter - Layout.preferredHeight: fees_detail.height + 10 - opacity: .7 + Layout.alignment: Qt.AlignCenter + Layout.preferredHeight: fees_detail.height + Layout.preferredWidth: parent.width - 80 visible: { - console.log(config_section.fees) - config_section.fees + console.log(API.app.trading_pg.preimage_rpc_busy) + console.log(root.fees.hasOwnProperty('base_transaction_fees_ticker')) + root.fees.hasOwnProperty('base_transaction_fees_ticker') && !API.app.trading_pg.preimage_rpc_busy } - Column + ColumnLayout { id: fees_detail - anchors.verticalCenter: parent.verticalCenter - visible: config_section.base_transaction_fees_ticker && !API.app.trading_pg.preimage_rpc_busy + spacing: 8 Repeater { - model: config_section.fees.base_transaction_fees_ticker && !API.app.trading_pg.preimage_rpc_busy ? General.getFeesDetail(fees) : [] + model: root.fees.hasOwnProperty('base_transaction_fees_ticker') && !API.app.trading_pg.preimage_rpc_busy ? General.getFeesDetail(root.fees) : [] delegate: DexLabel { font.pixelSize: Style.textSizeSmall1 text: General.getFeesDetailText(modelData.label, modelData.fee, modelData.ticker) } - anchors.horizontalCenter: parent.horizontalCenter } - Item {width: 1; height: 10} - Repeater { - model: config_section.fees.base_transaction_fees_ticker ? config_section.fees.total_fees : [] + model: root.fees.hasOwnProperty('base_transaction_fees_ticker') ? root.fees.total_fees : [] delegate: DexLabel { text: General.getFeesDetailText( @@ -137,165 +137,179 @@ MultipageModal modelData.required_balance, modelData.coin) } - anchors.horizontalCenter: parent.horizontalCenter + Layout.alignment: Qt.AlignHCenter } - Item {width: 1; height: 10} - } - DexLabel - { - id: errors - anchors.horizontalCenter: parent.horizontalCenter - width: parent.width - horizontalAlignment: DexLabel.AlignHCenter - font: DexTypo.caption - color: Dex.CurrentTheme.noColor - text_value: General.getTradingError( - last_trading_error, - curr_fee_info, - base_ticker, - rel_ticker, left_ticker, right_ticker) + DexLabel + { + id: errors + visible: text_value != '' + Layout.alignment: Qt.AlignHCenter + width: parent.width + horizontalAlignment: DexLabel.AlignHCenter + font: DexTypo.caption + color: Dex.CurrentTheme.noColor + text_value: General.getTradingError( + last_trading_error, + curr_fee_info, + base_ticker, + rel_ticker, left_ticker, right_ticker) + } } } - RowLayout - { - spacing: 0 - Layout.topMargin: 10 - Layout.fillWidth: true - Layout.preferredHeight: 24 - Layout.alignment: Qt.AlignHCenter + // Custom config checkbox + Item { + Layout.preferredHeight: use_custom.height + Layout.preferredWidth: use_custom.width + Layout.alignment: Qt.AlignCenter - // Enable custom config - DexCheckBox + ColumnLayout { - id: enable_custom_config + id: use_custom + spacing: 8 - spacing: 2 - boxWidth: 20 - boxHeight: 20 - labelWidth: parent.width - 40 - label.wrapMode: Label.NoWrap - label.horizontalAlignment: Text.AlignHCenter - label.verticalAlignment: Text.AlignVCenter - - text: qsTr("Use custom protection settings for incoming %1 transactions", "TICKER").arg(rel_ticker) - } - } + DexCheckBox + { + id: enable_custom_config + Layout.alignment: Qt.AlignCenter - ColumnLayout - { - Layout.alignment: Qt.AlignHCenter - visible: !enable_custom_config.checked + spacing: 2 + boxWidth: 20 + boxHeight: 20 + label.wrapMode: Label.NoWrap - DexLabel - { - Layout.alignment: Qt.AlignHCenter - text_value: qsTr("Security configuration") - font.weight: Font.Medium - } + text: qsTr("Use custom protection settings for incoming %1 transactions", "TICKER").arg(rel_ticker) + } - DexLabel - { - Layout.alignment: Qt.AlignHCenter - text_value: "✅ " + (config_section.is_dpow_configurable ? qsTr("dPoW protected") : - qsTr("%1 confirmations for incoming %2 transactions").arg(config_section.default_config.required_confirmations || 1).arg(rel_ticker)) - } + // Custom config settings + Item + { + Layout.preferredHeight: 30 + Layout.preferredWidth: 280 + Layout.alignment: Qt.AlignCenter + visible: enable_custom_config.checked && config_section.is_dpow_configurable - DexLabel - { - visible: config_section.is_dpow_configurable - Layout.alignment: Qt.AlignHCenter - text_value: General.cex_icon + ' ' + qsTr('Read more about dPoW') + '' - font.pixelSize: Style.textSizeSmall2 + DexSwitch + { + id: enable_dpow_confs + labelWidth: 220 + anchors.verticalCenter: parent.verticalCenter + label.wrapMode: Label.NoWrap + + checked: true + label.text: qsTr("Enable Komodo dPoW security") + mouseArea.hoverEnabled: true + } + } } } - // Configuration settings - ColumnLayout + // Custom Configuration settings + Item { - id: custom_config + Layout.preferredHeight: custom_config.height + Layout.preferredWidth: custom_config.width + Layout.alignment: Qt.AlignCenter visible: enable_custom_config.checked - Layout.alignment: Qt.AlignHCenter - Layout.fillWidth: true - - // dPoW configuration switch - DexSwitch - { - id: enable_dpow_confs - Layout.alignment: Qt.AlignHCenter - - visible: config_section.is_dpow_configurable - checked: true - text: qsTr("Enable Komodo dPoW security") - } - - DexLabel - { - visible: enable_dpow_confs.visible && enable_dpow_confs.enabled - Layout.alignment: Qt.AlignHCenter - text_value: General.cex_icon + ' ' + qsTr('Read more about dPoW') + '' - font.pixelSize: Style.textSizeSmall2 - } - - // Normal configuration settings ColumnLayout { - Layout.alignment: Qt.AlignHCenter - visible: !config_section.is_dpow_configurable || !enable_dpow_confs.checked - enabled: !config_section.is_dpow_configurable || !enable_dpow_confs.checked + id: custom_config + Layout.alignment: Qt.AlignCenter - HorizontalLine + // Normal configuration settings + ColumnLayout { - Layout.topMargin: 10 - Layout.bottomMargin: 10 Layout.fillWidth: true - } - - DexLabel - { - Layout.preferredHeight: 10 Layout.alignment: Qt.AlignHCenter - text_value: qsTr("Required Confirmations") + ": " + required_confirmation_count.value - color: DexTheme.foregroundColor - opacity: parent.enabled ? 1 : .6 + visible: !config_section.is_dpow_configurable || !enable_dpow_confs.checked + enabled: !config_section.is_dpow_configurable || !enable_dpow_confs.checked + spacing: 8 + + + DexLabel + { + Layout.preferredHeight: 10 + Layout.alignment: Qt.AlignHCenter + text_value: qsTr("Required Confirmations") + ": " + required_confirmation_count.value + color: DexTheme.foregroundColor + opacity: parent.enabled ? 1 : .6 + } + + DexSlider + { + id: required_confirmation_count + readonly property int default_confirmation_count: 3 + Layout.alignment: Qt.AlignHCenter + stepSize: 1 + from: 1 + to: 5 + live: true + snapMode: Slider.SnapAlways + value: default_confirmation_count + } } - DexSlider + FloatingBackground { - id: required_confirmation_count - readonly property int default_confirmation_count: 3 + visible: enable_custom_config.visible && enable_custom_config.enabled && enable_custom_config.checked && + (config_section.is_dpow_configurable && !enable_dpow_confs.checked) Layout.alignment: Qt.AlignHCenter - stepSize: 1 - from: 1 - to: 5 - live: true - snapMode: Slider.SnapAlways - value: default_confirmation_count + + color: Style.colorRed2 + width: dpow_off_warning.width + 20 + height: dpow_off_warning.height + 20 + + ColumnLayout + { + id: dpow_off_warning + anchors.centerIn: parent + + DexLabel + { + Layout.alignment: Qt.AlignHCenter + text_value: Style.warningCharacter + " " + qsTr("Warning, this atomic swap is not dPoW protected!") + } + } } } } - FloatingBackground - { - visible: enable_custom_config.visible && enable_custom_config.enabled && enable_custom_config.checked && - (config_section.is_dpow_configurable && !enable_dpow_confs.checked) - Layout.alignment: Qt.AlignHCenter - - color: Style.colorRed2 - width: dpow_off_warning.width + 20 - height: dpow_off_warning.height + 20 + // Custom config + Item { + Layout.preferredHeight: security_config.height + Layout.preferredWidth: security_config.width + Layout.alignment: Qt.AlignCenter + Layout.fillHeight: true ColumnLayout { - id: dpow_off_warning - anchors.centerIn: parent + id: security_config + spacing: 8 + + DexLabel + { + Layout.alignment: Qt.AlignCenter + visible: !enable_custom_config.checked + text_value: qsTr("Security configuration") + font.weight: Font.Medium + } DexLabel { + Layout.alignment: Qt.AlignCenter + horizontalAlignment: Text.AlignHCenter + visible: !enable_custom_config.checked + text_value: "✅ " + (config_section.is_dpow_configurable ? qsTr("dPoW protected") : + qsTr("%1 confirmations for incoming %2 transactions").arg(config_section.default_config.required_confirmations || 1).arg(rel_ticker)) + } + DexLabel + { + visible: config_section.is_dpow_configurable && enable_dpow_confs.enabled Layout.alignment: Qt.AlignHCenter - text_value: Style.warningCharacter + " " + qsTr("Warning, this atomic swap is not dPoW protected!") + text_value: General.cex_icon + ' ' + qsTr('Read more about dPoW') + '' + font.pixelSize: Style.textSizeSmall2 } } } diff --git a/atomic_defi_design/Dex/Sidebar/Bottom.qml b/atomic_defi_design/Dex/Sidebar/Bottom.qml index 9bf85ad420..dd4c104d81 100644 --- a/atomic_defi_design/Dex/Sidebar/Bottom.qml +++ b/atomic_defi_design/Dex/Sidebar/Bottom.qml @@ -80,6 +80,7 @@ MouseArea id: privacyLine Layout.fillWidth: true + Layout.preferredHeight: privacySwitch.height label.text: qsTr("Privacy") label.visible: isExpanded @@ -89,14 +90,14 @@ MouseArea privacySwitch.checked = General.privacy_mode; } - DefaultSwitch + DexSwitch { id: privacySwitch anchors.left: parent.left anchors.leftMargin: 10 anchors.verticalCenter: parent.verticalCenter - scale: 0.75 + scale: 0.60 mouseArea.hoverEnabled: true onClicked: parent.clicked() diff --git a/atomic_defi_design/Dex/Wallet/SendModal.qml b/atomic_defi_design/Dex/Wallet/SendModal.qml index ae2a673dd0..836c60649b 100644 --- a/atomic_defi_design/Dex/Wallet/SendModal.qml +++ b/atomic_defi_design/Dex/Wallet/SendModal.qml @@ -569,23 +569,27 @@ MultipageModal } } - // Custom fees switch - DexSwitch - { - id: custom_fees_switch - enabled: !root.is_send_busy - Layout.topMargin: 32 - text: qsTr("Enable Custom Fees") - onCheckedChanged: input_custom_fees.text = "" - } - - // Custom fees warning - DexLabel + ColumnLayout { - visible: custom_fees_switch.checked - font.pixelSize: 14 - color: Dex.CurrentTheme.noColor - text_value: qsTr("Only use custom fees if you know what you are doing!") + Layout.preferredWidth: 380 + Layout.alignment: Qt.AlignHCenter + // Custom fees switch + DexSwitch + { + id: custom_fees_switch + enabled: !root.is_send_busy + Layout.topMargin: 32 + label.text: qsTr("Enable Custom Fees") + onCheckedChanged: input_custom_fees.text = "" + } + // Custom fees warning + DexLabel + { + visible: custom_fees_switch.checked + font.pixelSize: 14 + color: Dex.CurrentTheme.noColor + text_value: qsTr("Only use custom fees if you know what you are doing!") + } } // Custom Fees section From d3d450cf393f4fe2a814a6f9992f7b19130ace8d Mon Sep 17 00:00:00 2001 From: smk762 Date: Fri, 6 May 2022 21:59:26 +0800 Subject: [PATCH 024/177] tweak some overflows --- .../Dex/Components/DexPairItemBadge.qml | 65 ++++++++++++------- .../Dex/Components/DexSwitch.qml | 5 +- .../Dex/Components/MultipageModalContent.qml | 10 +-- .../ProView/PlaceOrderForm/OrderForm.qml | 33 ++++++---- .../ProView/TradingInfo/OrderModal.qml | 28 ++++---- .../ProView/TradingInfo/SwapProgress.qml | 24 +++---- .../Dex/Exchange/Trade/ConfirmTradeModal.qml | 6 +- .../Exchange/Trade/PriceLineSimplified.qml | 13 ++-- .../Dex/Portfolio/Portfolio.qml | 8 +-- 9 files changed, 107 insertions(+), 85 deletions(-) diff --git a/atomic_defi_design/Dex/Components/DexPairItemBadge.qml b/atomic_defi_design/Dex/Components/DexPairItemBadge.qml index 5f5077f44a..8abd3df0e0 100644 --- a/atomic_defi_design/Dex/Components/DexPairItemBadge.qml +++ b/atomic_defi_design/Dex/Components/DexPairItemBadge.qml @@ -9,15 +9,19 @@ DexRectangle property alias fullname: fullname.text property alias amount: amount.text - Layout.preferredWidth: 226 + Layout.preferredWidth: 260 Layout.preferredHeight: 66 radius: 10 RowLayout { + Layout.fillWidth: true + Layout.fillHeight: true anchors.fill: parent - anchors.margins: 14 - spacing: 23 + anchors.margins: 15 + spacing: 8 + + Item { Layout.fillWidth: true } DexImage { @@ -27,28 +31,22 @@ DexRectangle Layout.alignment: Qt.AlignVCenter } + Item { Layout.fillWidth: true } + ColumnLayout { Layout.fillWidth: true - RowLayout + Layout.fillHeight: true + Layout.alignment: Qt.AlignVCenter + spacing: 5 + + DexLabel { + id: ticker Layout.fillWidth: true - spacing: 5 - - DexLabel - { - id: ticker - Layout.fillWidth: true - } - - DexLabel - { - id: fullname - Layout.fillWidth: true - wrapMode: Text.NoWrap - elide: Text.ElideRight - font.pixelSize: 11 - } + font.pixelSize: 11 + horizontalAlignment: Text.AlignLeft + wrapMode: Text.NoWrap } DexLabel @@ -56,18 +54,41 @@ DexRectangle id: amount Layout.fillWidth: true font.pixelSize: 11 - wrapMode: Text.NoWrap - elide: Text.ElideRight + horizontalAlignment: Text.AlignLeft + wrapMode: Text.WordWrap + } + } + + Item { Layout.fillWidth: true } + + ColumnLayout + { + Layout.fillWidth: true + Layout.fillHeight: true + Layout.alignment: Qt.AlignVCenter + spacing: 5 + + DexLabel + { + id: fullname + Layout.fillWidth: true + wrapMode: Text.WordWrap + horizontalAlignment: Text.AlignLeft + font.pixelSize: 11 } DexLabel { id: amount_fiat + visible: text != '' Layout.fillWidth: true font.pixelSize: 11 wrapMode: Text.NoWrap + horizontalAlignment: Text.AlignLeft elide: Text.ElideRight } } + + Item { Layout.fillWidth: true } } } \ No newline at end of file diff --git a/atomic_defi_design/Dex/Components/DexSwitch.qml b/atomic_defi_design/Dex/Components/DexSwitch.qml index 281c25f900..d0c124e8eb 100644 --- a/atomic_defi_design/Dex/Components/DexSwitch.qml +++ b/atomic_defi_design/Dex/Components/DexSwitch.qml @@ -105,10 +105,7 @@ Switch Layout.alignment: Qt.AlignVCenter anchors.verticalCenter: control.verticalCenter - visible: { - console.log(_label.text) - _label.text != '' - } + visible: _label.text != '' DexLabel { diff --git a/atomic_defi_design/Dex/Components/MultipageModalContent.qml b/atomic_defi_design/Dex/Components/MultipageModalContent.qml index ef922b2786..16a788b6a6 100644 --- a/atomic_defi_design/Dex/Components/MultipageModalContent.qml +++ b/atomic_defi_design/Dex/Components/MultipageModalContent.qml @@ -15,15 +15,15 @@ ColumnLayout property var titleAlignment: Qt.AlignLeft property int titleTopMargin: 20 property int topMarginAfterTitle: 30 - property int scrollable_shrink: 180 + property int scrollable_shrink: 0 property alias flickable: modal_flickable default property alias content: _innerLayout.data property alias footer: _footer.data property alias header: _header.data - property var scrollable_height: window.height - _title.height - _header.height - _footer.height - titleTopMargin * 2 - topMarginAfterTitle - scrollable_shrink + property var scrollable_height: window.height - _title.height - _header.height - _footer.height - titleTopMargin * 2 - topMarginAfterTitle - scrollable_shrink - 150 Layout.fillWidth: true - Layout.maximumHeight: window.height - 50 + Layout.maximumHeight: window.height - 150 visible: true @@ -37,12 +37,13 @@ ColumnLayout } // Header + ColumnLayout { id: _header spacing: 10 Layout.topMargin: root.titleTopMargin - Layout.preferredHeight: childrenRect.height + height: childrenRect.height visible: childrenRect.height > 0 } @@ -72,6 +73,7 @@ ColumnLayout id: _footer Layout.topMargin: Style.rowSpacing spacing: Style.buttonSpacing + height: childrenRect.height visible: childrenRect.height > 0 } } diff --git a/atomic_defi_design/Dex/Exchange/ProView/PlaceOrderForm/OrderForm.qml b/atomic_defi_design/Dex/Exchange/ProView/PlaceOrderForm/OrderForm.qml index 9e25fc0ba1..f512f2deb2 100644 --- a/atomic_defi_design/Dex/Exchange/ProView/PlaceOrderForm/OrderForm.qml +++ b/atomic_defi_design/Dex/Exchange/ProView/PlaceOrderForm/OrderForm.qml @@ -189,22 +189,27 @@ ColumnLayout second.onValueChanged: if (second.pressed) setVolume(General.formatDouble(second.value)) } - DexCheckBox + RowLayout { - id: _useCustomMinTradeAmountCheckbox - Layout.topMargin: 15 - Layout.alignment: Qt.AlignHCenter Layout.fillWidth: true - label.horizontalAlignment: Text.AlignLeft - label.verticalAlignment: Text.AlignVCenter - - boxWidth: 20 - boxHeight: 20 - labelWidth: 120 - label.wrapMode: Label.NoWrap - text: qsTr("Use custom minimum trade amount") - textColor: Dex.CurrentTheme.foregroundColor3 - font.pixelSize: 13 + DexCheckBox + { + id: _useCustomMinTradeAmountCheckbox + boxWidth: 20 + boxHeight: 20 + labelWidth: 0 + anchors.verticalCenter: parent.verticalCenter + } + + DexLabel { + Layout.fillWidth: true + horizontalAlignment: Text.AlignLeft + anchors.verticalCenter: parent.verticalCenter + wrapMode: Label.WordWrap + text: qsTr("Use custom minimum trade amount") + color: Dex.CurrentTheme.foregroundColor3 + font.pixelSize: 13 + } } } diff --git a/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/OrderModal.qml b/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/OrderModal.qml index 9f44bf4735..f644d5fe25 100644 --- a/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/OrderModal.qml +++ b/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/OrderModal.qml @@ -16,6 +16,7 @@ MultipageModal property var details horizontalPadding: 60 verticalPadding: 40 + width: 650 onDetailsChanged: { if (!details) root.close() } onOpened: @@ -32,6 +33,7 @@ MultipageModal titleAlignment: Qt.AlignHCenter titleTopMargin: 15 topMarginAfterTitle: 15 + Layout.preferredHeight: window.height - 50 header: [ @@ -41,7 +43,7 @@ MultipageModal visible: !details ? false : details.is_swap && details.order_status === "successful" Layout.alignment: Qt.AlignHCenter source: General.image_path + "exchange-trade-complete.png" - Layout.preferredHeight: 100 + height: 100 }, // Loading symbol @@ -51,13 +53,13 @@ MultipageModal details.is_swap && !["successful", "failed"].includes(details.order_status) running: visible && Qt.platform.os != "osx" Layout.alignment: Qt.AlignHCenter - Layout.preferredHeight: 100 + height: 100 }, RowLayout { Layout.topMargin: 15 - Layout.preferredHeight: 230 + height: 70 DexPairItemBadge { @@ -230,13 +232,14 @@ MultipageModal DexAppButton { id: refund_button - leftPadding: 20 - rightPadding: 20 + leftPadding: 15 + rightPadding: 15 radius: 18 enabled: !API.app.orders_mdl.recover_fund_busy visible: !details ? false : details.recoverable && details.order_status !== "refunding" text: enabled ? qsTr("Recover Funds") : qsTr("Refunding...") + font: DexTypo.body2 onClicked: API.app.orders_mdl.recover_fund(details.order_id) Layout.preferredHeight: 50 }, @@ -246,10 +249,11 @@ MultipageModal { id: cancel_order_button visible: !details ? false : details.cancellable - leftPadding: 20 - rightPadding: 20 + leftPadding: 15 + rightPadding: 15 radius: 18 text: qsTr("Cancel Order") + font: DexTypo.body2 onClicked: cancelOrder(details.order_id) Layout.preferredHeight: 50 }, @@ -260,9 +264,10 @@ MultipageModal { id: explorer_button text: qsTr("View on Explorer") + font: DexTypo.body2 Layout.preferredHeight: 50 - leftPadding: 20 - rightPadding: 20 + leftPadding: 15 + rightPadding: 15 radius: 18 visible: !details ? false : details.maker_payment_id !== '' || details.taker_payment_id !== '' onClicked: @@ -287,8 +292,9 @@ MultipageModal { id: close_order_button text: qsTr("Close") - leftPadding: 20 - rightPadding: 20 + font: DexTypo.body2 + leftPadding: 15 + rightPadding: 15 radius: 18 onClicked: root.close() Layout.preferredHeight: 50 diff --git a/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/SwapProgress.qml b/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/SwapProgress.qml index 333fd31cb2..d10ba4f500 100644 --- a/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/SwapProgress.qml +++ b/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/SwapProgress.qml @@ -11,8 +11,8 @@ ColumnLayout { id: root - property - var details + property var details + property var last_event readonly property var all_events: !details ? [] : has_error_event ? details.events.map(e => e.state) : details.success_events @@ -92,7 +92,7 @@ ColumnLayout return } - const last_event = events[events.length - 1] + last_event = events[events.length - 1] if (!last_event.timestamp) { simulated_time = 0 @@ -120,17 +120,12 @@ ColumnLayout property double wait_until_countdown_time: -1 // Then we count down to 'wait_until' time function updateCountdownTime() { - console.log("current_event_idx: " + current_event_idx) - - if (current_event_idx !== -1 || !details) { + if (current_event_idx == -1 || !details) { payment_lock_countdown_time = -1 return } const events = details.events - console.log("events: ") - console.log(events) - console.log(JSON.parse(events)) if (payment_lock_countdown_time == 0) { @@ -138,11 +133,8 @@ ColumnLayout if (wait_until_countdown_time > 0) { console.log("current_event_idx: " + current_event_idx) - console.log("events: " + events) if (events[current_event_idx - 1].hasOwnProperty('data')) { - console.log("event: " + events[current_event_idx - 1]) - console.log("event data: " + events[current_event_idx - 1]['data']) if (events[current_event_idx - 1]['data'].hasOwnProperty('wait_until')) { console.log(">Date.now(): " + Date.now()) @@ -166,6 +158,8 @@ ColumnLayout if (payment_lock_countdown_time <= 0) { payment_lock_countdown_time = 0 + const diff = events[current_event_idx - 1]['data']['wait_until'] * 1000 - Date.now() + wait_until_countdown_time = diff - (diff % 1000) } } @@ -199,8 +193,8 @@ ColumnLayout { return `` + qsTr(General.durationTextShort(payment_lock_countdown_time) + " until refund lock is released.") + `` } - else if (event) { - if (wait_until_countdown_time > 0 && event.state !== "Finished") { + else if (wait_until_countdown_time > 0) { + if (last_event.state !== "Finished") { return `` + qsTr(General.durationTextShort(wait_until_countdown_time) + " until refund completed.") + `` } } @@ -295,7 +289,7 @@ ColumnLayout { id: bar visible: is_active - width: 300 + width: root.width - 40 height: 2 color: DexTheme.foregroundColorDarkColor3 diff --git a/atomic_defi_design/Dex/Exchange/Trade/ConfirmTradeModal.qml b/atomic_defi_design/Dex/Exchange/Trade/ConfirmTradeModal.qml index 9c89596319..1ab9e9c943 100644 --- a/atomic_defi_design/Dex/Exchange/Trade/ConfirmTradeModal.qml +++ b/atomic_defi_design/Dex/Exchange/Trade/ConfirmTradeModal.qml @@ -106,11 +106,7 @@ MultipageModal Layout.alignment: Qt.AlignCenter Layout.preferredHeight: fees_detail.height Layout.preferredWidth: parent.width - 80 - visible: { - console.log(API.app.trading_pg.preimage_rpc_busy) - console.log(root.fees.hasOwnProperty('base_transaction_fees_ticker')) - root.fees.hasOwnProperty('base_transaction_fees_ticker') && !API.app.trading_pg.preimage_rpc_busy - } + visible: root.fees.hasOwnProperty('base_transaction_fees_ticker') && !API.app.trading_pg.preimage_rpc_busy ColumnLayout { diff --git a/atomic_defi_design/Dex/Exchange/Trade/PriceLineSimplified.qml b/atomic_defi_design/Dex/Exchange/Trade/PriceLineSimplified.qml index cfb41530bd..b3cb392809 100644 --- a/atomic_defi_design/Dex/Exchange/Trade/PriceLineSimplified.qml +++ b/atomic_defi_design/Dex/Exchange/Trade/PriceLineSimplified.qml @@ -47,6 +47,7 @@ ColumnLayout Layout.alignment: Qt.AlignHCenter ColumnLayout { + Layout.fillWidth: true visible: price_entered DexLabel { @@ -57,6 +58,7 @@ ColumnLayout // Price reversed DexLabel { + horizontalAlignment: !invalid_cex_price ? Text.AlignHCenter : Text.AlignLeft text_value: General.formatCrypto("", "1", right_ticker) + " = " + General.formatCrypto("", price_reversed, left_ticker) font.pixelSize: fontSizeBigger font.weight: Font.Medium @@ -65,20 +67,25 @@ ColumnLayout // Price DexLabel { + horizontalAlignment: !invalid_cex_price ? Text.AlignHCenter : Text.AlignLeft text_value: General.formatCrypto("", price, right_ticker) + " = " + General.formatCrypto("", "1", left_ticker) font.pixelSize: fontSize } } - Item { Layout.fillWidth: true } + Item + { + Layout.fillWidth: true + visible: !invalid_cex_price + } ColumnLayout { visible: !invalid_cex_price + Layout.fillWidth: true DexLabel { - Layout.alignment: Qt.AlignRight text_value: General.cex_icon + " " + qsTr("CEXchange rate") font.pixelSize: fontSize @@ -88,7 +95,6 @@ ColumnLayout // Price reversed DexLabel { - Layout.alignment: Qt.AlignRight text_value: General.formatCrypto("", "1", right_ticker) + " = " + General.formatCrypto("", cex_price_reversed, left_ticker) font.pixelSize: fontSizeBigger font.weight: Font.Medium @@ -97,7 +103,6 @@ ColumnLayout // Price DexLabel { - Layout.alignment: Qt.AlignRight text_value: General.formatCrypto("", cex_price, right_ticker) + " = " + General.formatCrypto("", "1", left_ticker) font.pixelSize: fontSize } diff --git a/atomic_defi_design/Dex/Portfolio/Portfolio.qml b/atomic_defi_design/Dex/Portfolio/Portfolio.qml index 5d62c3e13d..8d4a5a9d4d 100644 --- a/atomic_defi_design/Dex/Portfolio/Portfolio.qml +++ b/atomic_defi_design/Dex/Portfolio/Portfolio.qml @@ -211,14 +211,13 @@ Item { // Filters (search and balance) Item { - width: parent.width + width: parent.parent.width - 80 + anchors.horizontalCenter: parent.horizontalCenter height: 30 visible: true Item { anchors.fill: parent - anchors.leftMargin: 40 - anchors.rightMargin: 40 anchors.topMargin: 5 RowLayout { @@ -245,9 +244,6 @@ Item { { id: hide_zero_balance_checkbox - Layout.preferredWidth: 280 - Layout.alignment: Qt.AlignRight - spacing: 2 boxWidth: 24 boxHeight: 24 From 347f0fdec65d9422aa3a6d7f9f2965233b69dacd Mon Sep 17 00:00:00 2001 From: smk762 Date: Fri, 6 May 2022 22:45:44 +0800 Subject: [PATCH 025/177] add VOTE2022 --- assets/config/0.5.5-coins.json | 24 ++++++++++++++++++ atomic_defi_design/Dex/Constants/Style.qml | 1 + .../coins/{vote2021.png => vote2022.png} | Bin atomic_defi_design/qml.qrc | 1 + 4 files changed, 26 insertions(+) rename atomic_defi_design/assets/images/coins/{vote2021.png => vote2022.png} (100%) diff --git a/assets/config/0.5.5-coins.json b/assets/config/0.5.5-coins.json index a5519d2a3d..fdecb8dcac 100644 --- a/assets/config/0.5.5-coins.json +++ b/assets/config/0.5.5-coins.json @@ -9645,6 +9645,30 @@ "active": false, "currently_enabled": false }, + "VOTE2022": { + "coin": "VOTE2022", + "name": "Vote 2022", + "coinpaprika_id": "test-coin", + "coingecko_id": "test-coin", + "electrum": [ + { + "url": "electrum1.cipig.net:10002" + }, + { + "url": "electrum2.cipig.net:10002" + }, + { + "url": "electrum3.cipig.net:10002" + } + ], + "explorer_url": [ + "https://vote.kmdexplorer.io/" + ], + "type": "Smart Chain", + "active": false, + "wallet_only": true, + "currently_enabled": false + }, "ZINU-BEP20": { "coin": "ZINU-BEP20", "name": "Zombie Inu", diff --git a/atomic_defi_design/Dex/Constants/Style.qml b/atomic_defi_design/Dex/Constants/Style.qml index 8a49600070..39fe3772b5 100644 --- a/atomic_defi_design/Dex/Constants/Style.qml +++ b/atomic_defi_design/Dex/Constants/Style.qml @@ -513,6 +513,7 @@ QtObject { "ZIL": "#42BBB9", "ZRX": "#302C2C", "UNI": "#FF007A", + "VOTE2022": "#7490AA", "USBL": "#279553" }) } diff --git a/atomic_defi_design/assets/images/coins/vote2021.png b/atomic_defi_design/assets/images/coins/vote2022.png similarity index 100% rename from atomic_defi_design/assets/images/coins/vote2021.png rename to atomic_defi_design/assets/images/coins/vote2022.png diff --git a/atomic_defi_design/qml.qrc b/atomic_defi_design/qml.qrc index fea5c25f36..ee1c845da8 100644 --- a/atomic_defi_design/qml.qrc +++ b/atomic_defi_design/qml.qrc @@ -282,6 +282,7 @@ assets/images/coins/val.png assets/images/coins/vgx.png assets/images/coins/vite.png + assets/images/coins/vote2022.png assets/images/coins/vra.png assets/images/coins/vrm.png assets/images/coins/vrsc.png From 120e21ef41401f5d2262dabb5359fd38d1f54f22 Mon Sep 17 00:00:00 2001 From: smk762 Date: Sat, 7 May 2022 01:34:48 +0800 Subject: [PATCH 026/177] prefer wait_until --- .../Dex/Components/MultipageModalContent.qml | 2 +- .../ProView/TradingInfo/OrderModal.qml | 4 +- .../ProView/TradingInfo/SwapProgress.qml | 44 +++++++++---------- .../Dex/Exchange/Trade/ConfirmTradeModal.qml | 13 +++--- 4 files changed, 31 insertions(+), 32 deletions(-) diff --git a/atomic_defi_design/Dex/Components/MultipageModalContent.qml b/atomic_defi_design/Dex/Components/MultipageModalContent.qml index 16a788b6a6..bf303f9e20 100644 --- a/atomic_defi_design/Dex/Components/MultipageModalContent.qml +++ b/atomic_defi_design/Dex/Components/MultipageModalContent.qml @@ -43,7 +43,7 @@ ColumnLayout id: _header spacing: 10 Layout.topMargin: root.titleTopMargin - height: childrenRect.height + Layout.preferredHeight: childrenRect.height visible: childrenRect.height > 0 } diff --git a/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/OrderModal.qml b/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/OrderModal.qml index f644d5fe25..6f20b82cec 100644 --- a/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/OrderModal.qml +++ b/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/OrderModal.qml @@ -97,7 +97,7 @@ MultipageModal font.bold: true visible: !details ? false : details.is_swap || !details.is_maker text_value: !details ? "" : visible ? getStatusText(details.order_status) : '' - Layout.preferredHeight: 25 + height: 25 }, DexLabel @@ -106,7 +106,7 @@ MultipageModal visible: text_value != "" font.pixelSize: Style.textSizeSmall2 text_value: !details ? "" : details.order_status === "refunding" ? swapProgress.getRefundText() : "" - Layout.preferredHeight: 25 + height: 25 } ] diff --git a/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/SwapProgress.qml b/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/SwapProgress.qml index d10ba4f500..cfb0d94cde 100644 --- a/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/SwapProgress.qml +++ b/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/SwapProgress.qml @@ -120,46 +120,42 @@ ColumnLayout property double wait_until_countdown_time: -1 // Then we count down to 'wait_until' time function updateCountdownTime() { - if (current_event_idx == -1 || !details) { + if (current_event_idx == -1 || !details) + { payment_lock_countdown_time = -1 return } const events = details.events - if (payment_lock_countdown_time == 0) + console.log(">Date.now(): " + Date.now()) + if (events[current_event_idx - 1].hasOwnProperty('data')) { - console.log(">payment_lock_countdown_time at zero " + details.order_id) - if (wait_until_countdown_time > 0) + if (events[current_event_idx - 1]['data'].hasOwnProperty('wait_until')) { - console.log("current_event_idx: " + current_event_idx) - if (events[current_event_idx - 1].hasOwnProperty('data')) + const diff = events[current_event_idx - 1]['data']['wait_until'] * 1000 - Date.now() + wait_until_countdown_time = diff - (diff % 1000) + console.log(">wait_until_countdown_time: " + wait_until_countdown_time) + if (wait_until_countdown_time <= 0) { - if (events[current_event_idx - 1]['data'].hasOwnProperty('wait_until')) - { - console.log(">Date.now(): " + Date.now()) - console.log(">wait_until: " + events[current_event_idx - 1]['data']['wait_until'] * 1000) - const diff = events[current_event_idx - 1]['data']['wait_until'] * 1000 - Date.now() - wait_until_countdown_time = diff - (diff % 1000) - console.log(">wait_until_countdown_time: " + wait_until_countdown_time) - if (wait_until_countdown_time <= 0) - { - wait_until_countdown_time = 0 - } - } + wait_until_countdown_time = 0 } } } - else if (details.hasOwnProperty('payment_lock')) + else { - const diff = details.payment_lock - Date.now() - payment_lock_countdown_time = diff - (diff % 1000) + wait_until_countdown_time = -1 + } + + if (details.hasOwnProperty('payment_lock')) + { + const lock_diff = details.payment_lock - Date.now() + payment_lock_countdown_time = lock_diff - (lock_diff % 1000) + console.log(">payment_lock_countdown_time: " + payment_lock_countdown_time) if (payment_lock_countdown_time <= 0) { payment_lock_countdown_time = 0 - const diff = events[current_event_idx - 1]['data']['wait_until'] * 1000 - Date.now() - wait_until_countdown_time = diff - (diff % 1000) } } @@ -189,7 +185,7 @@ ColumnLayout { console.log(".payment_lock_countdown_time: " + payment_lock_countdown_time) console.log(".wait_until_countdown_time: " + wait_until_countdown_time) - if (payment_lock_countdown_time > 0) + if ((payment_lock_countdown_time > 0) && (wait_until_countdown_time == -1)) { return `` + qsTr(General.durationTextShort(payment_lock_countdown_time) + " until refund lock is released.") + `` } diff --git a/atomic_defi_design/Dex/Exchange/Trade/ConfirmTradeModal.qml b/atomic_defi_design/Dex/Exchange/Trade/ConfirmTradeModal.qml index 1ab9e9c943..d3eee5a28b 100644 --- a/atomic_defi_design/Dex/Exchange/Trade/ConfirmTradeModal.qml +++ b/atomic_defi_design/Dex/Exchange/Trade/ConfirmTradeModal.qml @@ -100,17 +100,19 @@ MultipageModal spacing: 10 - // Fees Info - Item - { + + DexRectangle { Layout.alignment: Qt.AlignCenter - Layout.preferredHeight: fees_detail.height - Layout.preferredWidth: parent.width - 80 + Layout.preferredHeight: fees_detail.height + 20 + Layout.preferredWidth: parent.width - 60 + color: DexTheme.contentColorTop visible: root.fees.hasOwnProperty('base_transaction_fees_ticker') && !API.app.trading_pg.preimage_rpc_busy ColumnLayout { id: fees_detail + width: parent.width - 20 + anchors.centerIn: parent spacing: 8 Repeater @@ -151,6 +153,7 @@ MultipageModal base_ticker, rel_ticker, left_ticker, right_ticker) } + } } From 6300042fb6ba1e443f3c5aee99d048825773827f Mon Sep 17 00:00:00 2001 From: smk762 Date: Sat, 7 May 2022 05:31:12 +0800 Subject: [PATCH 027/177] remove logs --- .../Dex/Components/DexCheckBox.qml | 2 +- .../Dex/Components/DexPairItemBadge.qml | 2 +- atomic_defi_design/Dex/Constants/General.qml | 8 +++ .../ProView/PlaceOrderForm/OrderForm.qml | 8 ++- .../ProView/TradingInfo/OrderModal.qml | 1 - .../ProView/TradingInfo/PriceLine.qml | 12 +--- .../ProView/TradingInfo/SwapProgress.qml | 12 ++-- .../Exchange/Trade/PriceLineSimplified.qml | 56 +++++++------------ 8 files changed, 45 insertions(+), 56 deletions(-) diff --git a/atomic_defi_design/Dex/Components/DexCheckBox.qml b/atomic_defi_design/Dex/Components/DexCheckBox.qml index 65e87687f8..f575a2a5b1 100644 --- a/atomic_defi_design/Dex/Components/DexCheckBox.qml +++ b/atomic_defi_design/Dex/Components/DexCheckBox.qml @@ -17,7 +17,7 @@ CheckBox property alias boxHeight: _indicator.implicitHeight property alias mouseArea: mouse_area property color textColor: Dex.CurrentTheme.foregroundColor - property int labelWidth: 120 + property int labelWidth: 0 font.family: Style.font_family Layout.preferredWidth: childrenRect.width diff --git a/atomic_defi_design/Dex/Components/DexPairItemBadge.qml b/atomic_defi_design/Dex/Components/DexPairItemBadge.qml index 8abd3df0e0..adea23d09f 100644 --- a/atomic_defi_design/Dex/Components/DexPairItemBadge.qml +++ b/atomic_defi_design/Dex/Components/DexPairItemBadge.qml @@ -55,7 +55,7 @@ DexRectangle Layout.fillWidth: true font.pixelSize: 11 horizontalAlignment: Text.AlignLeft - wrapMode: Text.WordWrap + wrapMode: Text.NoWrap } } diff --git a/atomic_defi_design/Dex/Constants/General.qml b/atomic_defi_design/Dex/Constants/General.qml index a4e55ca05a..0e01d94c95 100644 --- a/atomic_defi_design/Dex/Constants/General.qml +++ b/atomic_defi_design/Dex/Constants/General.qml @@ -372,6 +372,14 @@ QtObject { return trail_zeros ? full_double : full_double.replace(/\.?0+$/,"") } + function getComparisonScale(value) { + return Math.min(Math.pow(10, getDigitCount(parseFloat(value))), 1000000000) + } + + function limitDigits(value) { + return parseFloat(formatDouble(value, 2)) + } + function formatCrypto(received, amount, ticker, fiat_amount, fiat, precision, trail_zeros) { return diffPrefix(received) + ticker + " " + formatDouble(amount, precision, trail_zeros) + (fiat_amount ? " (" + formatFiat("", fiat_amount, fiat) + ")" : "") } diff --git a/atomic_defi_design/Dex/Exchange/ProView/PlaceOrderForm/OrderForm.qml b/atomic_defi_design/Dex/Exchange/ProView/PlaceOrderForm/OrderForm.qml index f512f2deb2..85eab0f261 100644 --- a/atomic_defi_design/Dex/Exchange/ProView/PlaceOrderForm/OrderForm.qml +++ b/atomic_defi_design/Dex/Exchange/ProView/PlaceOrderForm/OrderForm.qml @@ -192,20 +192,24 @@ ColumnLayout RowLayout { Layout.topMargin: 15 + Layout.rightMargin: 2 + Layout.leftMargin: 2 Layout.fillWidth: true + spacing: 5 + DexCheckBox { id: _useCustomMinTradeAmountCheckbox boxWidth: 20 boxHeight: 20 labelWidth: 0 - anchors.verticalCenter: parent.verticalCenter } DexLabel { Layout.fillWidth: true + height: _useCustomMinTradeAmountCheckbox.height horizontalAlignment: Text.AlignLeft - anchors.verticalCenter: parent.verticalCenter + verticalAlignment: Text.AlignVCenter wrapMode: Label.WordWrap text: qsTr("Use custom minimum trade amount") color: Dex.CurrentTheme.foregroundColor3 diff --git a/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/OrderModal.qml b/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/OrderModal.qml index 6f20b82cec..5a3a6098ae 100644 --- a/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/OrderModal.qml +++ b/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/OrderModal.qml @@ -16,7 +16,6 @@ MultipageModal property var details horizontalPadding: 60 verticalPadding: 40 - width: 650 onDetailsChanged: { if (!details) root.close() } onOpened: diff --git a/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/PriceLine.qml b/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/PriceLine.qml index 3f434a8fe1..332d1eed91 100644 --- a/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/PriceLine.qml +++ b/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/PriceLine.qml @@ -18,15 +18,7 @@ ColumnLayout readonly property int fontSize: Style.textSizeSmall1 readonly property int fontSizeBigger: Style.textSizeSmall2 - readonly property int line_scale: getComparisonScale(cex_price_diff) - - function getComparisonScale(value) { - return Math.min(Math.pow(10, General.getDigitCount(parseFloat(value))), 1000000000) - } - - function limitDigits(value) { - return parseFloat(General.formatDouble(value, 2)) - } + readonly property int line_scale: General.getComparisonScale(cex_price_diff) spacing: 20 @@ -81,7 +73,7 @@ ColumnLayout Layout.bottomMargin: Layout.topMargin Layout.alignment: Qt.AlignHCenter color: parseFloat(cex_price_diff) <= 0 ? Dex.CurrentTheme.okColor : Dex.CurrentTheme.noColor - text_value: (parseFloat(cex_price_diff) > 0 ? qsTr("Expensive") : qsTr("Expedient")) + ":    " + qsTr("%1 compared to CEX", "PRICE_DIFF%").arg("" + General.formatPercent(limitDigits(cex_price_diff)) + "") + text_value: (parseFloat(cex_price_diff) > 0 ? qsTr("Expensive") : qsTr("Expedient")) + ":    " + qsTr("%1 compared to CEX", "PRICE_DIFF%").arg("" + General.formatPercent(General.limitDigits(cex_price_diff)) + "") font.pixelSize: fontSize } diff --git a/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/SwapProgress.qml b/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/SwapProgress.qml index cfb0d94cde..79d9ae0ab1 100644 --- a/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/SwapProgress.qml +++ b/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/SwapProgress.qml @@ -128,14 +128,13 @@ ColumnLayout const events = details.events - console.log(">Date.now(): " + Date.now()) if (events[current_event_idx - 1].hasOwnProperty('data')) { if (events[current_event_idx - 1]['data'].hasOwnProperty('wait_until')) { const diff = events[current_event_idx - 1]['data']['wait_until'] * 1000 - Date.now() wait_until_countdown_time = diff - (diff % 1000) - console.log(">wait_until_countdown_time: " + wait_until_countdown_time) + if (wait_until_countdown_time <= 0) { wait_until_countdown_time = 0 @@ -152,7 +151,7 @@ ColumnLayout { const lock_diff = details.payment_lock - Date.now() payment_lock_countdown_time = lock_diff - (lock_diff % 1000) - console.log(">payment_lock_countdown_time: " + payment_lock_countdown_time) + if (payment_lock_countdown_time <= 0) { payment_lock_countdown_time = 0 @@ -183,8 +182,9 @@ ColumnLayout function getRefundText() { - console.log(".payment_lock_countdown_time: " + payment_lock_countdown_time) - console.log(".wait_until_countdown_time: " + wait_until_countdown_time) + // console.log("payment_lock_countdown_time: " + payment_lock_countdown_time) + // console.log("wait_until_countdown_time: " + wait_until_countdown_time) + if ((payment_lock_countdown_time > 0) && (wait_until_countdown_time == -1)) { return `` + qsTr(General.durationTextShort(payment_lock_countdown_time) + " until refund lock is released.") + `` @@ -285,7 +285,7 @@ ColumnLayout { id: bar visible: is_active - width: root.width - 40 + width: parent.width height: 2 color: DexTheme.foregroundColorDarkColor3 diff --git a/atomic_defi_design/Dex/Exchange/Trade/PriceLineSimplified.qml b/atomic_defi_design/Dex/Exchange/Trade/PriceLineSimplified.qml index b3cb392809..90ffe7a265 100644 --- a/atomic_defi_design/Dex/Exchange/Trade/PriceLineSimplified.qml +++ b/atomic_defi_design/Dex/Exchange/Trade/PriceLineSimplified.qml @@ -9,6 +9,7 @@ import Dex.Themes 1.0 as Dex ColumnLayout { + Layout.fillWidth: true readonly property string price: non_null_price readonly property string price_reversed: API.app.trading_pg.price_reversed readonly property string cex_price: API.app.trading_pg.cex_price @@ -19,38 +20,23 @@ ColumnLayout readonly property int fontSize: Style.textSizeSmall1 readonly property int fontSizeBigger: Style.textSizeSmall2 - readonly property int line_scale: getComparisonScale(cex_price_diff) - - function getComparisonScale(value) - { - return Math.min(Math.pow(10, General.getDigitCount(parseFloat(value))), 1000000000) - } - - function limitDigits(value) - { - return parseFloat(General.formatDouble(value, 2)) - } + readonly property int line_scale: General.getComparisonScale(cex_price_diff) spacing: 35 - DexLabel - { - visible: !price_entered && invalid_cex_price - Layout.alignment: Qt.AlignHCenter - text_value: qsTr("Set swap price for evaluation") - font.pixelSize: fontSizeBigger - } - RowLayout { - Layout.fillWidth: true - Layout.alignment: Qt.AlignHCenter + Layout.fillWidth: true + ColumnLayout { - Layout.fillWidth: true visible: price_entered + Layout.fillWidth: true + DexLabel { + Layout.fillWidth: true + horizontalAlignment: invalid_cex_price ? Text.AlignHCenter : Text.AlignLeft text_value: qsTr("Exchange rate") + (preffered_order.price !== undefined ? (" (" + qsTr("Selected") + ")") : "") font.pixelSize: fontSize } @@ -58,27 +44,22 @@ ColumnLayout // Price reversed DexLabel { - horizontalAlignment: !invalid_cex_price ? Text.AlignHCenter : Text.AlignLeft + Layout.fillWidth: true + horizontalAlignment: invalid_cex_price ? Text.AlignHCenter : Text.AlignLeft text_value: General.formatCrypto("", "1", right_ticker) + " = " + General.formatCrypto("", price_reversed, left_ticker) - font.pixelSize: fontSizeBigger - font.weight: Font.Medium + font.pixelSize: fontSize } // Price DexLabel { - horizontalAlignment: !invalid_cex_price ? Text.AlignHCenter : Text.AlignLeft + Layout.fillWidth: true + horizontalAlignment: invalid_cex_price ? Text.AlignHCenter : Text.AlignLeft text_value: General.formatCrypto("", price, right_ticker) + " = " + General.formatCrypto("", "1", left_ticker) font.pixelSize: fontSize } } - Item - { - Layout.fillWidth: true - visible: !invalid_cex_price - } - ColumnLayout { visible: !invalid_cex_price @@ -86,6 +67,8 @@ ColumnLayout DexLabel { + Layout.fillWidth: true + horizontalAlignment: Text.AlignRight text_value: General.cex_icon + " " + qsTr("CEXchange rate") font.pixelSize: fontSize @@ -95,14 +78,17 @@ ColumnLayout // Price reversed DexLabel { + Layout.fillWidth: true + horizontalAlignment: Text.AlignRight text_value: General.formatCrypto("", "1", right_ticker) + " = " + General.formatCrypto("", cex_price_reversed, left_ticker) - font.pixelSize: fontSizeBigger - font.weight: Font.Medium + font.pixelSize: fontSize } // Price DexLabel { + Layout.fillWidth: true + horizontalAlignment: Text.AlignRight text_value: General.formatCrypto("", cex_price, right_ticker) + " = " + General.formatCrypto("", "1", left_ticker) font.pixelSize: fontSize } @@ -161,7 +147,7 @@ ColumnLayout Layout.topMargin: 10 Layout.alignment: Qt.AlignHCenter color: parseFloat(cex_price_diff) <= 0 ? Dex.CurrentTheme.okColor : Dex.CurrentTheme.noColor - text_value: (parseFloat(cex_price_diff) > 0 ? qsTr("Expensive") : qsTr("Expedient")) + ":    " + qsTr("%1 compared to CEX", "PRICE_DIFF%").arg("" + General.formatPercent(limitDigits(cex_price_diff)) + "") + text_value: (parseFloat(cex_price_diff) > 0 ? qsTr("Expensive") : qsTr("Expedient")) + ":    " + qsTr("%1 compared to CEX", "PRICE_DIFF%").arg("" + General.formatPercent(General.limitDigits(cex_price_diff)) + "") font.pixelSize: fontSize } } From 1fae90529ce152912fa0ecbdcbb4fd7ceae08acf Mon Sep 17 00:00:00 2001 From: smk762 Date: Sat, 7 May 2022 08:00:14 +0800 Subject: [PATCH 028/177] hold off on timer until fail detected --- .../Dex/Exchange/ProView/TradingInfo/SwapProgress.qml | 5 +---- .../Dex/Exchange/Trade/PriceLineSimplified.qml | 1 + 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/SwapProgress.qml b/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/SwapProgress.qml index 79d9ae0ab1..5a43bdfac3 100644 --- a/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/SwapProgress.qml +++ b/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/SwapProgress.qml @@ -166,7 +166,7 @@ ColumnLayout Timer { - running: current_event_idx !== -1 + running: has_error_event && last_event.state !== "Finished" interval: 1000 repeat: true onTriggered: updateCountdownTime() @@ -182,9 +182,6 @@ ColumnLayout function getRefundText() { - // console.log("payment_lock_countdown_time: " + payment_lock_countdown_time) - // console.log("wait_until_countdown_time: " + wait_until_countdown_time) - if ((payment_lock_countdown_time > 0) && (wait_until_countdown_time == -1)) { return `` + qsTr(General.durationTextShort(payment_lock_countdown_time) + " until refund lock is released.") + `` diff --git a/atomic_defi_design/Dex/Exchange/Trade/PriceLineSimplified.qml b/atomic_defi_design/Dex/Exchange/Trade/PriceLineSimplified.qml index 90ffe7a265..e4aeded684 100644 --- a/atomic_defi_design/Dex/Exchange/Trade/PriceLineSimplified.qml +++ b/atomic_defi_design/Dex/Exchange/Trade/PriceLineSimplified.qml @@ -53,6 +53,7 @@ ColumnLayout // Price DexLabel { + visible: price != 1 Layout.fillWidth: true horizontalAlignment: invalid_cex_price ? Text.AlignHCenter : Text.AlignLeft text_value: General.formatCrypto("", price, right_ticker) + " = " + General.formatCrypto("", "1", left_ticker) From ae9cd32ab2072f9f8d4ce9b8678eceb18715cb49 Mon Sep 17 00:00:00 2001 From: smk762 Date: Sat, 7 May 2022 08:25:04 +0800 Subject: [PATCH 029/177] better timer handling --- .../Dex/Exchange/ProView/TradingInfo/SwapProgress.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/SwapProgress.qml b/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/SwapProgress.qml index 5a43bdfac3..2a47f70408 100644 --- a/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/SwapProgress.qml +++ b/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/SwapProgress.qml @@ -166,7 +166,7 @@ ColumnLayout Timer { - running: has_error_event && last_event.state !== "Finished" + running: !has_error_event ? false : details.events[details.events.length - 1].state == "Finished" ? false : true interval: 1000 repeat: true onTriggered: updateCountdownTime() From f44a8709599f84b9177072732cd3a2757abc9833 Mon Sep 17 00:00:00 2001 From: syl Date: Mon, 9 May 2022 13:38:49 +0200 Subject: [PATCH 030/177] QML components: Change Expandable implicit height --- atomic_defi_design/Dex/Components/Expandable.qml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/atomic_defi_design/Dex/Components/Expandable.qml b/atomic_defi_design/Dex/Components/Expandable.qml index 96e5cb3795..e590d7201b 100644 --- a/atomic_defi_design/Dex/Components/Expandable.qml +++ b/atomic_defi_design/Dex/Components/Expandable.qml @@ -10,7 +10,7 @@ Rectangle property alias header: headerLoader.sourceComponent property alias content: contentLoader.sourceComponent - implicitHeight: padding + headerLoader.implicitHeight + contentLoader.implicitHeight + implicitHeight: padding + headerLoader.implicitHeight + (isExpanded ? contentLoader.implicitHeight + padding * 2 : 0) clip: true Loader @@ -29,7 +29,6 @@ Rectangle visible: root.isExpanded anchors.top: headerLoader.bottom - anchors.bottom: parent.bottom anchors.left: parent.left anchors.margins: root.padding } From 5858078a2e871a68bd83364321f68443f96857bc Mon Sep 17 00:00:00 2001 From: syl Date: Mon, 9 May 2022 13:39:32 +0200 Subject: [PATCH 031/177] Update addressbook style --- atomic_defi_design/Dex/Addressbook/Main.qml | 143 +++++++++++++++++++- 1 file changed, 136 insertions(+), 7 deletions(-) diff --git a/atomic_defi_design/Dex/Addressbook/Main.qml b/atomic_defi_design/Dex/Addressbook/Main.qml index e72016ea69..58360f024b 100644 --- a/atomic_defi_design/Dex/Addressbook/Main.qml +++ b/atomic_defi_design/Dex/Addressbook/Main.qml @@ -2,11 +2,14 @@ import QtQuick 2.15 import QtQuick.Layouts 1.15 +import Qaterial 1.0 as Qaterial + // Project Imports import Dex.Components 1.0 as Dex import "../Components" as Dex import Dex.Themes 1.0 as Dex import "../Constants" as Dex +import "../Wallet" as Wallet Item { @@ -40,8 +43,8 @@ Item height: 42 textField.placeholderText: qsTr("Search contact") - textField.onTextChanged: addressbookPg.model.proxy.searchExp = textField.text - Component.onDestruction: addressbookPg.model.proxy.searchExp = "" + textField.onTextChanged: Dex.API.app.addressbookPg.model.proxy.searchExp = textField.text + Component.onDestruction: Dex.API.app.addressbookPg.model.proxy.searchExp = "" } } @@ -106,17 +109,22 @@ Item color: index % 2 === 0 ? Dex.CurrentTheme.innerBackgroundColor : Dex.CurrentTheme.backgroundColor width: contactTable.width - header: Row + header: Item { height: 66 width: expandable.width - spacing: 0 + + Dex.DefaultMouseArea + { + anchors.fill: parent + onClicked: expandable.isExpanded = !expandable.isExpanded + } Row { width: parent.width * 0.3 - height: parent.height - spacing: 8 + anchors.verticalCenter: parent.verticalCenter + spacing: 12 Dex.UserIcon { @@ -136,9 +144,9 @@ Item } } - Dex.Text { + x: parent.width * 0.305 anchors.verticalCenter: parent.verticalCenter width: parent.width * 0.57 visible: modelData.categories.length === 0 @@ -147,6 +155,7 @@ Item Flow { + x: parent.width * 0.3 width: parent.width * 0.57 Repeater @@ -164,7 +173,10 @@ Item Row { spacing: 45 + width: 160 anchors.verticalCenter: parent.verticalCenter + anchors.right: parent.right + anchors.rightMargin: 2 Dex.ClickableText { font: Dex.DexTypo.body2 @@ -183,6 +195,109 @@ Item } } } + + content: Item + { + height: noAddressLabel.visible ? 80 : addressList.height + width: contactTable.width + + Dex.DexListView + { + id: addressList + + visible: model.rowCount() > 0 + x: 30 + model: modelData.proxyFilter + width: parent.width - 40 + implicitHeight: childrenRect.height > 240 ? 240 : childrenRect.height + spacing: 18 + + delegate: Item + { + property var coinInfo: Dex.API.app.portfolio_pg.global_cfg_mdl.get_coin_info(address_type) + + width: addressList.width + height: 30 + + Row + { + anchors.verticalCenter: parent.verticalCenter + spacing: 10 + Dex.Image + { + anchors.verticalCenter: parent.verticalCenter + width: 25 + height: 25 + source: Dex.General.coinIcon(parent.parent.coinInfo.ticker) + } + + Dex.Text + { + anchors.verticalCenter: parent.verticalCenter + text: address_type + } + + Dex.Text + { + anchors.verticalCenter: parent.verticalCenter + text: parent.parent.coinInfo.type + color: Dex.Style.getCoinTypeColor(parent.parent.coinInfo.type) + font: Dex.DexTypo.overLine + } + } + + Row + { + x: parent.width * 0.25 + spacing: 3 + + Dex.Text + { + anchors.verticalCenter: parent.verticalCenter + text: "%1 : %2".arg(address_key).arg(address_value) + } + + + Dex.Button + { + width: 25 + height: 25 + iconSource: Qaterial.Icons.contentCopy + color: "transparent" + onClicked: + { + Dex.API.qt_utilities.copy_text_to_clipboard(address_value) + app.notifyCopy(qsTr("Address Book"), qsTr("address copied to clipboard")) + } + } + + Dex.Button + { + width: 25 + height: 25 + iconSource: Qaterial.Icons.sendOutline + color: "transparent" + onClicked: + { + Dex.API.app.wallet_pg.ticker = address_type + sendModalLoader.address = address_value + sendModalLoader.open() + } + } + } + } + } + + Dex.Text + { + id: noAddressLabel + height: 20 + x: 30 + y: 15 + visible: addressList.model.rowCount() === 0 + text: qsTr("This contact does not have any registered address.") + } + } } } @@ -192,4 +307,18 @@ Item sourceComponent: EditContactModal { } } } + + Dex.ModalLoader + { + property string address + + id: sendModalLoader + + onLoaded: item.address_field.text = address + + sourceComponent: Wallet.SendModal + { + address_field.enabled: false + } + } } From e0fbbc5273351bdee05d336ac2b7e1664bafcfb5 Mon Sep 17 00:00:00 2001 From: smk762 Date: Tue, 10 May 2022 17:34:37 +0800 Subject: [PATCH 032/177] Dex -> Default --- .../Dex/Components/DefaultPairItemBadge.qml | 7 +++ .../Dex/Components/DexPairItemBadge.qml | 10 +-- .../Dex/Components/SearchField.qml | 4 +- .../ProView/PlaceOrderForm/OrderForm.qml | 2 +- .../ProView/TradingInfo/OrderLine.qml | 20 +++--- .../ProView/TradingInfo/OrderList.qml | 2 +- .../ProView/TradingInfo/OrderModal.qml | 16 ++--- .../ProView/TradingInfo/OrdersPage.qml | 18 +++--- .../ProView/TradingInfo/SwapProgress.qml | 8 +-- .../Dex/Exchange/Trade/ConfirmTradeModal.qml | 36 +++++------ .../Exchange/Trade/PriceLineSimplified.qml | 18 +++--- .../Dex/Portfolio/Portfolio.qml | 2 +- .../Dex/Screens/Startup/ImportWallet.qml | 17 +++--- .../Dex/Settings/AddCustomCoinModal.qml | 46 +++++++------- atomic_defi_design/Dex/Sidebar/Bottom.qml | 5 +- .../Dex/Wallet/EnableCoinModal.qml | 16 ++--- atomic_defi_design/Dex/Wallet/Main.qml | 56 ++++++++++------- atomic_defi_design/Dex/Wallet/SendModal.qml | 61 +++++++++---------- .../Dex/Wallet/TransactionDetailsModal.qml | 4 +- 19 files changed, 186 insertions(+), 162 deletions(-) create mode 100644 atomic_defi_design/Dex/Components/DefaultPairItemBadge.qml diff --git a/atomic_defi_design/Dex/Components/DefaultPairItemBadge.qml b/atomic_defi_design/Dex/Components/DefaultPairItemBadge.qml new file mode 100644 index 0000000000..eccb53a75f --- /dev/null +++ b/atomic_defi_design/Dex/Components/DefaultPairItemBadge.qml @@ -0,0 +1,7 @@ +import QtQuick 2.15 +import QtQuick.Controls 2.15 +import QtQuick.Controls.Universal 2.15 +import "../Constants" +import App 1.0 + +DexPairItemBadge {} \ No newline at end of file diff --git a/atomic_defi_design/Dex/Components/DexPairItemBadge.qml b/atomic_defi_design/Dex/Components/DexPairItemBadge.qml index adea23d09f..5c922acbe6 100644 --- a/atomic_defi_design/Dex/Components/DexPairItemBadge.qml +++ b/atomic_defi_design/Dex/Components/DexPairItemBadge.qml @@ -23,7 +23,7 @@ DexRectangle Item { Layout.fillWidth: true } - DexImage + DefaultImage { id: icon Layout.preferredWidth: 35 @@ -40,7 +40,7 @@ DexRectangle Layout.alignment: Qt.AlignVCenter spacing: 5 - DexLabel + DefaultText { id: ticker Layout.fillWidth: true @@ -49,7 +49,7 @@ DexRectangle wrapMode: Text.NoWrap } - DexLabel + DefaultText { id: amount Layout.fillWidth: true @@ -68,7 +68,7 @@ DexRectangle Layout.alignment: Qt.AlignVCenter spacing: 5 - DexLabel + DefaultText { id: fullname Layout.fillWidth: true @@ -77,7 +77,7 @@ DexRectangle font.pixelSize: 11 } - DexLabel + DefaultText { id: amount_fiat visible: text != '' diff --git a/atomic_defi_design/Dex/Components/SearchField.qml b/atomic_defi_design/Dex/Components/SearchField.qml index df8712bcf8..3b407abc32 100644 --- a/atomic_defi_design/Dex/Components/SearchField.qml +++ b/atomic_defi_design/Dex/Components/SearchField.qml @@ -15,7 +15,7 @@ Rectangle color: Dex.CurrentTheme.accentColor radius: 18 - DexImage + DefaultImage { id: _searchIcon anchors.left: parent.left @@ -35,7 +35,7 @@ Rectangle } } - DexTextField + DefaultTextField { id: _textField diff --git a/atomic_defi_design/Dex/Exchange/ProView/PlaceOrderForm/OrderForm.qml b/atomic_defi_design/Dex/Exchange/ProView/PlaceOrderForm/OrderForm.qml index 85eab0f261..33b26af5e4 100644 --- a/atomic_defi_design/Dex/Exchange/ProView/PlaceOrderForm/OrderForm.qml +++ b/atomic_defi_design/Dex/Exchange/ProView/PlaceOrderForm/OrderForm.qml @@ -205,7 +205,7 @@ ColumnLayout labelWidth: 0 } - DexLabel { + DefaultText { Layout.fillWidth: true height: _useCustomMinTradeAmountCheckbox.height horizontalAlignment: Text.AlignLeft diff --git a/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/OrderLine.qml b/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/OrderLine.qml index 75e4b3e895..428c58fe8b 100644 --- a/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/OrderLine.qml +++ b/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/OrderLine.qml @@ -47,7 +47,7 @@ FloatingBackground Layout.preferredWidth: 24 Layout.alignment: Qt.AlignCenter - DexLabel + DefaultText { id: statusText anchors.centerIn: parent @@ -84,7 +84,7 @@ FloatingBackground clip: true - DexLabel + DefaultText { id: baseAmountLabel anchors.left: parent.left @@ -97,7 +97,7 @@ FloatingBackground maximumLineCount: 1 } - DexLabel + DefaultText { anchors.left: baseAmountLabel.right anchors.leftMargin: 3 @@ -120,7 +120,7 @@ FloatingBackground iconSize: 18 } - DexLabel + DefaultText { anchors.right: relAmountInCurrCurrency.left anchors.rightMargin: 3 @@ -133,7 +133,7 @@ FloatingBackground maximumLineCount: 1 } - DexLabel + DefaultText { id: relAmountInCurrCurrency @@ -166,7 +166,7 @@ FloatingBackground source: General.coinIcon(!details ? atomic_app_primary_coin : details.base_coin ?? atomic_app_primary_coin) } - DexLabel + DefaultText { anchors.left: baseIcon.right anchors.leftMargin: 2 @@ -180,7 +180,7 @@ FloatingBackground maximumLineCount: 1 } - DexLabel + DefaultText { visible: clickable @@ -194,7 +194,7 @@ FloatingBackground color: Dex.CurrentTheme.foregroundColor2 } - DexLabel + DefaultText { anchors.right: relCoin.left anchors.rightMargin: 2 @@ -229,7 +229,7 @@ FloatingBackground Layout.preferredWidth: 24 Layout.alignment: Qt.AlignCenter - DexLabel + DefaultText { anchors.centerIn: parent @@ -240,7 +240,7 @@ FloatingBackground DexTooltip { - contentItem: DexLabel + contentItem: DefaultText { text_value: qsTr("Funds are recoverable") font.pixelSize: Style.textSizeSmall4 diff --git a/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/OrderList.qml b/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/OrderList.qml index 58ab02b829..75586a8511 100644 --- a/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/OrderList.qml +++ b/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/OrderList.qml @@ -102,7 +102,7 @@ Item } } - DexLabel + DefaultText { visible: list.count === 0 anchors.centerIn: parent diff --git a/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/OrderModal.qml b/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/OrderModal.qml index 5a3a6098ae..ff0699c5fd 100644 --- a/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/OrderModal.qml +++ b/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/OrderModal.qml @@ -37,7 +37,7 @@ MultipageModal header: [ // Complete image - DexImage + DefaultImage { visible: !details ? false : details.is_swap && details.order_status === "successful" Layout.alignment: Qt.AlignHCenter @@ -46,7 +46,7 @@ MultipageModal }, // Loading symbol - DexBusyIndicator + DefaultBusyIndicator { visible: !details ? false : details.is_swap && !["successful", "failed"].includes(details.order_status) @@ -60,7 +60,7 @@ MultipageModal Layout.topMargin: 15 height: 70 - DexPairItemBadge + DefaultPairItemBadge { source: General.coinIcon(!details ? atomic_app_primary_coin : details.base_coin) ticker: details ? details.base_coin : "" @@ -77,7 +77,7 @@ MultipageModal icon: Qaterial.Icons.swapHorizontal } - DexPairItemBadge + DefaultPairItemBadge { source: General.coinIcon(!details ? atomic_app_primary_coin : details.rel_coin) ticker: details ? details.rel_coin : "" @@ -87,7 +87,7 @@ MultipageModal }, // Status Text - DexLabel + DefaultText { id: statusText Layout.alignment: Qt.AlignHCenter @@ -99,7 +99,7 @@ MultipageModal height: 25 }, - DexLabel + DefaultText { Layout.alignment: Qt.AlignHCenter visible: text_value != "" @@ -228,7 +228,7 @@ MultipageModal }, // Recover Funds button - DexAppButton + DefaultButton { id: refund_button leftPadding: 15 @@ -287,7 +287,7 @@ MultipageModal Layout.fillWidth: true }, - DexAppButton + DefaultButton { id: close_order_button text: qsTr("Close") diff --git a/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/OrdersPage.qml b/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/OrdersPage.qml index f055874ca0..a88ef9cd1f 100644 --- a/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/OrdersPage.qml +++ b/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/OrdersPage.qml @@ -90,7 +90,7 @@ Item { RowLayout { spacing: 10 - DexButton + DefaultButton { Layout.preferredWidth: 86 Layout.preferredHeight: 29 @@ -101,7 +101,7 @@ Item { onClicked: settings.visible = !settings.visible } - DexButton + DefaultButton { visible: root.is_history Layout.preferredWidth: 86 @@ -116,7 +116,7 @@ Item { } } - DexLabel + DefaultText { color: Dex.CurrentTheme.foregroundColor2 visible: !settings.visible @@ -133,7 +133,7 @@ Item { RowLayout { spacing: 10 - DexButton + DefaultButton { visible: root.is_history enabled: list_model_proxy.can_i_apply_filtering @@ -144,7 +144,8 @@ Item { text: qsTr("Apply Filter") onClicked: list_model_proxy.apply_all_filtering() } - DexButton + + DefaultButton { visible: !root.is_history enabled: API.app.orders_mdl.length > 0 @@ -162,7 +163,7 @@ Item { { Layout.alignment: Qt.AlignHCenter - DexSweetComboBox + DefaultSweetComboBox { id: combo_base Layout.preferredWidth: parent.width / 2 - swapCoinFilterIcon.width @@ -179,7 +180,8 @@ Item { id: swapCoinFilterIcon source: Qaterial.Icons.swapHorizontal color: Dex.CurrentTheme.foregroundColor - DexMouseArea + + DefaultMouseArea { id: swap_button anchors.fill: parent @@ -193,7 +195,7 @@ Item { } } - DexSweetComboBox + DefaultSweetComboBox { id: combo_rel Layout.fillWidth: true diff --git a/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/SwapProgress.qml b/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/SwapProgress.qml index 2a47f70408..c87534bd6a 100644 --- a/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/SwapProgress.qml +++ b/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/SwapProgress.qml @@ -195,7 +195,7 @@ ColumnLayout } // Title - DexLabel + DefaultText { Layout.fillWidth: true text_value: `` + qsTr("Progress details") + `` + @@ -231,7 +231,7 @@ ColumnLayout width: root.width height: 50 - DexLabel { + DefaultText { id: icon text_value: is_active ? "●" : "○" @@ -268,7 +268,7 @@ ColumnLayout anchors.verticalCenter: parent.verticalCenter anchors.right: parent.right - DexLabel + DefaultText { id: name @@ -295,7 +295,7 @@ ColumnLayout } } - DexLabel + DefaultText { visible: bar.visible font.pixelSize: Style.textSizeSmall2 diff --git a/atomic_defi_design/Dex/Exchange/Trade/ConfirmTradeModal.qml b/atomic_defi_design/Dex/Exchange/Trade/ConfirmTradeModal.qml index d3eee5a28b..f9859b5d06 100644 --- a/atomic_defi_design/Dex/Exchange/Trade/ConfirmTradeModal.qml +++ b/atomic_defi_design/Dex/Exchange/Trade/ConfirmTradeModal.qml @@ -33,7 +33,7 @@ MultipageModal { id: dex_pair_badges - DexPairItemBadge + DefaultPairItemBadge { source: General.coinIcon(!base_ticker ? atomic_app_primary_coin : base_ticker) ticker: base_ticker @@ -50,7 +50,7 @@ MultipageModal icon: Qaterial.Icons.swapHorizontal } - DexPairItemBadge + DefaultPairItemBadge { source: General.coinIcon(!rel_ticker ? atomic_app_primary_coin : rel_ticker) ticker: rel_ticker @@ -71,13 +71,13 @@ MultipageModal Layout.fillWidth: true Layout.alignment: Qt.AlignHCenter - DexLabel + DefaultText { Layout.alignment: Qt.AlignHCenter text_value: qsTr("This swap request can not be undone and is a final event!") } - DexLabel + DefaultText { id: warnings_tx_time_text Layout.alignment: Qt.AlignHCenter @@ -118,7 +118,7 @@ MultipageModal Repeater { model: root.fees.hasOwnProperty('base_transaction_fees_ticker') && !API.app.trading_pg.preimage_rpc_busy ? General.getFeesDetail(root.fees) : [] - delegate: DexLabel + delegate: DefaultText { font.pixelSize: Style.textSizeSmall1 text: General.getFeesDetailText(modelData.label, modelData.fee, modelData.ticker) @@ -128,7 +128,7 @@ MultipageModal Repeater { model: root.fees.hasOwnProperty('base_transaction_fees_ticker') ? root.fees.total_fees : [] - delegate: DexLabel + delegate: DefaultText { text: General.getFeesDetailText( qsTr("Total %1 fees:").arg(modelData.coin), @@ -138,13 +138,13 @@ MultipageModal Layout.alignment: Qt.AlignHCenter } - DexLabel + DefaultText { id: errors visible: text_value != '' Layout.alignment: Qt.AlignHCenter width: parent.width - horizontalAlignment: DexLabel.AlignHCenter + horizontalAlignment: DefaultText.AlignHCenter font: DexTypo.caption color: Dex.CurrentTheme.noColor text_value: General.getTradingError( @@ -168,7 +168,7 @@ MultipageModal id: use_custom spacing: 8 - DexCheckBox + DefaultCheckBox { id: enable_custom_config Layout.alignment: Qt.AlignCenter @@ -189,7 +189,7 @@ MultipageModal Layout.alignment: Qt.AlignCenter visible: enable_custom_config.checked && config_section.is_dpow_configurable - DexSwitch + DefaultSwitch { id: enable_dpow_confs labelWidth: 220 @@ -227,7 +227,7 @@ MultipageModal spacing: 8 - DexLabel + DefaultText { Layout.preferredHeight: 10 Layout.alignment: Qt.AlignHCenter @@ -236,7 +236,7 @@ MultipageModal opacity: parent.enabled ? 1 : .6 } - DexSlider + DefaultSlider { id: required_confirmation_count readonly property int default_confirmation_count: 3 @@ -265,7 +265,7 @@ MultipageModal id: dpow_off_warning anchors.centerIn: parent - DexLabel + DefaultText { Layout.alignment: Qt.AlignHCenter text_value: Style.warningCharacter + " " + qsTr("Warning, this atomic swap is not dPoW protected!") @@ -287,7 +287,7 @@ MultipageModal id: security_config spacing: 8 - DexLabel + DefaultText { Layout.alignment: Qt.AlignCenter visible: !enable_custom_config.checked @@ -295,7 +295,7 @@ MultipageModal font.weight: Font.Medium } - DexLabel + DefaultText { Layout.alignment: Qt.AlignCenter horizontalAlignment: Text.AlignHCenter @@ -303,7 +303,7 @@ MultipageModal text_value: "✅ " + (config_section.is_dpow_configurable ? qsTr("dPoW protected") : qsTr("%1 confirmations for incoming %2 transactions").arg(config_section.default_config.required_confirmations || 1).arg(rel_ticker)) } - DexLabel + DefaultText { visible: config_section.is_dpow_configurable && enable_dpow_confs.enabled Layout.alignment: Qt.AlignHCenter @@ -313,7 +313,7 @@ MultipageModal } } - DexBusyIndicator + DefaultBusyIndicator { visible: buy_sell_rpc_busy Layout.alignment: Qt.AlignCenter @@ -324,7 +324,7 @@ MultipageModal [ Item { Layout.fillWidth: true }, - DexAppButton + DefaultButton { text: qsTr("Cancel") padding: 10 diff --git a/atomic_defi_design/Dex/Exchange/Trade/PriceLineSimplified.qml b/atomic_defi_design/Dex/Exchange/Trade/PriceLineSimplified.qml index e4aeded684..c6f75e0351 100644 --- a/atomic_defi_design/Dex/Exchange/Trade/PriceLineSimplified.qml +++ b/atomic_defi_design/Dex/Exchange/Trade/PriceLineSimplified.qml @@ -33,7 +33,7 @@ ColumnLayout visible: price_entered Layout.fillWidth: true - DexLabel + DefaultText { Layout.fillWidth: true horizontalAlignment: invalid_cex_price ? Text.AlignHCenter : Text.AlignLeft @@ -42,7 +42,7 @@ ColumnLayout } // Price reversed - DexLabel + DefaultText { Layout.fillWidth: true horizontalAlignment: invalid_cex_price ? Text.AlignHCenter : Text.AlignLeft @@ -51,7 +51,7 @@ ColumnLayout } // Price - DexLabel + DefaultText { visible: price != 1 Layout.fillWidth: true @@ -66,7 +66,7 @@ ColumnLayout visible: !invalid_cex_price Layout.fillWidth: true - DexLabel + DefaultText { Layout.fillWidth: true horizontalAlignment: Text.AlignRight @@ -77,7 +77,7 @@ ColumnLayout } // Price reversed - DexLabel + DefaultText { Layout.fillWidth: true horizontalAlignment: Text.AlignRight @@ -86,7 +86,7 @@ ColumnLayout } // Price - DexLabel + DefaultText { Layout.fillWidth: true horizontalAlignment: Text.AlignRight @@ -123,7 +123,7 @@ ColumnLayout anchors.horizontalCenterOffset: 0.5 * parent.width * Math.min(Math.max(parseFloat(cex_price_diff) / line_scale, -1), 1) } - DexLabel + DefaultText { text_value: General.formatPercent(line_scale) font.pixelSize: fontSize @@ -131,7 +131,7 @@ ColumnLayout anchors.topMargin: -15 } - DexLabel + DefaultText { text_value: General.formatPercent(-line_scale) font.pixelSize: fontSize @@ -142,7 +142,7 @@ ColumnLayout } } - DexLabel + DefaultText { id: price_diff_text Layout.topMargin: 10 diff --git a/atomic_defi_design/Dex/Portfolio/Portfolio.qml b/atomic_defi_design/Dex/Portfolio/Portfolio.qml index 8d4a5a9d4d..b9d34d56f7 100644 --- a/atomic_defi_design/Dex/Portfolio/Portfolio.qml +++ b/atomic_defi_design/Dex/Portfolio/Portfolio.qml @@ -122,7 +122,7 @@ Item { Layout.fillWidth: true Layout.fillHeight: true - DexLabel + DefaultText { font: DexTypo.head6 anchors.verticalCenter: parent.verticalCenter diff --git a/atomic_defi_design/Dex/Screens/Startup/ImportWallet.qml b/atomic_defi_design/Dex/Screens/Startup/ImportWallet.qml index d5e174da69..f5966b22bd 100644 --- a/atomic_defi_design/Dex/Screens/Startup/ImportWallet.qml +++ b/atomic_defi_design/Dex/Screens/Startup/ImportWallet.qml @@ -19,6 +19,8 @@ SetupPage signal backClicked() signal postConfirmSuccess(string walletName) + image_scale: 0.7 + function reset() { text_error = ""; @@ -38,14 +40,13 @@ SetupPage } } - image_scale: 0.7 - content: DexRectangle { color: Dex.CurrentTheme.floatingBackgroundColor width: column_layout.width + 50 height: column_layout.height + 60 radius: 18 + function reset() { recover_seed.reset(); @@ -85,14 +86,14 @@ SetupPage ColumnLayout { id: column_layout - anchors.centerIn: parent - spacing: Style.rowSpacing + RowLayout { Layout.fillWidth: true spacing: 10 + SquareButton { icon.source: Qaterial.Icons.chevronLeft @@ -125,8 +126,6 @@ SetupPage } - - ModalLoader { id: eula_modal @@ -139,6 +138,7 @@ SetupPage } } } + ColumnLayout { visible: currentStep === 0 @@ -158,6 +158,7 @@ SetupPage field.placeholderText: qsTr("Wallet Name") field.onAccepted: tryPassLevel1() field.onTextChanged: text_error = General.validateWallet(input_wallet_name.field.text) + DefaultRectangle { x: 5 @@ -207,7 +208,7 @@ SetupPage font: DexTypo.body2 } - DexCheckBox + DefaultCheckBox { id: allow_custom_seed Layout.fillWidth: true @@ -298,6 +299,7 @@ SetupPage Layout.preferredWidth: 460 Layout.rightMargin: 5 spacing: Style.rowSpacing + DexAppPasswordField { id: _inputPassword @@ -340,7 +342,6 @@ SetupPage Layout.preferredHeight: 10 } - DexGradientAppButton { id: submit_button diff --git a/atomic_defi_design/Dex/Settings/AddCustomCoinModal.qml b/atomic_defi_design/Dex/Settings/AddCustomCoinModal.qml index e2b9a01b3b..1bde24162a 100644 --- a/atomic_defi_design/Dex/Settings/AddCustomCoinModal.qml +++ b/atomic_defi_design/Dex/Settings/AddCustomCoinModal.qml @@ -85,6 +85,7 @@ MultipageModal ListModel { id: type_model + ListElement { text: "ERC-20" @@ -94,6 +95,7 @@ MultipageModal name: 'Etherscan' coinType: CoinType.ERC20 } + ListElement { text: "QRC-20" @@ -103,6 +105,7 @@ MultipageModal name: 'QTUM Insight' coinType: CoinType.QRC20 } + ListElement { text: "BEP-20" @@ -123,7 +126,7 @@ MultipageModal titleText: qsTr("Choose the asset type") height: 450 - DexComboBox + DefaultComboBox { id: input_type Layout.fillWidth: true @@ -143,7 +146,7 @@ MultipageModal // Buttons footer: [ - DexAppButton + DefaultButton { text: qsTr("Cancel") Layout.preferredWidth: 220 @@ -154,7 +157,7 @@ MultipageModal Item { Layout.fillWidth: true }, - DexAppButton + DefaultButton { text: qsTr("Next") Layout.preferredWidth: 220 @@ -194,7 +197,7 @@ MultipageModal left_text: currentType.prefix } - DexLabel + DefaultText { visible: input_contract_address.visible Layout.fillWidth: true @@ -207,7 +210,7 @@ MultipageModal Layout.fillWidth: true color: 'transparent' - content: DexAnimatedImage + content: DefaultAnimatedImage { visible: input_contract_address.visible playing: root.visible && visible @@ -218,15 +221,17 @@ MultipageModal // Buttons footer: [ - DexAppButton + DefaultButton { text: qsTr("Previous") Layout.preferredWidth: 220 radius: 18 onClicked: root.previousPage() }, + Item { Layout.fillWidth: true }, - DexAppButton + + DefaultButton { text: qsTr("Next") Layout.preferredWidth: 220 @@ -243,7 +248,7 @@ MultipageModal { titleText: qsTr("Choose the asset logo") - DexAppButton + DefaultButton { Layout.fillWidth: true text: qsTr("Browse") + "..." @@ -255,7 +260,6 @@ MultipageModal id: input_logo property string path - readonly property bool enabled: true // Config preparation function searches for this title: qsTr("Please choose the asset logo") @@ -272,7 +276,7 @@ MultipageModal Layout.alignment: Qt.AlignHCenter color: 'transparent' - content: DexImage + content: DefaultImage { width: 300 height: width @@ -283,7 +287,7 @@ MultipageModal // Buttons footer: [ - DexAppButton + DefaultButton { text: qsTr("Previous") Layout.preferredWidth: 220 @@ -307,7 +311,7 @@ MultipageModal { titleText: qsTr("Configuration") - DexLabel + DefaultText { visible: has_contract_address Layout.fillWidth: true @@ -332,7 +336,7 @@ MultipageModal field.placeholderText: qsTr("Enter the Coingecko ID") } - DexLabel + DefaultText { visible: input_coingecko_id.visible Layout.fillWidth: true @@ -345,7 +349,7 @@ MultipageModal Layout.alignment: Qt.AlignHCenter color: 'transparent' - content: DexAnimatedImage + content: DefaultAnimatedImage { id: guide_coingecko_id visible: input_coingecko_id.visible @@ -370,7 +374,7 @@ MultipageModal footer: [ - DexAppButton + DefaultButton { text: qsTr("Previous") Layout.preferredWidth: 220 @@ -379,7 +383,7 @@ MultipageModal Item { Layout.fillWidth: true }, - PrimaryButton + DefaultButton { text: qsTr("Preview") Layout.fillWidth: true @@ -399,7 +403,7 @@ MultipageModal MultipageModalContent { titleText: qsTr("Preview") - DexLabel { + DefaultText { id: warning_message visible: coin_name.visible Layout.fillWidth: true @@ -413,7 +417,7 @@ MultipageModal Layout.fillWidth: true } - DexImage { + DefaultImage { Layout.alignment: Qt.AlignHCenter Layout.preferredWidth: 64 @@ -421,7 +425,7 @@ MultipageModal source: input_logo.path } - DexLabel { + DefaultText { id: error_text Layout.alignment: Qt.AlignHCenter Layout.fillWidth: true @@ -432,7 +436,7 @@ MultipageModal color: Style.colorRed } - DexLabel { + DefaultText { id: coin_name Layout.alignment: Qt.AlignHCenter visible: has_contract_address && !error_text.visible @@ -469,7 +473,7 @@ MultipageModal // Buttons footer: [ - DexAppButton { + DefaultButton { text: qsTr("Previous") Layout.preferredWidth: 220 onClicked: root.previousPage() diff --git a/atomic_defi_design/Dex/Sidebar/Bottom.qml b/atomic_defi_design/Dex/Sidebar/Bottom.qml index dd4c104d81..9bf85ad420 100644 --- a/atomic_defi_design/Dex/Sidebar/Bottom.qml +++ b/atomic_defi_design/Dex/Sidebar/Bottom.qml @@ -80,7 +80,6 @@ MouseArea id: privacyLine Layout.fillWidth: true - Layout.preferredHeight: privacySwitch.height label.text: qsTr("Privacy") label.visible: isExpanded @@ -90,14 +89,14 @@ MouseArea privacySwitch.checked = General.privacy_mode; } - DexSwitch + DefaultSwitch { id: privacySwitch anchors.left: parent.left anchors.leftMargin: 10 anchors.verticalCenter: parent.verticalCenter - scale: 0.60 + scale: 0.75 mouseArea.hoverEnabled: true onClicked: parent.clicked() diff --git a/atomic_defi_design/Dex/Wallet/EnableCoinModal.qml b/atomic_defi_design/Dex/Wallet/EnableCoinModal.qml index 03954d055c..386962b3e0 100644 --- a/atomic_defi_design/Dex/Wallet/EnableCoinModal.qml +++ b/atomic_defi_design/Dex/Wallet/EnableCoinModal.qml @@ -75,7 +75,7 @@ MultipageModal Layout.fillWidth: true Layout.preferredHeight: 24 - DexCheckBox + DefaultCheckBox { id: _selectAllCheckBox Layout.fillWidth: true @@ -96,7 +96,7 @@ MultipageModal HorizontalLine { Layout.topMargin: 5; Layout.alignment: Qt.AlignHCenter; Layout.fillWidth: true } - DexListView + DefaultListView { id: list visible: coin_cfg_model.all_disabled_proxy.length > 0 @@ -119,7 +119,7 @@ MultipageModal Layout.fillWidth: true Layout.preferredHeight: 24 - DexCheckBox + DefaultCheckBox { id: listInnerRowCheckbox readonly property bool backend_checked: model.checked @@ -150,7 +150,7 @@ MultipageModal spacing: 0 // Icon - DexImage + DefaultImage { id: icon Layout.leftMargin: 24 @@ -160,7 +160,7 @@ MultipageModal Layout.preferredHeight: 18 } - DexLabel + DefaultText { Layout.leftMargin: 4 Layout.alignment: Qt.AlignVCenter @@ -196,7 +196,7 @@ MultipageModal } } - DexMouseArea + DefaultMouseArea { anchors.fill: parent onClicked: listInnerRowCheckbox.checked = !listInnerRowCheckbox.checked @@ -210,7 +210,7 @@ MultipageModal Layout.fillWidth: true Layout.alignment: Qt.AlignHCenter - DexLabel + DefaultText { anchors.left: parent.left anchors.verticalCenter: parent.verticalCenter @@ -264,7 +264,7 @@ MultipageModal footer: [ - DexAppButton + DefaultButton { Layout.preferredWidth: 199 text: qsTr("Close") diff --git a/atomic_defi_design/Dex/Wallet/Main.qml b/atomic_defi_design/Dex/Wallet/Main.qml index acddf911c5..2ad15bb2f2 100644 --- a/atomic_defi_design/Dex/Wallet/Main.qml +++ b/atomic_defi_design/Dex/Wallet/Main.qml @@ -87,7 +87,7 @@ Item Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter } - DexLabel + DefaultText { id: ticker_name Layout.topMargin: 0 @@ -106,7 +106,7 @@ Item Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter spacing: 2 - DexLabel + DefaultText { id: balance_title Layout.alignment: Qt.AlignHCenter @@ -115,7 +115,7 @@ Item color: headerTitleColor } - DexLabel + DefaultText { id: name_value Layout.alignment: Qt.AlignHCenter @@ -142,17 +142,20 @@ Item visible: false //current_ticker_infos.segwit_supported Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter spacing: 2 - DexLabel + + DefaultText { text_value: qsTr("Segwit") Layout.alignment: Qt.AlignLeft font.pixelSize: headerTitleFont color: headerTitleColor } + DefaultSwitch { id: segwitSwitch Layout.alignment: Qt.AlignVCenter + onToggled: { if(parseFloat(current_ticker_infos.balance) > 0) { @@ -180,6 +183,7 @@ Item } } }, + onRejected: function () { app.segwit_on = true API.app.wallet_pg.post_switch_address_mode(!current_ticker_infos.is_segwit_on) @@ -212,7 +216,7 @@ Item Layout.rightMargin: 10 spacing: 5 - DexLabel + DefaultText { id: price text_value: qsTr("Price") @@ -221,7 +225,7 @@ Item font.pixelSize: headerTitleFont } - DexLabel + DefaultText { text_value: { @@ -242,7 +246,7 @@ Item Layout.rightMargin: 10 spacing: 5 - DexLabel + DefaultText { id: change_24hr text_value: qsTr("Change 24hr") @@ -251,7 +255,7 @@ Item font.pixelSize: headerTitleFont } - DexLabel + DefaultText { id: change_24hr_value Layout.alignment: Qt.AlignHCenter @@ -273,7 +277,7 @@ Item Layout.rightMargin: 10 spacing: 5 - DexLabel + DefaultText { id: portfolio_title text_value: qsTr("Porfolio") @@ -282,7 +286,7 @@ Item font.pixelSize: headerTitleFont } - DexLabel + DefaultText { Layout.alignment: Qt.AlignHCenter text_value: @@ -316,10 +320,12 @@ Item ColumnLayout { visible: General.coinContractAddress(api_wallet_page.ticker) !== "" + RowLayout { Layout.alignment: Qt.AlignLeft id: contract_title_row_layout + DefaultImage { id: protocol_img @@ -327,7 +333,8 @@ Item Layout.preferredHeight: 18 Layout.preferredWidth: Layout.preferredHeight } - DexLabel + + DefaultText { id: contract_address_title text_value: General.coinPlatform(api_wallet_page.ticker) + qsTr(" Contract Address") @@ -343,7 +350,8 @@ Item Layout.alignment: Qt.AlignLeft Layout.preferredHeight: General.coinContractAddress(api_wallet_page.ticker) ? headerSmallFont : 0 visible: General.coinContractAddress(api_wallet_page.ticker) !== "" - DexLabel + + DefaultText { id: contract_address text_value: General.coinContractAddress(api_wallet_page.ticker) @@ -353,12 +361,14 @@ Item elide: Text.ElideMiddle wrapMode: Text.NoWrap } + Qaterial.Icon { size: headerTextFont icon: Qaterial.Icons.linkVariant color: contract_linkArea.containsMouse ? headerTextColor : headerTitleColor visible: General.contractURL(api_wallet_page.ticker) != "" - DexMouseArea { + + DefaultMouseArea { id: contract_linkArea anchors.fill: parent hoverEnabled: true @@ -388,7 +398,7 @@ Item Layout.preferredHeight: 48 // Send Button - DexAppButton + DefaultButton { enabled: API.app.wallet_pg.send_available @@ -433,10 +443,12 @@ Item Component { id: enable_fees_coin_comp + MultipageModal { id: root width: 300 + MultipageModalContent { titleText: qsTr("Enable %1 ?").arg(coin_to_enable_ticker) @@ -447,6 +459,7 @@ Item { Layout.fillWidth: true text: qsTr("Yes") + onClicked: { if (API.app.enable_coin(coin_to_enable_ticker) === false) @@ -456,6 +469,7 @@ Item close() } } + DefaultButton { Layout.fillWidth: true @@ -481,7 +495,7 @@ Item } // Receive Button - DexAppButton + DefaultButton { Layout.preferredWidth: 180 Layout.preferredHeight: 48 @@ -516,7 +530,7 @@ Item Layout.preferredWidth: 180 Layout.preferredHeight: 48 - DexAppButton + DefaultButton { enabled: !API.app.portfolio_pg.global_cfg_mdl.get_coin_info(api_wallet_page.ticker).is_wallet_only anchors.fill: parent @@ -570,7 +584,7 @@ Item Item { Layout.fillWidth: true } - DexAppButton + DefaultButton { text: qsTr("Rewards") radius: 18 @@ -598,7 +612,7 @@ Item Layout.preferredHeight: 48 visible: enabled && current_ticker_infos.is_smartchain_test_coin - DexAppButton + DefaultButton { text: qsTr("Faucet") radius: 18 @@ -628,7 +642,7 @@ Item visible: current_ticker_infos.name === "Tokel" || current_ticker_infos.name === "Marmara Credit Loops" - DexAppButton + DefaultButton { text: qsTr("Public Key") radius: 18 @@ -828,13 +842,13 @@ Item scale: 0.5 } - DexLabel + DefaultText { text_value: qsTr("Loading market data") + "..." } } - DexLabel + DefaultText { visible: !parent.ticker_supported text_value: qsTr("There is no chart data for this ticker yet") diff --git a/atomic_defi_design/Dex/Wallet/SendModal.qml b/atomic_defi_design/Dex/Wallet/SendModal.qml index 836c60649b..ec4af9b964 100644 --- a/atomic_defi_design/Dex/Wallet/SendModal.qml +++ b/atomic_defi_design/Dex/Wallet/SendModal.qml @@ -284,7 +284,7 @@ MultipageModal color: input_address.background.color radius: input_address.background.radius - DexTextField + DefaultTextField { id: input_address @@ -307,7 +307,7 @@ MultipageModal color: addrbookIconMouseArea.containsMouse ? Dex.CurrentTheme.buttonColorHovered : "transparent" - DexMouseArea + DefaultMouseArea { id: addrbookIconMouseArea anchors.fill: parent @@ -316,7 +316,7 @@ MultipageModal } } - DexImage + DefaultImage { id: addrbookIcon anchors.right: parent.right @@ -342,7 +342,7 @@ MultipageModal Layout.alignment: Qt.AlignHCenter Layout.fillWidth: true - DexLabel + DefaultText { id: reason @@ -354,7 +354,7 @@ MultipageModal text_value: qsTr("The address has to be mixed case.") } - DexButton + DefaultButton { enabled: !root.is_send_busy visible: needFix @@ -393,7 +393,7 @@ MultipageModal } } - DexLabel + DefaultText { anchors.right: maxBut.left anchors.rightMargin: 10 @@ -414,13 +414,13 @@ MultipageModal radius: 7 color: maxButMouseArea.containsMouse ? Dex.CurrentTheme.buttonColorHovered : Dex.CurrentTheme.buttonColorEnabled - DexLabel + DefaultText { anchors.centerIn: parent text: qsTr("MAX") } - DexMouseArea + DefaultMouseArea { id: maxButMouseArea anchors.fill: parent @@ -448,7 +448,7 @@ MultipageModal Layout.alignment: Qt.AlignHCenter Layout.preferredWidth: 380 - DexLabel + DefaultText { id: equivalentAmount @@ -520,7 +520,7 @@ MultipageModal anchors.verticalCenter: parent.verticalCenter color: Dex.CurrentTheme.backgroundColor - DexLabel + DefaultText { id: fiat_symbol visible: _preparePage.cryptoSendMode && API.app.settings_pg.current_currency_sign != "KMD" @@ -529,7 +529,7 @@ MultipageModal text: API.app.settings_pg.current_currency_sign } - DexImage + DefaultImage { visible: !fiat_symbol.visible anchors.centerIn: parent @@ -539,7 +539,7 @@ MultipageModal } } - DexLabel + DefaultText { id: cryptoFiatSwitchText anchors.left: cryptoFiatSwitchIcon.right @@ -553,7 +553,7 @@ MultipageModal } } - DexMouseArea + DefaultMouseArea { id: cryptoFiatSwitchMouseArea anchors.fill: parent @@ -573,8 +573,9 @@ MultipageModal { Layout.preferredWidth: 380 Layout.alignment: Qt.AlignHCenter + // Custom fees switch - DexSwitch + DefaultSwitch { id: custom_fees_switch enabled: !root.is_send_busy @@ -582,8 +583,9 @@ MultipageModal label.text: qsTr("Enable Custom Fees") onCheckedChanged: input_custom_fees.text = "" } + // Custom fees warning - DexLabel + DefaultText { visible: custom_fees_switch.checked font.pixelSize: 14 @@ -650,7 +652,7 @@ MultipageModal } // Fee is higher than amount error - DexLabel + DefaultText { id: fee_error visible: feeIsHigherThanAmount() @@ -664,7 +666,7 @@ MultipageModal } // Not enough funds error - DexLabel + DefaultText { Layout.topMargin: 16 wrapMode: Text.Wrap @@ -683,7 +685,7 @@ MultipageModal Layout.alignment: Qt.AlignHCenter Layout.topMargin: 20 - DexButton + DefaultButton { text: qsTr("Close") @@ -786,7 +788,7 @@ MultipageModal send_result.withdraw_answer.date } - DexBusyIndicator + DefaultBusyIndicator { visible: root.is_broadcast_busy } @@ -794,11 +796,9 @@ MultipageModal // Buttons footer: [ - Item - { - Layout.fillWidth: true - }, - DexAppButton + Item { Layout.fillWidth: true }, + + DefaultButton { text: qsTr("Back") leftPadding: 40 @@ -807,10 +807,9 @@ MultipageModal onClicked: root.currentIndex = 0 enabled: !root.is_broadcast_busy }, - Item - { - Layout.fillWidth: true - }, + + Item { Layout.fillWidth: true }, + DexAppOutlineButton { text: qsTr("Send") @@ -820,10 +819,8 @@ MultipageModal radius: 18 enabled: !root.is_broadcast_busy }, - Item - { - Layout.fillWidth: true - } + + Item { Layout.fillWidth: true } ] } diff --git a/atomic_defi_design/Dex/Wallet/TransactionDetailsModal.qml b/atomic_defi_design/Dex/Wallet/TransactionDetailsModal.qml index e7aa9dfab3..3e02537010 100644 --- a/atomic_defi_design/Dex/Wallet/TransactionDetailsModal.qml +++ b/atomic_defi_design/Dex/Wallet/TransactionDetailsModal.qml @@ -27,7 +27,6 @@ MultipageModal MultipageModalContent { titleText: qsTr("Transaction Details") - Layout.preferredHeight: window.height - 50 // Amount TextEditWithTitle @@ -139,7 +138,7 @@ MultipageModal // Buttons footer: [ - DexButton + DefaultButton { Layout.fillWidth: true text: qsTr("Close") @@ -148,6 +147,7 @@ MultipageModal radius: 18 onClicked: root.close() }, + DexAppOutlineButton { Layout.fillWidth: true From 0b4efa93373c14adce62e6e4651abb3ae120553b Mon Sep 17 00:00:00 2001 From: smk762 Date: Wed, 11 May 2022 08:35:38 +0800 Subject: [PATCH 033/177] update version number and CI --- .github/workflows/atomicdex-desktop-ci.yml | 11 ++++++----- .github/workflows/atomicdex-desktop-release-vt.yml | 2 +- CMakeLists.txt | 2 +- ci_tools_atomic_dex/ci_scripts/osx_script.sh | 5 ++++- .../installer/osx/config/config.xml.in | 2 +- .../com.komodoplatform.atomicdex/meta/package.xml.in | 4 ++-- .../installer/windows/config/config.xml.in | 2 +- .../com.komodoplatform.atomicdex/meta/package.xml.in | 4 ++-- cmake/install/macos/dex_install.cmake | 4 ++-- src/core/atomicdex/version/version.hpp | 6 +++--- vcpkg.json | 2 +- 11 files changed, 24 insertions(+), 20 deletions(-) diff --git a/.github/workflows/atomicdex-desktop-ci.yml b/.github/workflows/atomicdex-desktop-ci.yml index eab7cc84b8..fd74175e39 100644 --- a/.github/workflows/atomicdex-desktop-ci.yml +++ b/.github/workflows/atomicdex-desktop-ci.yml @@ -57,16 +57,17 @@ jobs: ref: ${{ github.event.pull_request.head.sha }} submodules: 'true' - - - uses: actions/setup-python@v2 + - name: Setup Python + uses: actions/setup-python@v3 with: - python-version: '3.8' + python-version: '3.9' - name: Install QT (Linux) if: runner.os == 'Linux' uses: KomodoPlatform/install-qt-action@v2.14.0 with: version: ${{ matrix.qt }} + setup-python: 'false' host: 'linux' target: 'desktop' dir: '${{ github.workspace }}' @@ -79,6 +80,7 @@ jobs: uses: KomodoPlatform/install-qt-action@v2.14.0 with: version: ${{ matrix.qt }} + setup-python: 'false' host: 'mac' target: 'desktop' dir: '${{ github.workspace }}' @@ -358,5 +360,4 @@ jobs: name: ${{ env.artifact_name_installer }} path: ./bundled/windows/${{ env.DEX_PROJECT_NAME }}_installer.exe retention-days: 7 - - + diff --git a/.github/workflows/atomicdex-desktop-release-vt.yml b/.github/workflows/atomicdex-desktop-release-vt.yml index 9215686717..e259493783 100644 --- a/.github/workflows/atomicdex-desktop-release-vt.yml +++ b/.github/workflows/atomicdex-desktop-release-vt.yml @@ -10,7 +10,7 @@ jobs: steps: - name: VirusTotal Scan - uses: crazy-max/ghaction-virustotal@v2.2.1 + uses: crazy-max/ghaction-virustotal@v2.4.1 with: vt_api_key: ${{ secrets.VT_API_KEY }} github_token: ${{ github.token }} diff --git a/CMakeLists.txt b/CMakeLists.txt index eac6256686..99ab61e12e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,7 +11,7 @@ include(vcpkg_prerequisites) include(qt_prerequisites) include(cfg_hash) -project(${DEX_PROJECT_NAME} LANGUAGES CXX VERSION 0.5.5) +project(${DEX_PROJECT_NAME} LANGUAGES CXX VERSION 0.5.5a) message(STATUS "${PROJECT_NAME} is version ${PROJECT_VERSION}") include(cmake_default_options) diff --git a/ci_tools_atomic_dex/ci_scripts/osx_script.sh b/ci_tools_atomic_dex/ci_scripts/osx_script.sh index a9491921db..f78dc9d382 100755 --- a/ci_tools_atomic_dex/ci_scripts/osx_script.sh +++ b/ci_tools_atomic_dex/ci_scripts/osx_script.sh @@ -5,9 +5,12 @@ brew update brew tap-new $USER/local-nim brew extract --version=1.4.8 nim $USER/local-nim +brew unlink libtool +wget https://raw.githubusercontent.com/Homebrew/homebrew-core/0fbd6e24c4122e18ade1ec6c5916cb21de14f352/Formula/libtool.rb +brew install libtool.rb + brew install autoconf \ automake \ - libtool \ pkgconfig \ wget \ nim@1.4.8 \ diff --git a/ci_tools_atomic_dex/installer/osx/config/config.xml.in b/ci_tools_atomic_dex/installer/osx/config/config.xml.in index 94ce96cd9b..4a444353df 100644 --- a/ci_tools_atomic_dex/installer/osx/config/config.xml.in +++ b/ci_tools_atomic_dex/installer/osx/config/config.xml.in @@ -1,7 +1,7 @@ ${DEX_DISPLAY_NAME} - 0.5.5 + 0.5.5a ${DEX_DISPLAY_NAME} Installer ${DEX_WEBSITE} ${DEX_COMPANY} diff --git a/ci_tools_atomic_dex/installer/osx/packages/com.komodoplatform.atomicdex/meta/package.xml.in b/ci_tools_atomic_dex/installer/osx/packages/com.komodoplatform.atomicdex/meta/package.xml.in index 0f4899f2c3..4253626b27 100644 --- a/ci_tools_atomic_dex/installer/osx/packages/com.komodoplatform.atomicdex/meta/package.xml.in +++ b/ci_tools_atomic_dex/installer/osx/packages/com.komodoplatform.atomicdex/meta/package.xml.in @@ -2,8 +2,8 @@ ${DEX_DISPLAY_NAME} Install ${DEX_DISPLAY_NAME}. - 0.5.5 - 2021-12-06 + 0.5.5a + 2022-05-11 diff --git a/ci_tools_atomic_dex/installer/windows/config/config.xml.in b/ci_tools_atomic_dex/installer/windows/config/config.xml.in index 8b2c1c44d6..a045bd46a4 100644 --- a/ci_tools_atomic_dex/installer/windows/config/config.xml.in +++ b/ci_tools_atomic_dex/installer/windows/config/config.xml.in @@ -1,7 +1,7 @@ @DEX_DISPLAY_NAME@ - 0.5.5 + 0.5.5a @DEX_DISPLAY_NAME@ Installer @DEX_WEBSITE@ @DEX_COMPANY@ diff --git a/ci_tools_atomic_dex/installer/windows/packages/com.komodoplatform.atomicdex/meta/package.xml.in b/ci_tools_atomic_dex/installer/windows/packages/com.komodoplatform.atomicdex/meta/package.xml.in index 0f4899f2c3..4253626b27 100644 --- a/ci_tools_atomic_dex/installer/windows/packages/com.komodoplatform.atomicdex/meta/package.xml.in +++ b/ci_tools_atomic_dex/installer/windows/packages/com.komodoplatform.atomicdex/meta/package.xml.in @@ -2,8 +2,8 @@ ${DEX_DISPLAY_NAME} Install ${DEX_DISPLAY_NAME}. - 0.5.5 - 2021-12-06 + 0.5.5a + 2022-05-11 diff --git a/cmake/install/macos/dex_install.cmake b/cmake/install/macos/dex_install.cmake index 158c4f73aa..83bb1cdec1 100644 --- a/cmake/install/macos/dex_install.cmake +++ b/cmake/install/macos/dex_install.cmake @@ -4,8 +4,8 @@ if (APPLE) MACOSX_BUNDLE_BUNDLE_NAME "${PROJECT_NAME}" RESOURCE ${ICON} MACOSX_BUNDLE_ICON_FILE dex-logo - MACOSX_BUNDLE_SHORT_VERSION_STRING 0.5.5 - MACOSX_BUNDLE_LONG_VERSION_STRING 0.5.5 + MACOSX_BUNDLE_SHORT_VERSION_STRING 0.5.5a + MACOSX_BUNDLE_LONG_VERSION_STRING 0.5.5a MACOSX_BUNDLE_INFO_PLIST "${PROJECT_SOURCE_DIR}/cmake/MacOSXBundleInfo.plist.in") add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD COMMAND diff --git a/src/core/atomicdex/version/version.hpp b/src/core/atomicdex/version/version.hpp index 168d93b7eb..6040522c5d 100644 --- a/src/core/atomicdex/version/version.hpp +++ b/src/core/atomicdex/version/version.hpp @@ -21,7 +21,7 @@ namespace atomic_dex constexpr const char* get_version() { - return "0.5.5-beta"; + return "0.5.5a-beta"; } constexpr int @@ -33,12 +33,12 @@ namespace atomic_dex constexpr const char* get_raw_version() { - return "0.5.5"; + return "0.5.5a"; } constexpr const char* get_precedent_raw_version() { - return "0.5.4"; + return "0.5.5"; } } // namespace atomic_dex diff --git a/vcpkg.json b/vcpkg.json index 040a73da17..2a171a37bb 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -1,6 +1,6 @@ { "name": "atomicdex-desktop", - "version-string": "0.5.5", + "version-string": "0.5.5a", "dependencies": [ "entt", "boost-multiprecision", From 8ce15436cdaa03499d47be6bf8795989b3513c1f Mon Sep 17 00:00:00 2001 From: Kadan Stadelmann Date: Wed, 11 May 2022 03:46:19 +0200 Subject: [PATCH 034/177] update version (format) --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 99ab61e12e..d8477fcd1c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,7 +11,7 @@ include(vcpkg_prerequisites) include(qt_prerequisites) include(cfg_hash) -project(${DEX_PROJECT_NAME} LANGUAGES CXX VERSION 0.5.5a) +project(${DEX_PROJECT_NAME} LANGUAGES CXX VERSION 0.5.5.1) message(STATUS "${PROJECT_NAME} is version ${PROJECT_VERSION}") include(cmake_default_options) From aaed641d0c4ce065778a16c9724075c301778687 Mon Sep 17 00:00:00 2001 From: smk762 <35845239+smk762@users.noreply.github.com> Date: Wed, 11 May 2022 15:57:32 +0800 Subject: [PATCH 035/177] Rename 0.5.5-coins.json to 0.5.5.1-coins.json --- assets/config/{0.5.5-coins.json => 0.5.5.1-coins.json} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename assets/config/{0.5.5-coins.json => 0.5.5.1-coins.json} (100%) diff --git a/assets/config/0.5.5-coins.json b/assets/config/0.5.5.1-coins.json similarity index 100% rename from assets/config/0.5.5-coins.json rename to assets/config/0.5.5.1-coins.json From 693bb9d38a24f0a08ce1ea96b39e8362646860d8 Mon Sep 17 00:00:00 2001 From: smk762 Date: Wed, 11 May 2022 16:03:28 +0800 Subject: [PATCH 036/177] version format --- ci_tools_atomic_dex/installer/osx/config/config.xml.in | 2 +- .../packages/com.komodoplatform.atomicdex/meta/package.xml.in | 2 +- ci_tools_atomic_dex/installer/windows/config/config.xml.in | 2 +- .../packages/com.komodoplatform.atomicdex/meta/package.xml.in | 2 +- cmake/install/macos/dex_install.cmake | 4 ++-- src/core/atomicdex/version/version.hpp | 4 ++-- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ci_tools_atomic_dex/installer/osx/config/config.xml.in b/ci_tools_atomic_dex/installer/osx/config/config.xml.in index 4a444353df..44f7e2a80e 100644 --- a/ci_tools_atomic_dex/installer/osx/config/config.xml.in +++ b/ci_tools_atomic_dex/installer/osx/config/config.xml.in @@ -1,7 +1,7 @@ ${DEX_DISPLAY_NAME} - 0.5.5a + 0.5.5.1 ${DEX_DISPLAY_NAME} Installer ${DEX_WEBSITE} ${DEX_COMPANY} diff --git a/ci_tools_atomic_dex/installer/osx/packages/com.komodoplatform.atomicdex/meta/package.xml.in b/ci_tools_atomic_dex/installer/osx/packages/com.komodoplatform.atomicdex/meta/package.xml.in index 4253626b27..dacaa60bda 100644 --- a/ci_tools_atomic_dex/installer/osx/packages/com.komodoplatform.atomicdex/meta/package.xml.in +++ b/ci_tools_atomic_dex/installer/osx/packages/com.komodoplatform.atomicdex/meta/package.xml.in @@ -2,7 +2,7 @@ ${DEX_DISPLAY_NAME} Install ${DEX_DISPLAY_NAME}. - 0.5.5a + 0.5.5.1 2022-05-11 diff --git a/ci_tools_atomic_dex/installer/windows/config/config.xml.in b/ci_tools_atomic_dex/installer/windows/config/config.xml.in index a045bd46a4..2c2e2a3e2e 100644 --- a/ci_tools_atomic_dex/installer/windows/config/config.xml.in +++ b/ci_tools_atomic_dex/installer/windows/config/config.xml.in @@ -1,7 +1,7 @@ @DEX_DISPLAY_NAME@ - 0.5.5a + 0.5.5.1 @DEX_DISPLAY_NAME@ Installer @DEX_WEBSITE@ @DEX_COMPANY@ diff --git a/ci_tools_atomic_dex/installer/windows/packages/com.komodoplatform.atomicdex/meta/package.xml.in b/ci_tools_atomic_dex/installer/windows/packages/com.komodoplatform.atomicdex/meta/package.xml.in index 4253626b27..dacaa60bda 100644 --- a/ci_tools_atomic_dex/installer/windows/packages/com.komodoplatform.atomicdex/meta/package.xml.in +++ b/ci_tools_atomic_dex/installer/windows/packages/com.komodoplatform.atomicdex/meta/package.xml.in @@ -2,7 +2,7 @@ ${DEX_DISPLAY_NAME} Install ${DEX_DISPLAY_NAME}. - 0.5.5a + 0.5.5.1 2022-05-11 diff --git a/cmake/install/macos/dex_install.cmake b/cmake/install/macos/dex_install.cmake index 83bb1cdec1..aa4e9bdc05 100644 --- a/cmake/install/macos/dex_install.cmake +++ b/cmake/install/macos/dex_install.cmake @@ -4,8 +4,8 @@ if (APPLE) MACOSX_BUNDLE_BUNDLE_NAME "${PROJECT_NAME}" RESOURCE ${ICON} MACOSX_BUNDLE_ICON_FILE dex-logo - MACOSX_BUNDLE_SHORT_VERSION_STRING 0.5.5a - MACOSX_BUNDLE_LONG_VERSION_STRING 0.5.5a + MACOSX_BUNDLE_SHORT_VERSION_STRING 0.5.5.1 + MACOSX_BUNDLE_LONG_VERSION_STRING 0.5.5.1 MACOSX_BUNDLE_INFO_PLIST "${PROJECT_SOURCE_DIR}/cmake/MacOSXBundleInfo.plist.in") add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD COMMAND diff --git a/src/core/atomicdex/version/version.hpp b/src/core/atomicdex/version/version.hpp index 6040522c5d..8b36d23837 100644 --- a/src/core/atomicdex/version/version.hpp +++ b/src/core/atomicdex/version/version.hpp @@ -21,7 +21,7 @@ namespace atomic_dex constexpr const char* get_version() { - return "0.5.5a-beta"; + return "0.5.5.1-beta"; } constexpr int @@ -33,7 +33,7 @@ namespace atomic_dex constexpr const char* get_raw_version() { - return "0.5.5a"; + return "0.5.5.1"; } constexpr const char* From abc54d9a25dd9750a2595f3e9299a95053f9c97f Mon Sep 17 00:00:00 2001 From: smk762 Date: Wed, 11 May 2022 17:12:30 +0800 Subject: [PATCH 037/177] update submodules --- ci_tools_atomic_dex/vcpkg-custom-ports | 2 +- ci_tools_atomic_dex/vcpkg-repo | 2 +- vcpkg.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ci_tools_atomic_dex/vcpkg-custom-ports b/ci_tools_atomic_dex/vcpkg-custom-ports index 19453b682d..15ad59b292 160000 --- a/ci_tools_atomic_dex/vcpkg-custom-ports +++ b/ci_tools_atomic_dex/vcpkg-custom-ports @@ -1 +1 @@ -Subproject commit 19453b682d43a354235b20809f59761d899a50ee +Subproject commit 15ad59b2928caaaac104702ee5b46d0ae5c3da71 diff --git a/ci_tools_atomic_dex/vcpkg-repo b/ci_tools_atomic_dex/vcpkg-repo index 63e935d967..086ef2a484 160000 --- a/ci_tools_atomic_dex/vcpkg-repo +++ b/ci_tools_atomic_dex/vcpkg-repo @@ -1 +1 @@ -Subproject commit 63e935d967a3410e26bf4a708efa39d8384d2bbb +Subproject commit 086ef2a4845fd12e5164df1876737afa67942208 diff --git a/vcpkg.json b/vcpkg.json index 2a171a37bb..f19d064d78 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -1,6 +1,6 @@ { "name": "atomicdex-desktop", - "version-string": "0.5.5a", + "version-string": "0.5.5.1", "dependencies": [ "entt", "boost-multiprecision", From c6f6e36500650b3e22d6426b9c837838038c3a53 Mon Sep 17 00:00:00 2001 From: syl Date: Wed, 11 May 2022 19:28:15 +0200 Subject: [PATCH 038/177] QML: Add components to Dex.Components module --- atomic_defi_design/Dex/Components/qmldir | 2 ++ 1 file changed, 2 insertions(+) diff --git a/atomic_defi_design/Dex/Components/qmldir b/atomic_defi_design/Dex/Components/qmldir index 3c93e2fe34..b11766c74a 100644 --- a/atomic_defi_design/Dex/Components/qmldir +++ b/atomic_defi_design/Dex/Components/qmldir @@ -6,10 +6,12 @@ ClickableText 1.0 ClickableText.qml GradientButton 1.0 GradientButton.qml Image 1.0 DefaultImage.qml ListView 1.0 DefaultListView.qml +MouseArea 1.0 DefaultMouseArea.qml MultipageModal 1.0 MultipageModal.qml MultipageModalContent 1.0 MultipageModalContent.qml Popup 1.0 DefaultPopup.qml Rectangle 1.0 DefaultRectangle.qml +ScrollView 1.0 DefaultScrollView.qml SearchField 1.0 SearchField.qml Text 1.0 DefaultText.qml TextField 1.0 DefaultTextField.qml From ac2209fc73a798a4629435c4e2db8ddc3441afea Mon Sep 17 00:00:00 2001 From: syl Date: Wed, 11 May 2022 19:28:39 +0200 Subject: [PATCH 039/177] Update addressbook frontend --- .../Dex/Addressbook/AddAddressForm.qml | 44 +++- .../Dex/Addressbook/AddTagPopup.qml | 60 +++++ .../Dex/Addressbook/EditContactModal.qml | 210 +++++++++++++++--- atomic_defi_design/Dex/Addressbook/Main.qml | 24 +- 4 files changed, 298 insertions(+), 40 deletions(-) create mode 100644 atomic_defi_design/Dex/Addressbook/AddTagPopup.qml diff --git a/atomic_defi_design/Dex/Addressbook/AddAddressForm.qml b/atomic_defi_design/Dex/Addressbook/AddAddressForm.qml index afccc6b4ee..d20d687d4e 100644 --- a/atomic_defi_design/Dex/Addressbook/AddAddressForm.qml +++ b/atomic_defi_design/Dex/Addressbook/AddAddressForm.qml @@ -10,9 +10,13 @@ import "../Constants" as Dex Dex.Rectangle { - property bool editionMode: false - property var contactModel - property var oldAddressModel // Used as a temp dump in edition mode + property var contactModel + + // Edition mode variables + property bool editionMode: false + property string addressType + property string addressKey + property string addressValue signal cancel() signal addressCreated() @@ -21,6 +25,32 @@ Dex.Rectangle height: 302 radius: 10 + onVisibleChanged: + { + if (!visible) + { + // Resets data when address is added/edited. + addressTypeComboBox.currentIndex = 0 + addressKeyField.text = "" + addressValueField.text = "" + editionMode = false + addressType = "" + addressKey = "" + addressValue = "" + } + else if (editionMode) + { + // Feeds form with the data we are currently editing. + var indexLis = + Dex.API.app.portfolio_pg.portfolio_mdl.match( + Dex.API.app.portfolio_pg.portfolio_mdl.index(0, 0), + 33, addressType) + addressKeyField.text = addressKey + addressValueField.text = addressValue + console.log(indexLis) + } + } + ColumnLayout { anchors.fill: parent @@ -157,13 +187,13 @@ Dex.Rectangle Dex.GradientButton { - property bool isConvertMode: Dex.API.app.wallet_pg.validate_address_data.convertible + property bool isConvertMode: Dex.API.app.wallet_pg.validate_address_data.convertible ?? false enabled: addressKeyField.length > 0 && addressValueField.length > 0 && !Dex.API.app.wallet_pg.validate_address_busy Layout.preferredWidth: 116 Layout.preferredHeight: 38 radius: 18 - text: isConvertMode ? qsTr("Convert") : qsTr("Add") + text: isConvertMode ? qsTr("Convert") : editionMode ? qsTr("Edit") : qsTr("Add") onClicked: { if (isConvertMode) @@ -183,7 +213,7 @@ Dex.Rectangle { if (Dex.API.app.wallet_pg.convert_address_busy) // Currently converting entered address { - return; + return } addressValueField.text = API.app.wallet_pg.converted_address @@ -206,7 +236,7 @@ Dex.Rectangle if (editionMode) // Removes old address entry before if we are in edition mode. { - contactModel.removeAddressEntry(oldWalletType, oldKey); + contactModel.removeAddressEntry(addressType, addressKey); } var createAddressResult = contactModel.addAddressEntry(addressTypeComboBox.currentText, addressKeyField.text, addressValueField.text); diff --git a/atomic_defi_design/Dex/Addressbook/AddTagPopup.qml b/atomic_defi_design/Dex/Addressbook/AddTagPopup.qml new file mode 100644 index 0000000000..0e53be333c --- /dev/null +++ b/atomic_defi_design/Dex/Addressbook/AddTagPopup.qml @@ -0,0 +1,60 @@ +// Qt Imports +import QtQuick 2.15 +import QtQuick.Layouts 1.15 + +// Project Imports +import "../Constants" +import Dex.Components 1.0 as Dex + +Dex.Popup +{ + id: root + + width: 250 + height: 55 + + onClosed: tagNameField.text = "" + + contentItem: Row + { + spacing: 4 + + Dex.TextField + { + id: tagNameField + width: parent.width * 0.6 + height: parent.height + placeholderText: qsTr("Tag name") + + Dex.ToolTip + { + id: tagAlreadyTakenToolTip + visible: false + timeout: 3000 + contentItem: Dex.Text + { + text_value: qsTr("Contact already has this tag.") + } + } + } + + Dex.Button + { + width: parent.width * 0.36 + height: parent.height + text: qsTr("+ ADD") + onClicked: + { + if (tagNameField.text.length === 0) + { + return + } + + var addTagResult = contactModel.addCategory(tagNameField.text) + + if (addTagResult === false) tagAlreadyTakenToolTip.visible = true + else root.close() + } + } + } +} diff --git a/atomic_defi_design/Dex/Addressbook/EditContactModal.qml b/atomic_defi_design/Dex/Addressbook/EditContactModal.qml index 40a3fcd43f..8d392a9f12 100644 --- a/atomic_defi_design/Dex/Addressbook/EditContactModal.qml +++ b/atomic_defi_design/Dex/Addressbook/EditContactModal.qml @@ -1,6 +1,8 @@ import QtQuick 2.12 import QtQuick.Layouts 1.15 +import Qaterial 1.0 as Qaterial + import Dex.Themes 1.0 as Dex import Dex.Components 1.0 as Dex import "../Constants" as Dex @@ -45,43 +47,145 @@ Dex.MultipageModal visible: !addressList.contactAddAddressMode model: contactModel.proxyFilter spacing: 20 - height: contentHeight > 380 ? 380 : contentHeight + height: contentHeight > 190 ? 190 : contentHeight width: parent.width - delegate: ColumnLayout + delegate: Dex.MouseArea { - property var coinInfo: Dex.API.app.portfolio_pg.global_cfg_mdl.get_coin_info(address_type) + id: addressRowMouseArea + height: 82 + width: addressList.width - 10 + hoverEnabled: true - Row + Dex.Rectangle { - spacing: 10 - Dex.Image - { - anchors.verticalCenter: parent.verticalCenter - width: 25 - height: 25 - source: Dex.General.coinIcon(parent.parent.coinInfo.ticker) - } + visible: parent.containsMouse + anchors.fill: parent + radius: 17 + color: Dex.CurrentTheme.accentColor + } - Dex.Text + Item + { + anchors.fill: parent + anchors.verticalCenter: parent.verticalCenter + anchors.margins: 10 + + ColumnLayout { - anchors.verticalCenter: parent.verticalCenter - text: address_type + property var coinInfo: Dex.API.app.portfolio_pg.global_cfg_mdl.get_coin_info(address_type) + + Row + { + spacing: 10 + Dex.Image + { + anchors.verticalCenter: parent.verticalCenter + width: 25 + height: 25 + source: Dex.General.coinIcon(parent.parent.coinInfo.ticker) + } + + Dex.Text + { + anchors.verticalCenter: parent.verticalCenter + text: address_type + } + + Dex.Text + { + anchors.verticalCenter: parent.verticalCenter + text: parent.parent.coinInfo.type + color: Dex.Style.getCoinTypeColor(parent.parent.coinInfo.type) + font: Dex.DexTypo.overLine + } + + Dex.Button + { + visible: addressRowMouseArea.containsMouse + anchors.verticalCenter: parent.verticalCenter + width: 9 + height: 9 + color: "transparent" + iconSource: Qaterial.Icons.close + onClicked: contactModel.removeAddressEntry(address_type, address_key) + } + } + + Dex.Text + { + Layout.leftMargin: 36 + Layout.maximumWidth: 330 + text: address_key + font: Dex.DexTypo.caption + elide: Text.ElideRight + } + + Dex.Text + { + Layout.leftMargin: 36 + Layout.maximumWidth: 330 + text: address_value + font: Dex.DexTypo.caption + elide: Text.ElideRight + + Dex.Button + { + width: 18 + height: 20 + anchors.verticalCenter: parent.verticalCenter + anchors.left: parent.right + anchors.leftMargin: 3 + color: "transparent" + iconSource: Qaterial.Icons.contentCopy + + onClicked: + { + Dex.API.qt_utilities.copy_text_to_clipboard(address_value) + app.notifyCopy(qsTr("Address Book"), qsTr("address copied to clipboard")) + } + } + } } - Dex.Text + Row { + anchors.right: parent.right anchors.verticalCenter: parent.verticalCenter - text: parent.parent.coinInfo.type - color: Dex.Style.getCoinTypeColor(parent.parent.coinInfo.type) - font: Dex.DexTypo.overLine - } - } + spacing: 20 - Dex.Text - { - Layout.leftMargin: 30 - text: "%1 : %2".arg(address_key).arg(address_value) + Dex.ClickableText + { + anchors.verticalCenter: parent.verticalCenter + visible: addressRowMouseArea.containsMouse + text: qsTr("Edit") + font.underline: true + onClicked: + { + addAddressForm.editionMode = true + addAddressForm.addressType = address_type + addAddressForm.addressKey = address_key + addAddressForm.addressValue = address_value + addressList.contactAddAddressMode = true + } + } + + Dex.Button + { + anchors.verticalCenter: parent.verticalCenter + width: 37 + height: 37 + radius: 18.5 + visible: addressRowMouseArea.containsMouse + iconSource: Qaterial.Icons.sendOutline + onClicked: + { + Dex.API.app.wallet_pg.ticker = address_type + sendModalLoader.address = address_value + sendModalLoader.open() + } + } + } } } } @@ -99,6 +203,7 @@ Dex.MultipageModal AddAddressForm { + id: addAddressForm visible: addressList.contactAddAddressMode contactModel: root.contactModel onCancel: addressList.contactAddAddressMode = false @@ -116,24 +221,65 @@ Dex.MultipageModal text: qsTr("Tags") } - Flow + Dex.ListView { - Layout.fillWidth: true - - Repeater + width: parent.width + model: contactModel.categories + orientation: Qt.Horizontal + spacing: 6 + delegate: Dex.MouseArea { - model: contactModel.categories + width: tagBg.width + tagRemoveBut.width + 2 + height: tagBg.height + hoverEnabled: true - Dex.Button + Dex.Rectangle { + id: tagBg + anchors.verticalCenter: parent.verticalCenter + width: tagLabel.width + 12 + height: 21 + radius: 20 + color: Dex.CurrentTheme.accentColor + Dex.Text + { + id: tagLabel + anchors.centerIn: parent + text: modelData + } + } + + Dex.Button + { + id: tagRemoveBut + visible: parent.containsMouse + anchors.left: tagBg.right + anchors.leftMargin: 2 + anchors.verticalCenter: parent.verticalCenter + width: 18 + height: 18 + color: "transparent" + iconSource: Qaterial.Icons.close + onClicked: contactModel.removeCategory(modelData) } } } - Dex.ClickableText + Dex.Button { + iconSource: Qaterial.Icons.plus text: qsTr("Add tag") + font: Dex.DexTypo.body2 + color: "transparent" + onClicked: addTagPopup.open() + + AddTagPopup + { + y: -10 + x: parent.width + 10 + id: addTagPopup + } } } diff --git a/atomic_defi_design/Dex/Addressbook/Main.qml b/atomic_defi_design/Dex/Addressbook/Main.qml index 58360f024b..c05430553f 100644 --- a/atomic_defi_design/Dex/Addressbook/Main.qml +++ b/atomic_defi_design/Dex/Addressbook/Main.qml @@ -105,6 +105,8 @@ Item { id: expandable + property color _tagBgColor: index % 2 !== 0 ? Dex.CurrentTheme.innerBackgroundColor : Dex.CurrentTheme.backgroundColor + padding: 12 color: index % 2 === 0 ? Dex.CurrentTheme.innerBackgroundColor : Dex.CurrentTheme.backgroundColor width: contactTable.width @@ -155,8 +157,10 @@ Item Flow { + anchors.verticalCenter: parent.verticalCenter x: parent.width * 0.3 width: parent.width * 0.57 + spacing: 17 Repeater { @@ -164,8 +168,26 @@ Item delegate: Dex.Rectangle { - width: 83 + width: tagLabel.width > 73 ? 83 : tagLabel.width + 10 height: 21 + radius: 20 + color: expandable._tagBgColor + + Dex.MouseArea + { + anchors.fill: parent + onClicked: searchbar.textField.text = modelData + } + + Dex.Text + { + id: tagLabel + width: 70 + anchors.centerIn: parent + text: modelData + horizontalAlignment: Text.AlignHCenter + elide: Text.ElideRight + } } } } From 729b70175ffb7de04cfed515733f8ca13749bce3 Mon Sep 17 00:00:00 2001 From: syl Date: Wed, 11 May 2022 19:30:18 +0200 Subject: [PATCH 040/177] QML: Remove old addressbook stuff --- atomic_defi_design/Dex/Wallet/AddressBook.qml | 292 --------- .../AddressBookAddContactAddressModal.qml | 211 ------ .../Wallet/AddressBookEditContactModal.qml | 601 ------------------ .../AddressBookNewContactCategoryModal.qml | 77 --- .../Wallet/AddressBookSendWalletSelector.qml | 42 -- .../Dex/Wallet/AddressBookWalletTypeList.qml | 143 ----- .../Wallet/AddressBookWalletTypeListModal.qml | 137 ---- .../Wallet/AddressBookWalletTypeListRow.qml | 34 - 8 files changed, 1537 deletions(-) delete mode 100644 atomic_defi_design/Dex/Wallet/AddressBook.qml delete mode 100644 atomic_defi_design/Dex/Wallet/AddressBookAddContactAddressModal.qml delete mode 100644 atomic_defi_design/Dex/Wallet/AddressBookEditContactModal.qml delete mode 100644 atomic_defi_design/Dex/Wallet/AddressBookNewContactCategoryModal.qml delete mode 100644 atomic_defi_design/Dex/Wallet/AddressBookSendWalletSelector.qml delete mode 100644 atomic_defi_design/Dex/Wallet/AddressBookWalletTypeList.qml delete mode 100644 atomic_defi_design/Dex/Wallet/AddressBookWalletTypeListModal.qml delete mode 100644 atomic_defi_design/Dex/Wallet/AddressBookWalletTypeListRow.qml diff --git a/atomic_defi_design/Dex/Wallet/AddressBook.qml b/atomic_defi_design/Dex/Wallet/AddressBook.qml deleted file mode 100644 index a901b762b8..0000000000 --- a/atomic_defi_design/Dex/Wallet/AddressBook.qml +++ /dev/null @@ -1,292 +0,0 @@ -// Qt Imports -import QtQuick 2.15 -import QtQuick.Layouts 1.15 -import QtQuick.Controls 2.15 -import QtGraphicalEffects 1.0 - -// Deps Imports -import Qaterial 1.0 as Qaterial - -// Project Imports -import "../Components" -import "../Constants" -import App 1.0 - -ColumnLayout { - id: root - Layout.fillWidth: true - Layout.fillHeight: true - //spacing: 20 - - Layout.rightMargin: 10 - Layout.leftMargin: 10 - readonly property var addressbook_pg: API.app.addressbook_pg - - // Page header - Item { - Layout.fillWidth: true - Layout.preferredHeight: 80 - - - DexLabel { // Title - anchors.verticalCenter: parent.verticalCenter - anchors.left: parent.left - anchors.leftMargin: 10 - text_value: qsTr("Address Book") - font: DexTypo.head6 - } - - DexGradientAppButton { - - anchors.right: parent.right - anchors.rightMargin: 10 - anchors.verticalCenter: parent.verticalCenter - iconSource: Qaterial.Icons.textBoxPlus - radius: 40 - leftPadding: 5 - rightPadding: 5 - padding: 16 - text: qsTr("New Contact") - onClicked: new_contact_modal.open() - } - } - - Item { - Layout.fillWidth: true - Layout.preferredHeight: 60 - DexRectangle { - anchors.verticalCenter: parent.verticalCenter - width: 300 - opacity: enabled ? 1 : .5 - height: 50 - radius: 20 - x: 10 - color: DexTheme.contentColorTop - DefaultTextField { - id: searchbar - anchors.fill: parent - anchors.margins: 2 - function reset() { - searchbar.text = "" - } - Qaterial.Icon { - icon: Qaterial.Icons.magnify - color: searchbar.color - anchors.verticalCenter: parent.verticalCenter - x: 5 - } - leftPadding: 40 - placeholderText: qsTr("Search a contact by name or tags") - - font: DexTypo.body2 - onTextChanged: addressbook_pg.model.proxy.search_exp = text - Component.onDestruction: addressbook_pg.model.proxy.search_exp = "" - background: null - } - } - } - - // Contact List Header - Item { - Layout.fillWidth: true - Layout.preferredHeight: 40 - Layout.rightMargin: 10 - Layout.leftMargin: 10 - - - DexLabel { - id: header_name_column - anchors.left: parent.left - anchors.leftMargin: 20 - anchors.verticalCenter: parent.verticalCenter - font.bold: true - text: qsTr("Name") - } - - DexLabel { - id: header_tags_column - anchors.left: header_name_column.right - anchors.leftMargin: 180 - anchors.verticalCenter: parent.verticalCenter - font.bold: true - text: qsTr("Tags (first 6)") - } - - DexLabel { - anchors.right: parent.right - anchors.rightMargin: parent.width * 0.138 - anchors.verticalCenter: parent.verticalCenter - font.bold: true - text: qsTr("Actions") - } - - HorizontalLine { - width: parent.width - color: Style.colorWhite5 - anchors.bottom: parent.bottom - } - } - - // Contact List - DefaultListView { - id: contact_list - Layout.fillWidth: true - Layout.fillHeight: true - - Layout.rightMargin: 10 - Layout.leftMargin: 10 - - model: addressbook_pg.model.proxy - - // Contact Card - delegate: AnimatedRectangle { - id: contact_card - - property var contact: modelData - - color: Qt.lighter(index % 2 == 0 ? DexTheme.backgroundColor : DexTheme.surfaceColor, 1.0) - width: root.width - height: 55 - - DefaultText { // Contact Name - id: contact_name - anchors.left: parent.left - anchors.leftMargin: 20 - anchors.verticalCenter: parent.verticalCenter - - width: 160 - - text: modelData.name - elide: Text.ElideRight - } - - VerticalLine { - anchors.left: contact_name.right - anchors.leftMargin: 25 - height: parent.height - width: 1 - } - - Flow { // Contact First 6 Tags - id: contact_tags_list - flow: GridLayout.LeftToRight - - readonly property int length: 6 // Number of displayed tags - readonly property int tagButtonWidth: 150 // Width of a tag button - - width: length * tagButtonWidth - - anchors.left: contact_name.right - anchors.leftMargin: 50 - anchors.verticalCenter: parent.verticalCenter - - Repeater { - model: contact_card.contact.categories - - delegate: Qaterial.OutlineButton { - width: contact_tags_list.tagButtonWidth - visible: index < contact_tags_list.length && index < contact_card.contact.categories.length - outlined: false - text: modelData - icon.source: Qaterial.Icons.tag - //elide: Text.ElideRight - - onClicked: searchbar.text = modelData - } - } - } - - VerticalLine { - anchors.right: edit_contact_button.left - anchors.rightMargin: 30 - height: parent.height - width: 1 - } - - DefaultButton { // Edit Button - id: edit_contact_button - - anchors.right: remove_contact_button.left - anchors.rightMargin: 5 - anchors.verticalCenter: parent.verticalCenter - - text: qsTr("Edit") - font.pixelSize: Style.textSizeSmall3 - width: 120 - - onClicked: { - edit_contact_modal.contactModel = modelData - edit_contact_modal.open() - } - } - - DangerButton { // Remove Button - id: remove_contact_button - - anchors.right: parent.right - anchors.rightMargin: 30 - anchors.verticalCenter: parent.verticalCenter - - text: qsTr("Remove") - font.pixelSize: Style.textSizeSmall3 - width: 120 - - onClicked: { - remove_contact_modal.contactName = modelData.name - remove_contact_modal.open() - } - } - } - - - // Create Contact Modal - ModalLoader { - id: new_contact_modal - sourceComponent: AddressBookNewContactModal {} - } - - // Edit Contact Modal - ModalLoader { - id: edit_contact_modal - - property var contactModel - - onLoaded: item.contactModel = contactModel - - sourceComponent: AddressBookEditContactModal {} - } - - // Delete Contact Modal - ModalLoader { - property string contactName - - id: remove_contact_modal - - sourceComponent: MultipageModal { - width: 500 - - MultipageModalContent { - Layout.fillWidth: true - titleText: qsTr("Do you want to remove this contact ?") - - RowLayout { - DangerButton { - text: qsTr("Yes") - - onClicked: { - remove_contact_modal.close() - addressbook_pg.model.remove_contact(contactName) - } - } - - DefaultButton { - text: qsTr("No") - - onClicked: remove_contact_modal.close() - } - } - } - } - } - } -} diff --git a/atomic_defi_design/Dex/Wallet/AddressBookAddContactAddressModal.qml b/atomic_defi_design/Dex/Wallet/AddressBookAddContactAddressModal.qml deleted file mode 100644 index adb9f3629f..0000000000 --- a/atomic_defi_design/Dex/Wallet/AddressBookAddContactAddressModal.qml +++ /dev/null @@ -1,211 +0,0 @@ -// Qt Imports -import QtQuick 2.15 -import QtQuick.Layouts 1.15 -import QtQuick.Controls 2.15 //> ToolTip - -// Project Imports -import "../Constants" -import App 1.0 -import "../Components" -import Dex.Themes 1.0 as Dex - -// Contact address entry creation/edition modal -MultipageModal -{ - id: root - - property var contactModel - - // Address Creation (false) or Edition (true) mode. - property bool isEdition: false - - property alias walletType: wallet_type_list_modal.selected_wallet_type // The selected wallet type that will be associated this new address entry. - property alias key: contact_new_address_key.text // The entered key that will be associated to this new address entry. - property alias value: contact_new_address_value.text // The entered address value that will be associated to this new address entry. - - // These properties are required in edition mode since we need to wipe out old address entry. - property string oldWalletType - property string oldKey - property string oldValue - - function retrieveWalletTypeTicker() - { - switch (walletType) - { - case "QRC-20": return "QTUM"; - case "BEP-20": return "BNB"; - case "ERC-20": return "ETH"; - case "Smart Chain": return "KMD"; - case "SLP": return "BCH"; - } - - let coinInfo = API.app.portfolio_pg.global_cfg_mdl.get_coin_info(walletType); - if (coinInfo.has_parent_fees_ticker) - return coinInfo.fees_ticker; - return walletType - } - - width: 600 - - Component.onCompleted: API.app.wallet_pg.validate_address_data = {} - Component.onDestruction: API.app.wallet_pg.validate_address_data = {} - - MultipageModalContent - { - Layout.topMargin: 5 - Layout.fillWidth: true - - titleText: isEdition ? qsTr("Edit address entry") : qsTr("Create a new address") - - // Wallet Type Selector - DefaultButton - { - Layout.fillWidth: true - text: qsTr("Selected wallet: %1").arg(walletType !== "" ? walletType : qsTr("NONE")) - onClicked: wallet_type_list_modal.open() - } - - // Address Key Field - DefaultTextField - { - id: contact_new_address_key - - Layout.topMargin: 5 - Layout.fillWidth: true - - placeholderText: qsTr("Enter a name") - - onTextChanged: - { - const max_length = 30 - if (text.length > max_length) - text = text.substring(0, max_length) - } - - // Error tooltip when key already exists. - DefaultTooltip - { - id: key_already_exists_tooltip - visible: false - contentItem: DefaultText { text_value: qsTr("This key already exists.") } - } - } - - // Address Value Field - DefaultTextField - { - id: contact_new_address_value - - Layout.topMargin: 5 - implicitWidth: parent.width - - placeholderText: qsTr("Enter the address") - - onTextChanged: - { - const max_length = 50 - if (text.length > max_length) - text = text.substring(0, max_length) - } - } - - DefaultText - { - id: invalidAddressMsgLabel - Layout.fillWidth: true - color: Dex.CurrentTheme.noColor - wrapMode: DexLabel.Wrap - } - - HorizontalLine { Layout.fillWidth: true; Layout.topMargin: 32 } - - footer: - [ - DefaultButton - { - Layout.preferredWidth: 120 - visible: !API.app.wallet_pg.convert_address_busy && API.app.wallet_pg.validate_address_data.convertible ? API.app.wallet_pg.validate_address_data.convertible : false - text: qsTr("Convert") - onClicked: API.app.wallet_pg.convert_address(contact_new_address_value.text, retrieveWalletTypeTicker(), API.app.wallet_pg.validate_address_data.to_address_format); - }, - - DefaultButton - { - id: validateButton - enabled: key.length > 0 && value.length > 0 && walletType !== "" && !API.app.wallet_pg.validate_address_busy - text: qsTr("Validate") - onClicked: API.app.wallet_pg.validate_address(contact_new_address_value.text, retrieveWalletTypeTicker()) - }, - - DefaultButton - { - text: qsTr("Cancel") - onClicked: root.close() - } - ] - - Connections - { - target: API.app.wallet_pg - - function onConvertAddressBusyChanged() - { - if (API.app.wallet_pg.convert_address_busy) // Currently converting entered address - { - return; - } - - contact_new_address_value.text = API.app.wallet_pg.converted_address - API.app.wallet_pg.validate_address_data = {} - invalidAddressMsgLabel.text = "" - } - - function onValidateAddressBusyChanged() - { - if (API.app.wallet_pg.validate_address_busy) // Currently checking entered address - { - return; - } - - if (!API.app.wallet_pg.validate_address_data.is_valid) // Entered address is invalid. - { - invalidAddressMsgLabel.text = API.app.wallet_pg.validate_address_data.reason - return; - } - - if (isEdition) // Removes old address entry before if we are in edition mode. - { - console.debug("AddressBook: Replacing address %1:%2:%3 of contact %4" - .arg(oldWalletType).arg(oldKey).arg(oldValue).arg(contactModel.name)) - contactModel.remove_address_entry(oldWalletType, oldKey); - } - - var create_address_result = contactModel.add_address_entry(walletType, key, value); - if (create_address_result === true) - { - console.debug("AddressBook: Address %1:%2:%3 created for contact %4" - .arg(walletType).arg(key).arg(value).arg(contactModel.name)) - root.close() - } - else - { - console.debug("AddressBook: Failed to create address for contact %1: %2 key already exists" - .arg(contactModel.name).arg(key)) - key_already_exists_tooltip.visible = true - } - } - } - - ModalLoader - { - id: wallet_type_list_modal - - property string selected_wallet_type: "" - - sourceComponent: AddressBookWalletTypeListModal - { - onSelected_wallet_typeChanged: wallet_type_list_modal.selected_wallet_type = selected_wallet_type - } - } - } -} diff --git a/atomic_defi_design/Dex/Wallet/AddressBookEditContactModal.qml b/atomic_defi_design/Dex/Wallet/AddressBookEditContactModal.qml deleted file mode 100644 index 20c6cbb610..0000000000 --- a/atomic_defi_design/Dex/Wallet/AddressBookEditContactModal.qml +++ /dev/null @@ -1,601 +0,0 @@ -// Qt Imports -import QtQuick 2.15 -import QtQuick.Layouts 1.15 -import QtQuick.Controls 2.15 -import QtQuick.Controls.Universal 2.15 -import QtQuick.Controls 1.4 -import QtQuick.Controls.Styles 1.4 - -// Deps Imports -import Qaterial 1.0 as Qaterial - -// Project Imports -import "../Components" -import "../Constants" -import App 1.0 -import Dex.Themes 1.0 as Dex - -MultipageModal -{ - id: root - - property var contactModel - - function trySend(wallet_type, address) - { - // Checks if the selected wallet type is a coin type instead of a coin. - if (API.app.portfolio_pg.global_cfg_mdl.is_coin_type(wallet_type)) - { - send_selector.coin_type = wallet_type - send_selector.address = address - send_selector.open() - } - - // Checks if the coin is currently enabled. - else if (!API.app.portfolio_pg.is_coin_enabled(wallet_type)) - { - enable_coin_modal.coin_name = wallet_type - enable_coin_modal.open() - } - - // Checks if the coin has balance. - else if (parseFloat(API.app.get_balance(wallet_type)) === 0) cannot_send_modal.open() - - // If the coin has balance and is enabled, opens the send modal. - else - { - API.app.wallet_pg.ticker = wallet_type - send_modal.address = address - send_modal.open() - } - } - - width: 760 - - onClosed: contactModel.reload() - - MultipageModalContent - { - titleText: qsTr("Edit contact") - - // Contact name section - TextFieldWithTitle - { - id: name_input - Layout.fillWidth: true - title: qsTr("Contact Name") - field.placeholderText: qsTr("Enter a contact name") - field.text: contactModel.name - field.onTextChanged: - { - const max_length = 50 - if (field.text.length > max_length) - field.text = field.text.substring(0, max_length) - } - } - - HorizontalLine { Layout.fillWidth: true } - - // Wallets Information - ColumnLayout - { - Layout.topMargin: 10 - Layout.fillWidth: true - - // Title - TitleText { text: qsTr("Address List") } - - DefaultTextField - { - Layout.topMargin: 10 - Layout.fillWidth: true - - placeholderText: qsTr("Search for an address entry.") - - onTextChanged: contactModel.proxy_filter.search_expression = text - Component.onDestruction: contactModel.proxy_filter.search_expression = "" - } - - // Addresses Table - TableView - { - id: walletInfoTable - - property int _typeColWidth: 90 - property int _keyColWidth: 70 - property int _addressColWidth: 320 - property int _actionsColWidth: 100 - - model: contactModel.proxy_filter - - Layout.topMargin: 15 - Layout.fillWidth: true - - backgroundVisible: false - frameVisible: false - - headerDelegate: RowLayout - { - Layout.preferredWidth: styleData.column === 0 ? walletInfoTable._typeColWidth : - styleData.column === 1 ? walletInfoTable._keyColWidth : - styleData.column === 2 ? walletInfoTable._addressColWidth : - walletInfoTable._actionsColWidth - - Item - { - Layout.fillWidth: true - height: 20 - - DefaultText - { - anchors.verticalCenter: parent.verticalCenter - text: styleData.value - } - - VerticalLine - { - visible: styleData.column !== 3 - Layout.alignment: Qt.AlignRight - Layout.fillHeight: true - } - } - } - - rowDelegate: DefaultRectangle - { - height: 37; radius: 0 - color: styleData.selected ? Dex.CurrentTheme.accentColor: styleData.alternate ? Dex.CurrentTheme.backgroundColor : Dex.CurrentTheme.backgroundColorDeep - } - - TableViewColumn // Type Column - { - width: walletInfoTable._typeColWidth - - role: "address_type" - title: qsTr("Type") - - resizable: false - movable: false - - delegate: RowLayout - { - width: walletInfoTable._typeColWidth - DexLabel - { - Layout.preferredWidth: parent.width - 10 - Layout.leftMargin: 3 - text: styleData.row >= 0 ? styleData.value : "" - font.pixelSize: Style.textSizeSmall3 - elide: Text.ElideRight - } - - VerticalLine - { - Layout.alignment: Qt.AlignRight - Layout.fillHeight: true - } - } - } - - TableViewColumn // Key Column - { - width: walletInfoTable._keyColWidth - - role: "address_key" - title: qsTr("Key") - - resizable: false - movable: false - - delegate: RowLayout - { - width: walletInfoTable._keyColWidth - DefaultText - { - Layout.preferredWidth: parent.width - 10 - Layout.leftMargin: 3 - text: styleData.row >= 0 ? styleData.value : "" - font.pixelSize: Style.textSizeSmall3 - elide: Text.ElideRight - } - - VerticalLine - { - Layout.alignment: Qt.AlignRight - Layout.fillHeight: true - } - } - } - - TableViewColumn - { - width: walletInfoTable._addressColWidth - - role: "address_value" - title: qsTr("Address") - - resizable: false - movable: false - - delegate: RowLayout - { - width: walletInfoTable._addressColWidth - DexLabel - { - Layout.preferredWidth: parent.width - 10 - Layout.leftMargin: 3 - text: styleData.row >= 0 ? styleData.value : "" - font.pixelSize: Style.textSizeSmall3 - elide: Text.ElideRight - } - - VerticalLine - { - Layout.alignment: Qt.AlignRight - Layout.fillHeight: true - } - } - } - - TableViewColumn // Actions Column - { - width: walletInfoTable._actionsColWidth - title: qsTr("Actions") - - resizable: false - movable: false - - delegate: RowLayout - { - spacing: 4 - width: walletInfoTable._actionsColWidth - - Qaterial.OutlineButton // Edit Address Button - { - Layout.leftMargin: 2 - implicitHeight: 20 - implicitWidth: 20 - outlined: false - - Qaterial.ColorIcon - { - anchors.centerIn: parent - iconSize: 20 - source: Qaterial.Icons.leadPencil - color: Dex.CurrentTheme.foregroundColor - } - - onClicked: - { - address_edition_modal.walletType = model.address_type; - address_edition_modal.key = model.address_key; - address_edition_modal.value = model.address_value; - address_edition_modal.open(); - } - } - - Qaterial.OutlineButton // Delete Button - { - implicitHeight: 20 - implicitWidth: 20 - outlined: false - - onClicked: - { - removeAddressEntryModal.addressKey = model.address_key; - removeAddressEntryModal.addressType = model.address_type; - removeAddressEntryModal.contactModel = contactModel; - removeAddressEntryModal.open(); - } - - Qaterial.ColorIcon - { - anchors.centerIn: parent - iconSize: 20 - source: Qaterial.Icons.trashCan - color: Dex.CurrentTheme.noColor - } - } - - Qaterial.OutlineButton // Copy Clipboard Button - { - implicitHeight: 20 - implicitWidth: 20 - outlined: false - - onClicked: API.qt_utilities.copy_text_to_clipboard(model.address_value) - - Qaterial.ColorIcon - { - anchors.centerIn: parent - iconSize: 20 - source: Qaterial.Icons.contentCopy - color: Dex.CurrentTheme.foregroundColor - } - } - - Qaterial.OutlineButton // Send Button - { - implicitHeight: 20 - implicitWidth: 20 - outlined: false - - onClicked: trySend(model.address_type, model.address_value) - - Qaterial.ColorIcon - { - anchors.centerIn: parent - iconSize: 20 - source: Qaterial.Icons.send - color: Dex.CurrentTheme.foregroundColor - } - } - } - } - } - - // New Address Button - DefaultButton - { - Layout.preferredWidth: 140 - text: qsTr("Add Address") - onClicked: address_creation_modal.open(); - } - - ModalLoader { - id: address_creation_modal - sourceComponent: AddressBookAddContactAddressModal { - contactModel: root.contactModel - } - } - - ModalLoader { - id: address_edition_modal - - property string walletType - property string key - property string value - - onLoaded: { - item.oldWalletType = walletType - item.walletType = walletType - - item.oldKey = key - item.key = key - - item.oldValue = value - item.value = value - } - - sourceComponent: AddressBookAddContactAddressModal { - contactModel: root.contactModel - isEdition: true - } - } - } - - HorizontalLine - { - Layout.fillWidth: true - } - - // Categories Section Title - TitleText - { - Layout.topMargin: 10 - text: qsTr("Tags") - } - - // Categories (Tags) List - Flow - { - Layout.fillWidth: true - spacing: 10 - Repeater - { - id: category_repeater - model: contactModel.categories - - DexAppButton - { - Layout.alignment: Qt.AlignLeft - Layout.leftMargin: 4 - border.width: 0 - iconSource: Qaterial.Icons.closeOctagon - text: modelData - onClicked: contactModel.remove_category(modelData); - } - } - - // Category adding form opening button - DexAppButton - { - Layout.leftMargin: 10 - width: height - text: qsTr("+") - - onClicked: add_category_modal.open() - } - } - - HorizontalLine { Layout.fillWidth: true } - - // Actions on current contact - RowLayout - { - Layout.alignment: Qt.AlignBottom | Qt.AlignRight - Layout.rightMargin: 15 - - // Validate (Save) Changes - DefaultButton - { - text: qsTr("Confirm") - onClicked: - { - contactModel.name = name_input.field.text - contactModel.save() - root.close(); - } - } - - // Cancel Changes - DefaultButton - { - text: qsTr("Cancel") - onClicked: root.close() - } - } - - // Wallet Type List Modal - ModalLoader - { - id: wallet_type_list_modal - - property string selected_wallet_type: "" - - sourceComponent: AddressBookWalletTypeListModal - { - onSelected_wallet_typeChanged: wallet_type_list_modal.selected_wallet_type = selected_wallet_type - } - } - - // Enable Coin Modal - ModalLoader - { - property string coin_name - - id: enable_coin_modal - - sourceComponent: MultipageModal - { - MultipageModalContent - { - Layout.fillWidth: true - titleText: qsTr("Enable " + coin_name) - - DefaultText - { - text: qsTr("The selected address belongs to a disabled coin, you need to enabled it before sending.") - } - - Row - { - // Enable button - PrimaryButton - { - text: qsTr("Enable") - - onClicked: - { - API.app.enable_coin(coin_name) - enable_coin_modal.close() - } - } - - // Cancel button - DefaultButton - { - Layout.rightMargin: 5 - text: qsTr("Cancel") - - onClicked: enable_coin_modal.close() - } - } - } - } - } - - // Send Selector modal - ModalLoader - { - id: send_selector - - property string coin_type - property string address - - onLoaded: - { - item.coin_type = coin_type - item.address = address - } - - sourceComponent: AddressBookSendWalletSelector {} - } - - // Send Modal - ModalLoader - { - property string address - - id: send_modal - - onLoaded: item.address_field.text = address - - sourceComponent: SendModal - { - address_field.enabled: false - } - } - - // Cannot Send Modal - ModalLoader - { - id: cannot_send_modal - - sourceComponent: MultipageModal - { - MultipageModalContent - { - titleText: qsTr("Cannot send to this address") - - DefaultText - { - text: qsTr("Your balance is empty") - } - - DefaultButton - { - text: qsTr("Ok") - - onClicked: cannot_send_modal.close() - } - } - } - } - - // Remove address entry modal - ModalLoader - { - id: removeAddressEntryModal - - property var contactModel - property string addressKey - property string addressType - - sourceComponent: MultipageModal - { - width: 250 - MultipageModalContent - { - titleText: qsTr("Remove address ?") - - RowLayout - { - DexButton { text: qsTr("Yes"); onClicked: { contactModel.remove_address_entry(addressType, addressKey); close(); } } - DexButton { text: qsTr("No"); onClicked: close() } - } - } - } - } - - // Category (Tag) Adding Modal - ModalLoader - { - id: add_category_modal - - onLoaded: item.contactModel = root.contactModel - - sourceComponent: AddressBookNewContactCategoryModal {} - } - } -} diff --git a/atomic_defi_design/Dex/Wallet/AddressBookNewContactCategoryModal.qml b/atomic_defi_design/Dex/Wallet/AddressBookNewContactCategoryModal.qml deleted file mode 100644 index ba09b631db..0000000000 --- a/atomic_defi_design/Dex/Wallet/AddressBookNewContactCategoryModal.qml +++ /dev/null @@ -1,77 +0,0 @@ -import QtQuick 2.15 -import QtQuick.Layouts 1.15 -import QtQuick.Controls 2.15 - -import "../Components" -import "../Constants" -import App 1.0 - -//! New category form -MultipageModal -{ - id: root - width: 500 - - property var contactModel - - MultipageModalContent - { - titleText: qsTr("Add a new tag") - - DefaultTextField - { - id: name_input - - Layout.fillWidth: true - - placeholderText: qsTr("Enter the tag name") - onTextChanged: - { - const max_length = 14 - if(text.length > max_length) - text = text.substring(0, max_length) - } - - // Error tooltip when category name already exists. - DefaultTooltip - { - id: alrady_exists_tooltip - visible: false - contentItem: DefaultText - { - text_value: qsTr("This contact already has this tag") - } - } - } - - footer: - [ - DefaultButton - { - Layout.preferredWidth: 90 - Layout.preferredHeight: 40 - text: qsTr("Add") - onClicked: - { - if (!contactModel.add_category(name_input.text)) alrady_exists_tooltip.visible = true - else - { - name_input.text = "" - add_category_modal.close() - } - } - }, - - DefaultButton - { - Layout.preferredWidth: 90 - Layout.preferredHeight: 40 - text: qsTr("Cancel") - onClicked: { - name_input.text = "" - add_category_modal.close() - } - } - ] - } -} diff --git a/atomic_defi_design/Dex/Wallet/AddressBookSendWalletSelector.qml b/atomic_defi_design/Dex/Wallet/AddressBookSendWalletSelector.qml deleted file mode 100644 index b6135e2894..0000000000 --- a/atomic_defi_design/Dex/Wallet/AddressBookSendWalletSelector.qml +++ /dev/null @@ -1,42 +0,0 @@ -import QtQuick 2.15 -import QtQuick.Layouts 1.15 -import QtQuick.Controls 2.15 - -import "../Components" -import "../Constants" -import App 1.0 - -MultipageModal { - id: root - - property string coin_type - property string address - - width: 400 - - MultipageModalContent { - Layout.fillWidth: true - titleText: qsTr("Choose a valid ") + coin_type + qsTr(" coin") - - Repeater { - model: coin_type == "QRC-20" ? API.app.portfolio_pg.global_cfg_mdl.all_qrc20_proxy : - coin_type == "ERC-20" ? API.app.portfolio_pg.global_cfg_mdl.all_erc20_proxy : - coin_type == "BEP-20" ? API.app.portfolio_pg.global_cfg_mdl.all_bep20_proxy : - API.app.portfolio_pg.global_cfg_mdl.all_smartchains_proxy - - delegate: AddressBookWalletTypeListRow { - Layout.preferredHeight: height - Layout.rightMargin: 30 - Layout.fillWidth: true - - ticker: model.ticker - name: model.name - - onClicked: { - trySend(model.ticker, address) - close() - } - } - } - } -} diff --git a/atomic_defi_design/Dex/Wallet/AddressBookWalletTypeList.qml b/atomic_defi_design/Dex/Wallet/AddressBookWalletTypeList.qml deleted file mode 100644 index 8f6b749f1b..0000000000 --- a/atomic_defi_design/Dex/Wallet/AddressBookWalletTypeList.qml +++ /dev/null @@ -1,143 +0,0 @@ -import QtQuick 2.15 -import QtQuick.Layouts 1.15 -import QtQuick.Controls 2.15 -import QtQuick.Controls.impl 2.15 -import QtQuick.Controls.Universal 2.15 - -import Qaterial 1.0 as Qaterial - -import "../Components" -import "../Constants" -import App 1.0 -import Dex.Themes 1.0 as Dex - -Qaterial.Expandable -{ - id: _root - - property string title - - property string type_title - property string type: "" - property string typeIcon: type - - property var model - - header: Qaterial.ItemDelegate - { - id: _header - - icon.source: General.image_path + "arrow_down.svg" - - onClicked: () => _root.expanded = !_root.expanded - - TitleText - { - anchors.verticalCenter: parent.verticalCenter - leftPadding: 75 - text: title - font.bold: true - } - } - - delegate: Column - { - AddressBookWalletTypeListRow - { - enabled: type !== "" - visible: type !== "" - - icon_source: General.coinTypeIcon(typeIcon) - - width: _root.width - - name: type_title - ticker: type_title - - onClicked: onTypeSelect(type) - } - - Repeater - { - model: _root.model - - delegate: AddressBookWalletTypeListRow - { - width: _root.width - - name: model.name - ticker: model.ticker - - onClicked: - { - if (!API.app.portfolio_pg.global_cfg_mdl.get_coin_info(model.ticker).is_enabled) - _tooltip.open() - else - onTypeSelect(ticker) - } - - DefaultTooltip - { - id: _tooltip - - width: 250 - anchors.centerIn: parent - - dim: true - modal: true - closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside - - contentItem: DexLabelUnlinked - { - text_value: qsTr("%1 is not enabled - You need to enable it before adding an address. Enable it ?
Yes - No").arg(model.ticker) - wrapMode: DefaultText.Wrap - width: 350 - onLinkActivated: - { - if (link === "#no") _tooltip.close() - else - { - if (API.app.enable_coins([model.ticker]) === false) - cannot_enable_coin_modal.open() - else - { - color = Dex.CurrentTheme.buttonTextDisabledColor - opacity = 0.8 - _coinIsEnabling.visible = true - } - } - } - } - - BusyIndicator - { - id: _coinIsEnabling - - visible: false - enabled: visible - anchors.fill: parent - - Connections - { - target: API.app.portfolio_pg.global_cfg_mdl.all_disabled_proxy - - function onLengthChanged() - { - _tooltip.close() - } - } - } - - ModalLoader - { - property string coin_to_enable_ticker: model.ticker - id: cannot_enable_coin_modal - sourceComponent: CannotEnableCoinModal { coin_to_enable_ticker: cannot_enable_coin_modal.coin_to_enable_ticker } - } - - delay: 200 - } - } - } - } -} diff --git a/atomic_defi_design/Dex/Wallet/AddressBookWalletTypeListModal.qml b/atomic_defi_design/Dex/Wallet/AddressBookWalletTypeListModal.qml deleted file mode 100644 index 5590cd3689..0000000000 --- a/atomic_defi_design/Dex/Wallet/AddressBookWalletTypeListModal.qml +++ /dev/null @@ -1,137 +0,0 @@ -import QtQuick 2.15 -import QtQuick.Layouts 1.15 - -import Qaterial 1.0 as Qaterial - -import "../Components" -import "../Constants" -import App 1.0 - -MultipageModal -{ - readonly property var glbCoinsCfgModel: API.app.portfolio_pg.global_cfg_mdl - property alias selected_wallet_type: wallet_list.selected_wallet_type - - function resetModal() - { - _searchbar.text = "" - filterWallets(_searchbar.text) - } - - function filterWallets(text) - { - _qrc20Expandable.model.setFilterFixedString(text) - _erc20Expandable.model.setFilterFixedString(text) - _bep20Expandable.model.setFilterFixedString(text) - _scExpandable.model.setFilterFixedString(text) - _utxoExpandable.model.setFilterFixedString(text) - - // Expands type lists if searchbar is not empty - _qrc20Expandable.expanded = text !== "" - _erc20Expandable.expanded = text !== "" - _bep20Expandable.expanded = text !== "" - _scExpandable.expanded = text !== "" - _utxoExpandable.expanded = text !== "" - } - - function onTypeSelect(type_or_ticker) - { - selected_wallet_type = type_or_ticker - close() - } - - width: 600 - - onOpened: _searchbar.forceActiveFocus() - onClosed: resetModal() - - MultipageModalContent - { - id: wallet_list - - property string selected_wallet_type: "" - - titleText: qsTr("Select wallet type") - - // Search input - DefaultTextField - { - Layout.rightMargin: 10 - id: _searchbar - - Layout.fillWidth: true - placeholderText: qsTr("Search") - - onTextChanged: filterWallets(text) - } - - AddressBookWalletTypeList - { - id: _qrc20Expandable - - Layout.topMargin: 20 - Layout.rightMargin: 10 - Layout.fillWidth: true - Layout.fillHeight: true - - title: "QRC-20 coins" - type_title: "QRC-20" - type: "QRC-20" - - model: glbCoinsCfgModel.all_qrc20_proxy - } - - AddressBookWalletTypeList - { - id: _erc20Expandable - Layout.rightMargin: 10 - Layout.fillWidth: true - - title: "ERC-20 coins" - type_title: "ERC-20" - type: "ERC-20" - - model: glbCoinsCfgModel.all_erc20_proxy - } - - AddressBookWalletTypeList - { - id: _bep20Expandable - Layout.rightMargin: 10 - Layout.fillWidth: true - - title: "BEP-20 coins" - type_title: "BEP-20" - type: "BEP-20" - typeIcon: "BNB" - - model: glbCoinsCfgModel.all_bep20_proxy - } - - AddressBookWalletTypeList - { - id: _scExpandable - Layout.rightMargin: 10 - Layout.fillWidth: true - - title: "Smart Chain coins" - type_title: "Smart Chain" - type: "Smart Chain" - - model: glbCoinsCfgModel.all_smartchains_proxy - } - - AddressBookWalletTypeList - { - id: _utxoExpandable - - Layout.rightMargin: 10 - Layout.fillWidth: true - - title: "UTXO coins" - type_title: "UTXO" - - model: glbCoinsCfgModel.all_utxo_proxy - } - } -} diff --git a/atomic_defi_design/Dex/Wallet/AddressBookWalletTypeListRow.qml b/atomic_defi_design/Dex/Wallet/AddressBookWalletTypeListRow.qml deleted file mode 100644 index 5b9c597a63..0000000000 --- a/atomic_defi_design/Dex/Wallet/AddressBookWalletTypeListRow.qml +++ /dev/null @@ -1,34 +0,0 @@ -import QtQuick 2.15 -import QtQuick.Layouts 1.15 -import QtQuick.Controls 2.15 - -import "../Components" -import "../Constants" -import App 1.0 - -ItemDelegate { - property string ticker - property string name - - property alias icon_source: icon.source - - height: 50 - - RowLayout { - DefaultImage { - id: icon - Layout.topMargin: 10 - Layout.leftMargin: 30 - Layout.alignment: Qt.AlignVCenter - source: General.coinIcon(ticker) - Layout.preferredWidth: 32 - Layout.preferredHeight: 32 - } - - DexLabel { - Layout.topMargin: 10 - text: " " + name + " (" + ticker + ")" - } - } - -} From 5be6594710bea74e8fed43ca0516ae0453fcd879 Mon Sep 17 00:00:00 2001 From: smk762 Date: Fri, 13 May 2022 18:00:57 +0800 Subject: [PATCH 041/177] fix test --- src/tests/models/qt.addressbook.contact.model.tests.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tests/models/qt.addressbook.contact.model.tests.cpp b/src/tests/models/qt.addressbook.contact.model.tests.cpp index 4af6fb1c0e..9b99b1b125 100644 --- a/src/tests/models/qt.addressbook.contact.model.tests.cpp +++ b/src/tests/models/qt.addressbook.contact.model.tests.cpp @@ -60,7 +60,7 @@ TEST_CASE("addressbook_contact_model") WHEN("A category is added") { - CHECK(contact_model.add_category("CEO") == true); + CHECK(contact_model.addCategory("CEO") == true); THEN("get_categories should return 5 categories") { From 0603cb09101b0d39a1ba832899d4625ee6d6adca Mon Sep 17 00:00:00 2001 From: smk762 Date: Fri, 13 May 2022 19:04:47 +0800 Subject: [PATCH 042/177] fix test --- src/tests/models/qt.addressbook.contact.model.tests.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tests/models/qt.addressbook.contact.model.tests.cpp b/src/tests/models/qt.addressbook.contact.model.tests.cpp index 9b99b1b125..1766bb4646 100644 --- a/src/tests/models/qt.addressbook.contact.model.tests.cpp +++ b/src/tests/models/qt.addressbook.contact.model.tests.cpp @@ -88,7 +88,7 @@ TEST_CASE("addressbook_contact_model") WHEN("A category is removed") { - contact_model.remove_category("Friend"); + contact_model.removeCategory("Friend"); THEN("get_categories should return 3 categories") { From 0d545825a1eed37acfce4a9821d658f75dcf0d71 Mon Sep 17 00:00:00 2001 From: smk762 Date: Sun, 15 May 2022 02:53:41 +0800 Subject: [PATCH 043/177] rm dup prop --- atomic_defi_design/Dex/Components/MultipageModalContent.qml | 2 -- 1 file changed, 2 deletions(-) diff --git a/atomic_defi_design/Dex/Components/MultipageModalContent.qml b/atomic_defi_design/Dex/Components/MultipageModalContent.qml index 5005a6acc5..00affc84e6 100644 --- a/atomic_defi_design/Dex/Components/MultipageModalContent.qml +++ b/atomic_defi_design/Dex/Components/MultipageModalContent.qml @@ -57,8 +57,6 @@ ColumnLayout Layout.maximumHeight: _maxHeight contentHeight: _innerLayout.height - flickableDirection: Flickable.VerticalFlick - ColumnLayout { id: _innerLayout From ed4bc2d4f63f8e0be924e565d5ccca126e081cc3 Mon Sep 17 00:00:00 2001 From: syl Date: Mon, 16 May 2022 07:07:02 +0200 Subject: [PATCH 044/177] Addressbook: Open contact edition modal after creating a contact --- atomic_defi_design/Dex/Addressbook/NewContactPopup.qml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/atomic_defi_design/Dex/Addressbook/NewContactPopup.qml b/atomic_defi_design/Dex/Addressbook/NewContactPopup.qml index a0b28278f6..fd5edbcd5f 100644 --- a/atomic_defi_design/Dex/Addressbook/NewContactPopup.qml +++ b/atomic_defi_design/Dex/Addressbook/NewContactPopup.qml @@ -53,7 +53,14 @@ Dex.Popup var createContactResult = API.app.addressbookPg.model.addContact(nameField.text) if (createContactResult === false) nameAlreadyTakenToolTip.visible = true - else root.close() + else + { + root.close() + + let contactModelIndex = API.app.addressbookPg.model.index(API.app.addressbookPg.model.rowCount() - 1, 0) + editContactLoader.item.contactModel = API.app.addressbookPg.model.data(contactModelIndex, Qt.UserRole + 1) + editContactLoader.item.open() + } } } } From 3a0d03ff981d288f54fdacc6adaa12b7e5fbbd13 Mon Sep 17 00:00:00 2001 From: syl Date: Mon, 16 May 2022 07:08:16 +0200 Subject: [PATCH 045/177] Addressbook: Force focus on name field when creating a contact --- atomic_defi_design/Dex/Addressbook/NewContactPopup.qml | 1 + 1 file changed, 1 insertion(+) diff --git a/atomic_defi_design/Dex/Addressbook/NewContactPopup.qml b/atomic_defi_design/Dex/Addressbook/NewContactPopup.qml index fd5edbcd5f..ffc0653502 100644 --- a/atomic_defi_design/Dex/Addressbook/NewContactPopup.qml +++ b/atomic_defi_design/Dex/Addressbook/NewContactPopup.qml @@ -13,6 +13,7 @@ Dex.Popup width: 250 height: 55 + onOpened: nameField.forceActiveFocus() onClosed: nameField.text = "" contentItem: Row From 60b7cc72ed7b5583fdd13c420fde1cd855b5d021 Mon Sep 17 00:00:00 2001 From: syl Date: Mon, 16 May 2022 07:12:10 +0200 Subject: [PATCH 046/177] Addressbook: Fix contact row expanded height when it contains addresses --- atomic_defi_design/Dex/Addressbook/Main.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/atomic_defi_design/Dex/Addressbook/Main.qml b/atomic_defi_design/Dex/Addressbook/Main.qml index c05430553f..587ff15c78 100644 --- a/atomic_defi_design/Dex/Addressbook/Main.qml +++ b/atomic_defi_design/Dex/Addressbook/Main.qml @@ -231,7 +231,7 @@ Item x: 30 model: modelData.proxyFilter width: parent.width - 40 - implicitHeight: childrenRect.height > 240 ? 240 : childrenRect.height + implicitHeight: contentHeight > 240 ? 240 : contentHeight spacing: 18 delegate: Item From 00009cb366cd85f7819f1de39b3d58d40e742e12 Mon Sep 17 00:00:00 2001 From: syl Date: Mon, 16 May 2022 07:21:46 +0200 Subject: [PATCH 047/177] Coding style --- .../models/qt.addressbook.contact.model.hpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/core/atomicdex/models/qt.addressbook.contact.model.hpp b/src/core/atomicdex/models/qt.addressbook.contact.model.hpp index e3538db725..c07a4ffec3 100644 --- a/src/core/atomicdex/models/qt.addressbook.contact.model.hpp +++ b/src/core/atomicdex/models/qt.addressbook.contact.model.hpp @@ -56,12 +56,12 @@ namespace atomic_dex [[nodiscard]] QHash roleNames() const final; // Getters/Setters - [[nodiscard]] const QString& get_name() const ; - void set_name(const QString& name) ; - [[nodiscard]] const QStringList& get_categories() const ; - void set_categories(QStringList categories) ; - [[nodiscard]] addressbook_contact_proxy_filter_model* get_proxy_filter() const ; - [[nodiscard]] const QVector& get_address_entries() const ; // Returns contact's current addresses. + [[nodiscard]] const QString& get_name() const; + void set_name(const QString& name); + [[nodiscard]] const QStringList& get_categories() const; + void set_categories(QStringList categories); + [[nodiscard]] addressbook_contact_proxy_filter_model* get_proxy_filter() const; + [[nodiscard]] const QVector& get_address_entries() const; // Returns contact's current addresses. // Loads this model data from the persistent data. void populate(); From 5ab46a0a852232e92e7d72057c6e98fb2cf79177 Mon Sep 17 00:00:00 2001 From: syl Date: Mon, 16 May 2022 07:22:09 +0200 Subject: [PATCH 048/177] Addressbook: Do not change contact name when it's empty --- src/core/atomicdex/models/qt.addressbook.contact.model.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/atomicdex/models/qt.addressbook.contact.model.cpp b/src/core/atomicdex/models/qt.addressbook.contact.model.cpp index 28e68d8318..4464d0e674 100644 --- a/src/core/atomicdex/models/qt.addressbook.contact.model.cpp +++ b/src/core/atomicdex/models/qt.addressbook.contact.model.cpp @@ -97,13 +97,13 @@ namespace atomic_dex if (name != m_name) { - if (!m_name.isEmpty()) + if (!name.isEmpty()) { addrbook_manager.change_contact_name(m_name.toStdString(), name.toStdString()); addrbook_manager.save_configuration(); + m_name = name; + emit nameChanged(); } - m_name = name; - emit nameChanged(); } } From f6374302f62881ef37159ef1be656af62eb93bd7 Mon Sep 17 00:00:00 2001 From: syl Date: Mon, 16 May 2022 07:30:51 +0200 Subject: [PATCH 049/177] Addressbook: Ensure edit contact modal is reset between openings --- atomic_defi_design/Dex/Addressbook/Main.qml | 23 +++++++++++-------- .../Dex/Addressbook/NewContactPopup.qml | 4 ++-- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/atomic_defi_design/Dex/Addressbook/Main.qml b/atomic_defi_design/Dex/Addressbook/Main.qml index 587ff15c78..65f204f8d6 100644 --- a/atomic_defi_design/Dex/Addressbook/Main.qml +++ b/atomic_defi_design/Dex/Addressbook/Main.qml @@ -205,8 +205,8 @@ Item text: qsTr("Edit") onClicked: { - editContactLoader.item.contactModel = modelData - editContactLoader.item.open() + editContactLoader.contactModel = modelData + editContactLoader.open() } } Dex.ClickableText @@ -322,20 +322,25 @@ Item } } } - - Loader - { - id: editContactLoader - sourceComponent: EditContactModal { } - } } Dex.ModalLoader { - property string address + id: editContactLoader + + property var contactModel + + onLoaded: item.contactModel = contactModel + sourceComponent: EditContactModal { } + } + + Dex.ModalLoader + { id: sendModalLoader + property string address + onLoaded: item.address_field.text = address sourceComponent: Wallet.SendModal diff --git a/atomic_defi_design/Dex/Addressbook/NewContactPopup.qml b/atomic_defi_design/Dex/Addressbook/NewContactPopup.qml index ffc0653502..c0fc890e02 100644 --- a/atomic_defi_design/Dex/Addressbook/NewContactPopup.qml +++ b/atomic_defi_design/Dex/Addressbook/NewContactPopup.qml @@ -59,8 +59,8 @@ Dex.Popup root.close() let contactModelIndex = API.app.addressbookPg.model.index(API.app.addressbookPg.model.rowCount() - 1, 0) - editContactLoader.item.contactModel = API.app.addressbookPg.model.data(contactModelIndex, Qt.UserRole + 1) - editContactLoader.item.open() + editContactLoader.contactModel = API.app.addressbookPg.model.data(contactModelIndex, Qt.UserRole + 1) + editContactLoader.open() } } } From 0eee91d174d9a11798331a83a9cf34f80165f5a8 Mon Sep 17 00:00:00 2001 From: syl Date: Mon, 16 May 2022 07:46:39 +0200 Subject: [PATCH 050/177] QML Components: Change Expandable height calculation so header can be better centered --- atomic_defi_design/Dex/Components/Expandable.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/atomic_defi_design/Dex/Components/Expandable.qml b/atomic_defi_design/Dex/Components/Expandable.qml index e590d7201b..d4858cf8b4 100644 --- a/atomic_defi_design/Dex/Components/Expandable.qml +++ b/atomic_defi_design/Dex/Components/Expandable.qml @@ -10,7 +10,7 @@ Rectangle property alias header: headerLoader.sourceComponent property alias content: contentLoader.sourceComponent - implicitHeight: padding + headerLoader.implicitHeight + (isExpanded ? contentLoader.implicitHeight + padding * 2 : 0) + implicitHeight: (padding * 2 + headerLoader.implicitHeight) + (isExpanded ? contentLoader.implicitHeight + padding * 2 : 0) clip: true Loader From aed9b8c7845fc166c98bea41845799b03b81210c Mon Sep 17 00:00:00 2001 From: syl Date: Mon, 16 May 2022 07:47:34 +0200 Subject: [PATCH 051/177] Addressbook: Update style && remove no tags label on main page --- atomic_defi_design/Dex/Addressbook/Main.qml | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/atomic_defi_design/Dex/Addressbook/Main.qml b/atomic_defi_design/Dex/Addressbook/Main.qml index 65f204f8d6..dc77edb65f 100644 --- a/atomic_defi_design/Dex/Addressbook/Main.qml +++ b/atomic_defi_design/Dex/Addressbook/Main.qml @@ -107,13 +107,13 @@ Item property color _tagBgColor: index % 2 !== 0 ? Dex.CurrentTheme.innerBackgroundColor : Dex.CurrentTheme.backgroundColor - padding: 12 + padding: 10 color: index % 2 === 0 ? Dex.CurrentTheme.innerBackgroundColor : Dex.CurrentTheme.backgroundColor width: contactTable.width header: Item { - height: 66 + height: 56 width: expandable.width Dex.DefaultMouseArea @@ -146,15 +146,6 @@ Item } } - Dex.Text - { - x: parent.width * 0.305 - anchors.verticalCenter: parent.verticalCenter - width: parent.width * 0.57 - visible: modelData.categories.length === 0 - text: qsTr("No tags") - } - Flow { anchors.verticalCenter: parent.verticalCenter @@ -201,6 +192,7 @@ Item anchors.rightMargin: 2 Dex.ClickableText { + anchors.verticalCenter: parent.verticalCenter font: Dex.DexTypo.body2 text: qsTr("Edit") onClicked: @@ -211,6 +203,7 @@ Item } Dex.ClickableText { + anchors.verticalCenter: parent.verticalCenter font: Dex.DexTypo.body2 text: qsTr("Delete") onClicked: Dex.API.app.addressbookPg.model.removeContact(modelData.name) From 23fd7dbbb4114287b2b04686594a30b07b1e510c Mon Sep 17 00:00:00 2001 From: syl Date: Mon, 16 May 2022 07:55:41 +0200 Subject: [PATCH 052/177] Addressbook: Reduce row's expanded size when user has no address --- atomic_defi_design/Dex/Addressbook/Main.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/atomic_defi_design/Dex/Addressbook/Main.qml b/atomic_defi_design/Dex/Addressbook/Main.qml index dc77edb65f..d428d8dbaf 100644 --- a/atomic_defi_design/Dex/Addressbook/Main.qml +++ b/atomic_defi_design/Dex/Addressbook/Main.qml @@ -213,7 +213,7 @@ Item content: Item { - height: noAddressLabel.visible ? 80 : addressList.height + height: noAddressLabel.visible ? 50 : addressList.height width: contactTable.width Dex.DexListView From 5b7285fd75dcc004d1cc206808662c7e57ff0b5e Mon Sep 17 00:00:00 2001 From: syl Date: Mon, 16 May 2022 08:24:27 +0200 Subject: [PATCH 053/177] Addressbook: Change placeholder of add address form text fields --- atomic_defi_design/Dex/Addressbook/AddAddressForm.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/atomic_defi_design/Dex/Addressbook/AddAddressForm.qml b/atomic_defi_design/Dex/Addressbook/AddAddressForm.qml index d20d687d4e..232983071e 100644 --- a/atomic_defi_design/Dex/Addressbook/AddAddressForm.qml +++ b/atomic_defi_design/Dex/Addressbook/AddAddressForm.qml @@ -145,7 +145,7 @@ Dex.Rectangle id: addressKeyField Layout.preferredWidth: 458 Layout.preferredHeight: 44 - placeholderText: qsTr("Address key") + placeholderText: qsTr("Label") Dex.ToolTip { @@ -159,7 +159,7 @@ Dex.Rectangle id: addressValueField Layout.preferredWidth: 458 Layout.preferredHeight: 44 - placeholderText: qsTr("Address field") + placeholderText: qsTr("Address") } Dex.Text From ce0fb2e563090bfb841c4f6da269a79e7acdeda8 Mon Sep 17 00:00:00 2001 From: syl Date: Mon, 16 May 2022 13:12:53 +0200 Subject: [PATCH 054/177] Fix some comboboxes --- .../Dex/Addressbook/AddAddressForm.qml | 23 ++- atomic_defi_design/Dex/Addressbook/Main.qml | 2 +- .../Dex/Components/ComboBoxWithSearchBar.qml | 137 ++++++++++++++++ .../Dex/Components/DexComboBox.qml | 150 +++++++++--------- atomic_defi_design/Dex/Components/qmldir | 1 + 5 files changed, 233 insertions(+), 80 deletions(-) create mode 100644 atomic_defi_design/Dex/Components/ComboBoxWithSearchBar.qml diff --git a/atomic_defi_design/Dex/Addressbook/AddAddressForm.qml b/atomic_defi_design/Dex/Addressbook/AddAddressForm.qml index 232983071e..a1c75321b9 100644 --- a/atomic_defi_design/Dex/Addressbook/AddAddressForm.qml +++ b/atomic_defi_design/Dex/Addressbook/AddAddressForm.qml @@ -1,11 +1,12 @@ import QtQuick 2.12 import QtQuick.Layouts 1.15 -import QtQuick.Controls.Universal 2.15 //> Universal.accent +import QtQuick.Controls 2.15 import Qaterial 1.0 as Qaterial import Dex.Themes 1.0 as Dex import Dex.Components 1.0 as Dex +import "../Components" as Dex import "../Constants" as Dex Dex.Rectangle @@ -57,7 +58,7 @@ Dex.Rectangle anchors.margins: 21 spacing: 17 - Dex.ComboBox + Dex.ComboBoxWithSearchBar { id: addressTypeComboBox @@ -66,20 +67,21 @@ Dex.Rectangle Layout.preferredWidth: 458 Layout.preferredHeight: 44 model: Dex.API.app.portfolio_pg.portfolio_mdl.portfolio_proxy_mdl - dropDownMaxHeight: 150 + popupForceMaxHeight: true + popupMaxHeight: 265 textRole: "ticker" + searchBarPlaceholderText: qsTr("Search asset") - delegate: Qaterial.ItemDelegate + delegate: ItemDelegate { id: _delegate - Universal.accent: Dex.CurrentTheme.comboBoxDropdownItemHighlightedColor width: addressTypeComboBox.width + height: 40 highlighted: addressTypeComboBox.highlightedIndex === index contentItem: Row { - height: 36 spacing: 10 Dex.Image @@ -104,6 +106,12 @@ Dex.Rectangle font: Dex.DexTypo.overLine } } + + background: Dex.Rectangle + { + anchors.fill: _delegate + color: _delegate.highlighted ? Dex.CurrentTheme.comboBoxDropdownItemHighlightedColor : Dex.CurrentTheme.comboBoxBackgroundColor + } } contentItem: Item @@ -138,6 +146,9 @@ Dex.Rectangle } } } + + onSearchBarTextChanged: Dex.API.app.portfolio_pg.portfolio_mdl.portfolio_proxy_mdl.setFilterFixedString(patternStr) + Component.onDestruction: Dex.API.app.portfolio_pg.portfolio_mdl.portfolio_proxy_mdl.setFilterFixedString("") } Dex.TextField diff --git a/atomic_defi_design/Dex/Addressbook/Main.qml b/atomic_defi_design/Dex/Addressbook/Main.qml index d428d8dbaf..6573117de2 100644 --- a/atomic_defi_design/Dex/Addressbook/Main.qml +++ b/atomic_defi_design/Dex/Addressbook/Main.qml @@ -216,7 +216,7 @@ Item height: noAddressLabel.visible ? 50 : addressList.height width: contactTable.width - Dex.DexListView + Dex.ListView { id: addressList diff --git a/atomic_defi_design/Dex/Components/ComboBoxWithSearchBar.qml b/atomic_defi_design/Dex/Components/ComboBoxWithSearchBar.qml new file mode 100644 index 0000000000..d0dbb7152b --- /dev/null +++ b/atomic_defi_design/Dex/Components/ComboBoxWithSearchBar.qml @@ -0,0 +1,137 @@ +import QtQuick 2.12 +import QtQuick.Controls 2.15 +import QtQuick.Layouts 1.3 + +import Qaterial 1.0 as Qaterial + +import Dex.Themes 1.0 as Dex +import "../Constants" + +ComboBox +{ + id: control + + property int radius: 20 + property int popupMaxHeight: 450 + property bool popupForceMaxHeight: false + property color backgroundColor: Dex.CurrentTheme.comboBoxBackgroundColor + property color popupBackgroundColor: Dex.CurrentTheme.comboBoxBackgroundColor + property color highlightedBackgroundColor: Dex.CurrentTheme.comboBoxDropdownItemHighlightedColor + property string searchBarPlaceholderText: qsTr("Search") + + signal searchBarTextChanged(var patternStr) + + background: Rectangle + { + id: bg + implicitWidth: control.width + implicitHeight: control.height + color: control.backgroundColor + radius: control.radius + } + + popup: Popup + { + id: popup + width: control.width + height: popupForceMaxHeight ? control.popupMaxHeight : Math.min(contentItem.implicitHeight, control.popupMaxHeight) + leftPadding: 0 + rightPadding: 0 + topPadding: 16 + bottomPadding: 16 + + contentItem: ColumnLayout + { + width: popup.width + height: popup.height + + DefaultTextField + { + placeholderText: searchBarPlaceholderText + Layout.fillWidth: true + Layout.leftMargin: 5 + Layout.rightMargin: 5 + Layout.preferredHeight: 40 + background: Rectangle { color: "transparent" } + onTextChanged: searchBarTextChanged(text) + } + + DefaultListView + { + id: _list + Layout.fillHeight: true + model: control.popup.visible ? control.delegateModel : null + currentIndex: control.highlightedIndex + ScrollBar.vertical: ScrollBar + { + visible: _list.contentHeight > control.dropDownMaxHeight + anchors.right: _list.right + anchors.rightMargin: 2 + width: 7 + background: DefaultRectangle + { + radius: 12 + color: Dex.CurrentTheme.scrollBarBackgroundColor + } + contentItem: DefaultRectangle + { + radius: 12 + color: Dex.CurrentTheme.scrollBarIndicatorColor + } + } + } + } + + background: Rectangle + { + radius: control.radius + color: control.popupBackgroundColor + } + } + + delegate: ItemDelegate + { + id: delegate + + width: control.width + highlighted: control.highlightedIndex === index + + contentItem: DefaultText + { + width: control.width + font: DexTypo.subtitle2 + text_value: control.textRole === "" ? model.modelData : !model.modelData ? model[textRole] : model.modelData[textRole] + elide: Text.ElideRight + } + + background: Rectangle + { + anchors.fill: delegate + color: delegate.highlighted ? Dex.CurrentTheme.comboBoxDropdownItemHighlightedColor : Dex.CurrentTheme.comboBoxBackgroundColor + } + } + + indicator: Column + { + anchors.verticalCenter: parent.verticalCenter + anchors.right: parent.right + anchors.rightMargin: 8 + spacing: -12 + + Qaterial.Icon + { + width: 20 + height: 20 + color: Dex.CurrentTheme.comboBoxArrowsColor + icon: Qaterial.Icons.chevronUp + } + + Qaterial.Icon + { + width: 20 + height: 20 + color: Dex.CurrentTheme.comboBoxArrowsColor + icon: Qaterial.Icons.chevronDown + } + } +} diff --git a/atomic_defi_design/Dex/Components/DexComboBox.qml b/atomic_defi_design/Dex/Components/DexComboBox.qml index de68b4f86c..2ac609f04b 100644 --- a/atomic_defi_design/Dex/Components/DexComboBox.qml +++ b/atomic_defi_design/Dex/Components/DexComboBox.qml @@ -13,59 +13,102 @@ ComboBox { id: control - property alias radius: bg_rect.radius - readonly property bool disabled: !enabled - property int dropDownMaxHeight: 450 - property color comboBoxBackgroundColor: Dex.CurrentTheme.comboBoxBackgroundColor - property color mainBackgroundColor: Dex.CurrentTheme.floatingBackgroundColor - property color popupBackgroundColor: Dex.CurrentTheme.floatingBackgroundColor - property color highlightedBackgroundColor: Dex.CurrentTheme.comboBoxDropdownItemHighlightedColor + property alias radius: bg_rect.radius + property int dropDownMaxHeight: 450 + property color comboBoxBackgroundColor: Dex.CurrentTheme.comboBoxBackgroundColor + property color mainBackgroundColor: Dex.CurrentTheme.comboBoxBackgroundColor + property color popupBackgroundColor: Dex.CurrentTheme.comboBoxBackgroundColor + property color highlightedBackgroundColor: Dex.CurrentTheme.comboBoxDropdownItemHighlightedColor property string mainLineText: control.displayText - - property - var dropdownLineText: m => textRole === "" ? - m.modelData : - !m.modelData ? m[textRole] : m.modelData[textRole] + property var dropdownLineText: m => textRole === "" ? + m.modelData : + !m.modelData ? m[textRole] : m.modelData[textRole] font.family: Style.font_family hoverEnabled: true - // Combobox Dropdown Button Background - background: DexRectangle + // Main, selected text + contentItem: Item + { + DefaultText + { + anchors.verticalCenter: parent.verticalCenter + anchors.left: parent.left + anchors.leftMargin: 13 + width: parent.width - anchors.leftMargin + font: DexTypo.subtitle2 + text_value: control.mainLineText + elide: Text.ElideRight + } + } + + // Main background + background: FloatingBackground { id: bg_rect implicitWidth: 120 implicitHeight: 45 - color: comboBoxBackgroundColor + color: control.mainBackgroundColor radius: 20 } - // Main, selected text - contentItem: Item + // Dropdown itself + popup: Popup { - anchors.fill: parent + width: control.width + leftPadding: 0 + rightPadding: 0 + topPadding: 16 + bottomPadding: 16 - DexLabel + contentItem: DefaultListView { - anchors.verticalCenter: parent.verticalCenter - anchors.left: parent.left - anchors.leftMargin: 10 - width: parent.width - anchors.leftMargin + id: _list + model: control.popup.visible ? control.delegateModel : null + implicitHeight: contentHeight > control.dropDownMaxHeight ? control.dropDownMaxHeight : contentHeight + currentIndex: control.highlightedIndex - font: DexTypo.subtitle2 - text_value: control.mainLineText - elide: Text.ElideRight + ScrollBar.vertical: ScrollBar + { + visible: _list.contentHeight > control.dropDownMaxHeight + anchors.right: _list.right + anchors.rightMargin: 2 + width: 7 + background: DefaultRectangle + { + radius: 12 + color: Dex.CurrentTheme.scrollBarBackgroundColor + } + contentItem: DefaultRectangle + { + radius: 12 + color: Dex.CurrentTheme.scrollBarIndicatorColor + } + } + + DefaultMouseArea + { + anchors.fill: parent + acceptedButtons: Qt.NoButton + } + } + + background: Rectangle + { + radius: control.radius + color: control.popupBackgroundColor } } // Each dropdown item - delegate: Qaterial.ItemDelegate + delegate: ItemDelegate { - id: combo_item + id: delegate + width: control.width highlighted: control.highlightedIndex === index - contentItem: DexLabel + contentItem: DefaultText { width: control.width font: DexTypo.subtitle2 @@ -73,10 +116,10 @@ ComboBox elide: Text.ElideRight } - // Dropdown Item background - background: DexRectangle { - anchors.fill: combo_item - color: combo_item.highlighted ? highlightedBackgroundColor : mainBackgroundColor + background: Rectangle + { + anchors.fill: delegate + color: delegate.highlighted ? Dex.CurrentTheme.comboBoxDropdownItemHighlightedColor : Dex.CurrentTheme.comboBoxBackgroundColor } } @@ -105,46 +148,7 @@ ComboBox } } - // Dropdown itself - popup: Popup - { - id: combo_popup - readonly property double max_height: 450 - - width: control.width - height: Math.min(contentItem.implicitHeight, max_height) + 20 - // height: _list.contentHeight > control.dropDownMaxHeight ? control.dropDownMaxHeight : _list.contentHeight - leftPadding: 0 - rightPadding: 0 - topPadding: 16 - bottomPadding: 16 - padding: 1 - - contentItem: DexListView - { - id: _list - model: control.popup.visible ? control.delegateModel : null - currentIndex: control.highlightedIndex - - DexMouseArea - { - anchors.fill: parent - acceptedButtons: Qt.NoButton - } - } - - background: DexRectangle - { - width: parent.width - height: parent.height - radius: control.radius - color: control.popupBackgroundColor - colorAnimation: false - border.width: 1 - } - } - - DexMouseArea + DefaultMouseArea { anchors.fill: parent acceptedButtons: Qt.NoButton diff --git a/atomic_defi_design/Dex/Components/qmldir b/atomic_defi_design/Dex/Components/qmldir index b11766c74a..8cf728d15e 100644 --- a/atomic_defi_design/Dex/Components/qmldir +++ b/atomic_defi_design/Dex/Components/qmldir @@ -2,6 +2,7 @@ module Dex.Components Button 1.0 DefaultButton.qml ComboBox 1.0 DefaultComboBox.qml +ComboBoxWithSearchBar 1.0 ComboBoxWithSearchBar.qml ClickableText 1.0 ClickableText.qml GradientButton 1.0 GradientButton.qml Image 1.0 DefaultImage.qml From 741125a81df5ea12aee0dec16961320025ba03a3 Mon Sep 17 00:00:00 2001 From: syl Date: Tue, 17 May 2022 17:39:01 +0200 Subject: [PATCH 055/177] Addressbook: Fix sending using an address type representing an asset standard --- .../Addressbook/AssetFromStandardSelector.qml | 78 +++++++++++++++++++ .../Dex/Addressbook/AssetRow.qml | 35 +++++++++ .../Dex/Addressbook/EnableAssetModal.qml | 46 +++++++++++ atomic_defi_design/Dex/Addressbook/Main.qml | 64 +++++++++++++-- 4 files changed, 217 insertions(+), 6 deletions(-) create mode 100644 atomic_defi_design/Dex/Addressbook/AssetFromStandardSelector.qml create mode 100644 atomic_defi_design/Dex/Addressbook/AssetRow.qml create mode 100644 atomic_defi_design/Dex/Addressbook/EnableAssetModal.qml diff --git a/atomic_defi_design/Dex/Addressbook/AssetFromStandardSelector.qml b/atomic_defi_design/Dex/Addressbook/AssetFromStandardSelector.qml new file mode 100644 index 0000000000..19f9f73bd4 --- /dev/null +++ b/atomic_defi_design/Dex/Addressbook/AssetFromStandardSelector.qml @@ -0,0 +1,78 @@ +import QtQuick 2.12 +import QtQuick.Layouts 1.3 + +import Dex.Components 1.0 as Dex +import Dex.Themes 1.0 as Dex +import "../Constants" as Dex + +Dex.MultipageModal +{ + id: root + + property string standard + + signal selected(var assetTicker) + + width: 560 + + Dex.MultipageModalContent + { + titleText: qsTr("Choose a valid ") + standard + qsTr(" asset") + + Dex.ListView + { + id: list + + Layout.fillWidth: true + Layout.maximumHeight: 500 + + model: standard == "QRC-20" ? Dex.API.app.portfolio_pg.global_cfg_mdl.all_qrc20_proxy : + standard == "ERC-20" ? Dex.API.app.portfolio_pg.global_cfg_mdl.all_erc20_proxy : + standard == "BEP-20" ? Dex.API.app.portfolio_pg.global_cfg_mdl.all_bep20_proxy : + Dex.API.app.portfolio_pg.global_cfg_mdl.all_smartchains_proxy + + spacing: 8 + + delegate: Item + { + width: list.width + height: 40 + + Dex.Rectangle + { + anchors.fill: parent + color: mouseArea.containsMouse ? Dex.CurrentTheme.buttonColorHovered : "transparent" + } + + AssetRow + { + id: assetRow + height: parent.height + ticker: model.ticker + type: model.type + name: model.name + } + + Dex.Text + { + visible: !model.enabled + anchors.left: assetRow.right + anchors.leftMargin: 6 + anchors.verticalCenter: parent.verticalCenter + text: qsTr("Disabled") + color: Dex.CurrentTheme.noColor + font: Dex.DexTypo.caption + } + + Dex.MouseArea + { + id: mouseArea + + anchors.fill: parent + hoverEnabled: true + onClicked: root.selected(model.ticker) + } + } + } + } +} diff --git a/atomic_defi_design/Dex/Addressbook/AssetRow.qml b/atomic_defi_design/Dex/Addressbook/AssetRow.qml new file mode 100644 index 0000000000..12a4ee31d6 --- /dev/null +++ b/atomic_defi_design/Dex/Addressbook/AssetRow.qml @@ -0,0 +1,35 @@ +import QtQuick 2.12 + +import Dex.Components 1.0 as Dex +import "../Constants" as Dex + +Row +{ + property string ticker + property string name + property string type + + spacing: 10 + + Dex.Image + { + width: 25 + height: 25 + anchors.verticalCenter: parent.verticalCenter + source: Dex.General.coinIcon(ticker) + } + + Dex.Text + { + anchors.verticalCenter: parent.verticalCenter + text: name + } + + Dex.Text + { + anchors.verticalCenter: parent.verticalCenter + text: type + color: Dex.Style.getCoinTypeColor(type) + font: Dex.DexTypo.overLine + } +} diff --git a/atomic_defi_design/Dex/Addressbook/EnableAssetModal.qml b/atomic_defi_design/Dex/Addressbook/EnableAssetModal.qml new file mode 100644 index 0000000000..63317676f5 --- /dev/null +++ b/atomic_defi_design/Dex/Addressbook/EnableAssetModal.qml @@ -0,0 +1,46 @@ +import QtQuick 2.15 +import QtQuick.Layouts 1.15 + +import "../Constants" as Dex +import Dex.Components 1.0 as Dex + +Dex.MultipageModal +{ + property string assetTicker + + Dex.MultipageModalContent + { + Layout.fillWidth: true + titleText: qsTr("Enable " + assetTicker) + + Dex.Text + { + Layout.fillWidth: true + text: qsTr("The selected address belongs to a disabled asset, you need to enabled it before sending.") + } + + footer: + [ + // Enable button + Dex.Button + { + text: qsTr("Enable") + + onClicked: + { + Dex.API.app.enable_coin(assetTicker) + close() + } + }, + + // Cancel button + Dex.Button + { + Layout.rightMargin: 5 + text: qsTr("Cancel") + + onClicked: close() + } + ] + } +} diff --git a/atomic_defi_design/Dex/Addressbook/Main.qml b/atomic_defi_design/Dex/Addressbook/Main.qml index 6573117de2..54e9ef95fc 100644 --- a/atomic_defi_design/Dex/Addressbook/Main.qml +++ b/atomic_defi_design/Dex/Addressbook/Main.qml @@ -13,6 +13,34 @@ import "../Wallet" as Wallet Item { + function trySend(address, type) + { + // Checks if the selected address type represents an asset standard instead of an asset. + if (Dex.API.app.portfolio_pg.global_cfg_mdl.is_coin_type(type)) + { + assetFromStandardSelectorLoader.address = address + assetFromStandardSelectorLoader.standard = type + assetFromStandardSelectorLoader.open() + } + + // Checks if the asset is currently enabled. + else if (!Dex.API.app.portfolio_pg.is_coin_enabled(type)) + { + enabledAssetModalLoader.assetTicker = type; + enabledAssetModalLoader.open() + } + + // If the coin is enabled, opens the send modal. + else + { + if (assetFromStandardSelectorLoader.visible) + assetFromStandardSelectorLoader.close() + Dex.API.app.wallet_pg.ticker = type + sendModalLoader.address = address + sendModalLoader.open() + } + } + ColumnLayout { anchors.fill: parent @@ -292,12 +320,7 @@ Item height: 25 iconSource: Qaterial.Icons.sendOutline color: "transparent" - onClicked: - { - Dex.API.app.wallet_pg.ticker = address_type - sendModalLoader.address = address_value - sendModalLoader.open() - } + onClicked: trySend(address_value, address_type) } } } @@ -341,4 +364,33 @@ Item address_field.enabled: false } } + + Dex.ModalLoader + { + id: assetFromStandardSelectorLoader + + property string standard + property string address + + onLoaded: item.standard = standard + + sourceComponent: AssetFromStandardSelector + { + onSelected: + { + trySend(assetFromStandardSelectorLoader.address, assetTicker) + } + } + } + + Dex.ModalLoader + { + id: enabledAssetModalLoader + + property string assetTicker + + onLoaded: item.assetTicker = assetTicker + + sourceComponent: EnableAssetModal { } + } } From 5236fef7d47e1364a4010510b05d95b30ce82620 Mon Sep 17 00:00:00 2001 From: syl Date: Thu, 19 May 2022 14:35:50 +0200 Subject: [PATCH 056/177] Coding style --- atomic_defi_design/Dex/Constants/General.qml | 13 +++++++++---- .../atomicdex/models/qt.global.coins.cfg.model.hpp | 2 +- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/atomic_defi_design/Dex/Constants/General.qml b/atomic_defi_design/Dex/Constants/General.qml index a4e55ca05a..8236c37e1e 100644 --- a/atomic_defi_design/Dex/Constants/General.qml +++ b/atomic_defi_design/Dex/Constants/General.qml @@ -17,11 +17,16 @@ QtObject { readonly property string custom_coin_icons_path: os_file_prefix + API.app.settings_pg.get_custom_coins_icons_path() + "/" readonly property string providerIconsPath: image_path + "providers/" - function coinIcon(ticker) { - if(ticker === "" || ticker === "All" || ticker===undefined) { + function coinIcon(ticker) + { + if (ticker === "" || ticker === "All" || ticker===undefined ) + { return "" - } else { - if (['THC-BEP20'].indexOf(ticker) >= 0) { + } + else + { + if (['THC-BEP20'].indexOf(ticker) >= 0) + { return coin_icons_path + ticker.toString().toLowerCase().replace('-', '_') + ".png" } const coin_info = API.app.portfolio_pg.global_cfg_mdl.get_coin_info(ticker) diff --git a/src/core/atomicdex/models/qt.global.coins.cfg.model.hpp b/src/core/atomicdex/models/qt.global.coins.cfg.model.hpp index e14f5bc208..94587cd6f5 100644 --- a/src/core/atomicdex/models/qt.global.coins.cfg.model.hpp +++ b/src/core/atomicdex/models/qt.global.coins.cfg.model.hpp @@ -94,7 +94,7 @@ namespace atomic_dex Q_INVOKABLE QStringList get_checked_coins() const; Q_INVOKABLE QVariant get_coin_info(const QString& ticker) const; Q_INVOKABLE QString get_parent_coin(const QString& ticker) const; - Q_INVOKABLE bool is_coin_type(const QString& ticker) const; // Tells if the given string is a valid coin type (e.g. QRC-20) + Q_INVOKABLE bool is_coin_type(const QString& ticker) const; // Tells if the given string is a valid coin type (e.g. QRC-20) // QML API properties Q_PROPERTY(global_coins_cfg_proxy_model* all_disabled_proxy READ get_all_disabled_proxy NOTIFY all_disabled_proxyChanged) From c911efcbf39a33ce34d50065b8cd5a32a0780653 Mon Sep 17 00:00:00 2001 From: syl Date: Thu, 19 May 2022 19:01:04 +0200 Subject: [PATCH 057/177] Addressbook: Fix address creation using an asset standard --- .../Dex/Addressbook/AddAddressForm.qml | 123 +++++------------- .../Dex/Addressbook/AddressTypeSelector.qml | 61 +++++++++ 2 files changed, 93 insertions(+), 91 deletions(-) create mode 100644 atomic_defi_design/Dex/Addressbook/AddressTypeSelector.qml diff --git a/atomic_defi_design/Dex/Addressbook/AddAddressForm.qml b/atomic_defi_design/Dex/Addressbook/AddAddressForm.qml index a1c75321b9..887130573a 100644 --- a/atomic_defi_design/Dex/Addressbook/AddAddressForm.qml +++ b/atomic_defi_design/Dex/Addressbook/AddAddressForm.qml @@ -11,6 +11,8 @@ import "../Constants" as Dex Dex.Rectangle { + id: root + property var contactModel // Edition mode variables @@ -19,6 +21,24 @@ Dex.Rectangle property string addressKey property string addressValue + // Return the asset type that will be used in the backend to validate the address + function getTypeForAddressChecker(addressType) + { + switch (addressType) + { + case "QRC-20": return "QTUM"; + case "BEP-20": return "BNB"; + case "ERC-20": return "ETH"; + case "Smart Chain": return "KMD"; + case "SLP": return "BCH"; + } + + let coinInfo = API.app.portfolio_pg.global_cfg_mdl.get_coin_info(addressType); + if (coinInfo.has_parent_fees_ticker) + return coinInfo.fees_ticker; + return walletType + } + signal cancel() signal addressCreated() @@ -45,10 +65,10 @@ Dex.Rectangle var indexLis = Dex.API.app.portfolio_pg.portfolio_mdl.match( Dex.API.app.portfolio_pg.portfolio_mdl.index(0, 0), - 33, addressType) + Qt.UserRole + 1, addressType) + //addres addressKeyField.text = addressKey addressValueField.text = addressValue - console.log(indexLis) } } @@ -58,97 +78,18 @@ Dex.Rectangle anchors.margins: 21 spacing: 17 - Dex.ComboBoxWithSearchBar + Dex.DefaultCheckBox { - id: addressTypeComboBox - - property var currentItem: Dex.API.app.portfolio_pg.portfolio_mdl.portfolio_proxy_mdl.get(currentIndex) + id: useStandardsCheckBox + text: qsTr("Use asset standard as address type") + } + AddressTypeSelector + { + id: addressTypeComboBox Layout.preferredWidth: 458 Layout.preferredHeight: 44 - model: Dex.API.app.portfolio_pg.portfolio_mdl.portfolio_proxy_mdl - popupForceMaxHeight: true - popupMaxHeight: 265 - textRole: "ticker" - searchBarPlaceholderText: qsTr("Search asset") - - delegate: ItemDelegate - { - id: _delegate - - width: addressTypeComboBox.width - height: 40 - highlighted: addressTypeComboBox.highlightedIndex === index - - contentItem: Row - { - spacing: 10 - - Dex.Image - { - width: 25 - height: 25 - anchors.verticalCenter: parent.verticalCenter - source: Dex.General.coinIcon(ticker) - } - - Dex.Text - { - anchors.verticalCenter: parent.verticalCenter - text: name - } - - Dex.Text - { - anchors.verticalCenter: parent.verticalCenter - text: model.type - color: Dex.Style.getCoinTypeColor(model.type) - font: Dex.DexTypo.overLine - } - } - - background: Dex.Rectangle - { - anchors.fill: _delegate - color: _delegate.highlighted ? Dex.CurrentTheme.comboBoxDropdownItemHighlightedColor : Dex.CurrentTheme.comboBoxBackgroundColor - } - } - - contentItem: Item - { - Row - { - anchors.left: parent.left - anchors.leftMargin: 13 - anchors.verticalCenter: parent.verticalCenter - spacing: 10 - - Dex.Image - { - width: 25 - height: 25 - anchors.verticalCenter: parent.verticalCenter - source: Dex.General.coinIcon(addressTypeComboBox.currentItem.ticker) - } - - Dex.Text - { - anchors.verticalCenter: parent.verticalCenter - text: addressTypeComboBox.currentItem.name - } - - Dex.Text - { - anchors.verticalCenter: parent.verticalCenter - text: addressTypeComboBox.currentItem.type - color: Dex.Style.getCoinTypeColor(addressTypeComboBox.currentItem.type) - font: Dex.DexTypo.overLine - } - } - } - - onSearchBarTextChanged: Dex.API.app.portfolio_pg.portfolio_mdl.portfolio_proxy_mdl.setFilterFixedString(patternStr) - Component.onDestruction: Dex.API.app.portfolio_pg.portfolio_mdl.portfolio_proxy_mdl.setFilterFixedString("") + showAssetStandards: useStandardsCheckBox.checked } Dex.TextField @@ -208,9 +149,9 @@ Dex.Rectangle onClicked: { if (isConvertMode) - Dex.API.app.wallet_pg.convert_address(addressValueField.text, addressTypeComboBox.currentText, API.app.wallet_pg.validate_address_data.to_address_format); + Dex.API.app.wallet_pg.convert_address(addressValueField.text, root.getTypeForAddressChecker(addressTypeComboBox.currentText), API.app.wallet_pg.validate_address_data.to_address_format); else - Dex.API.app.wallet_pg.validate_address(addressValueField.text, addressTypeComboBox.currentText) + Dex.API.app.wallet_pg.validate_address(addressValueField.text, root.getTypeForAddressChecker(addressTypeComboBox.currentText)) } } } diff --git a/atomic_defi_design/Dex/Addressbook/AddressTypeSelector.qml b/atomic_defi_design/Dex/Addressbook/AddressTypeSelector.qml new file mode 100644 index 0000000000..9c873e972d --- /dev/null +++ b/atomic_defi_design/Dex/Addressbook/AddressTypeSelector.qml @@ -0,0 +1,61 @@ +import QtQuick 2.12 +import QtQuick.Controls 2.15 +import QtQuick.Layouts 1.3 + +import Qaterial 1.0 as Qaterial + +import Dex.Themes 1.0 as Dex +import Dex.Components 1.0 as Dex +import "../Constants" as Dex + +Dex.ComboBoxWithSearchBar +{ + id: control + + property var currentItem: Dex.API.app.portfolio_pg.portfolio_mdl.portfolio_proxy_mdl.get(currentIndex) + property bool showAssetStandards: false + property var assetStandards: ["QRC-20", "ERC-20", "BEP-20", "Smart Chain"] + + popupForceMaxHeight: true + popupMaxHeight: 265 + model: showAssetStandards ? assetStandards : Dex.API.app.portfolio_pg.portfolio_mdl.portfolio_proxy_mdl + textRole: "ticker" + + delegate: ItemDelegate + { + id: _delegate + + width: control.width + height: 40 + highlighted: control.highlightedIndex === index + + contentItem: AssetRow + { + ticker: showAssetStandards ? modelData : model.ticker + name: showAssetStandards ? modelData : model.name + type: showAssetStandards ? modelData : model.type + } + + background: Dex.Rectangle + { + anchors.fill: _delegate + color: _delegate.highlighted ? Dex.CurrentTheme.comboBoxDropdownItemHighlightedColor : Dex.CurrentTheme.comboBoxBackgroundColor + } + } + + contentItem: Item + { + AssetRow + { + anchors.left: parent.left + anchors.leftMargin: 13 + anchors.verticalCenter: parent.verticalCenter + ticker: showAssetStandards ? assetStandards[currentIndex] : control.currentItem.ticker + name: showAssetStandards ? assetStandards[currentIndex] : control.currentItem.name + type: showAssetStandards ? assetStandards[currentIndex] : control.currentItem.type + } + } + + onSearchBarTextChanged: Dex.API.app.portfolio_pg.portfolio_mdl.portfolio_proxy_mdl.setFilterFixedString(patternStr) + Component.onDestruction: Dex.API.app.portfolio_pg.portfolio_mdl.portfolio_proxy_mdl.setFilterFixedString("") +} From cf4352a4e2f77ecdf89f597c871ef2c82af9bd7a Mon Sep 17 00:00:00 2001 From: syl Date: Fri, 20 May 2022 07:21:13 +0200 Subject: [PATCH 058/177] Addressbook: Make tags colorful --- assets/themes/Default - Dark/colors.json | 2 ++ assets/themes/Default - Light/colors.json | 2 ++ atomic_defi_design/Dex/Addressbook/Main.qml | 16 +++++++++++++--- atomic_defi_design/Dex/Graphics/Color.js | 9 +++++---- atomic_defi_design/Dex/Themes/CurrentTheme.qml | 8 ++++++++ atomic_defi_design/Dex/Themes/DefaultTheme.js | 2 ++ atomic_defi_design/Dex/Themes/ThemeData.qml | 3 +++ 7 files changed, 35 insertions(+), 7 deletions(-) diff --git a/assets/themes/Default - Dark/colors.json b/assets/themes/Default - Dark/colors.json index 254350d092..44ed38f7b4 100644 --- a/assets/themes/Default - Dark/colors.json +++ b/assets/themes/Default - Dark/colors.json @@ -94,6 +94,8 @@ "tradeSellModeSelectorBackgroundColorEnd": "#E216A9FF", "tradeMarketModeSelectorNotSelectedBackgroundColor": "#89B6FF21", + "addressBookTagColors": ["#627EEAFF", "#FFD87AFF", "#F7931AFF"], + "okColor": "#00C058FF", "noColor": "#E52167FF", diff --git a/assets/themes/Default - Light/colors.json b/assets/themes/Default - Light/colors.json index 5932c1b265..cebb3a5c77 100644 --- a/assets/themes/Default - Light/colors.json +++ b/assets/themes/Default - Light/colors.json @@ -91,6 +91,8 @@ "tradeSellModeSelectorBackgroundColorEnd": "#E216A9FF", "tradeMarketModeSelectorNotSelectedBackgroundColor": "#89B6FF21", + "addressBookTagColors": ["#627EEAFF", "#FFD87AFF", "#F7931AFF"], + "okColor": "#00C058FF", "noColor": "#E52167FF", diff --git a/atomic_defi_design/Dex/Addressbook/Main.qml b/atomic_defi_design/Dex/Addressbook/Main.qml index 54e9ef95fc..a46034e94d 100644 --- a/atomic_defi_design/Dex/Addressbook/Main.qml +++ b/atomic_defi_design/Dex/Addressbook/Main.qml @@ -124,6 +124,16 @@ Item { id: contactTable + function _getCurrentTagColorId() + { + if (typeof _getCurrentTagColorId.counter == 'undefined') + _getCurrentTagColorId.counter = 0 + if (_getCurrentTagColorId.counter >= Dex.CurrentTheme.addressBookTagColors.length) + _getCurrentTagColorId.counter = 0 + + return _getCurrentTagColorId.counter++ + } + Layout.fillWidth: true Layout.fillHeight: true @@ -133,8 +143,6 @@ Item { id: expandable - property color _tagBgColor: index % 2 !== 0 ? Dex.CurrentTheme.innerBackgroundColor : Dex.CurrentTheme.backgroundColor - padding: 10 color: index % 2 === 0 ? Dex.CurrentTheme.innerBackgroundColor : Dex.CurrentTheme.backgroundColor width: contactTable.width @@ -187,10 +195,12 @@ Item delegate: Dex.Rectangle { + property int _currentColorIndex: contactTable._getCurrentTagColorId() + width: tagLabel.width > 73 ? 83 : tagLabel.width + 10 height: 21 radius: 20 - color: expandable._tagBgColor + color: Dex.CurrentTheme.addressBookTagColors[_currentColorIndex] Dex.MouseArea { diff --git a/atomic_defi_design/Dex/Graphics/Color.js b/atomic_defi_design/Dex/Graphics/Color.js index 2926e4933e..ea42e4522d 100644 --- a/atomic_defi_design/Dex/Graphics/Color.js +++ b/atomic_defi_design/Dex/Graphics/Color.js @@ -13,13 +13,14 @@ // Returned ARGB string: "#AARRGGBB" function argbStrFromRgbaStr(rgbaString) { - if (rgbaString.length === 7) + let tempRgbaString = rgbaString + if (tempRgbaString.length === 7) { console.warn("Dex.Graphics.Color.argbStrFromRgbaStr: %1 is not an RGBA color" - .arg(rgbaString)); - return rgbaString; + .arg(tempRgbaString)); + return tempRgbaString; } // # A RGB - return "#" + rgbaString.substr(7, 2) + rgbaString.substr(1, 6); + return "#" + tempRgbaString.substr(7, 2) + tempRgbaString.substr(1, 6); } diff --git a/atomic_defi_design/Dex/Themes/CurrentTheme.qml b/atomic_defi_design/Dex/Themes/CurrentTheme.qml index 279d051eec..fa544b24c7 100644 --- a/atomic_defi_design/Dex/Themes/CurrentTheme.qml +++ b/atomic_defi_design/Dex/Themes/CurrentTheme.qml @@ -181,6 +181,12 @@ ThemeData tradeSellModeSelectorBackgroundColorEnd = Dex.Color.argbStrFromRgbaStr(themeData.tradeSellModeSelectorBackgroundColorEnd || defaultTheme.tradeSellModeSelectorBackgroundColorEnd); tradeMarketModeSelectorNotSelectedBackgroundColor = Dex.Color.argbStrFromRgbaStr(themeData.tradeMarketModeSelectorNotSelectedBackgroundColor || defaultTheme.tradeMarketModeSelectorNotSelectedBackgroundColor); + addressBookTagColors = themeData.addressBookTagColors || defaultTheme.addressBookTagColors + for (var i = 0; i < addressBookTagColors.length; i++) + { + addressBookTagColors[i] = Dex.Color.argbStrFromRgbaStr(addressBookTagColors[i]) + } + okColor = Dex.Color.argbStrFromRgbaStr(themeData.okColor || defaultTheme.okColor); noColor = Dex.Color.argbStrFromRgbaStr(themeData.noColor || defaultTheme.noColor); @@ -294,6 +300,8 @@ ThemeData console.info("Dex.Themes.CurrentTheme.printValues.tradeSellModeSelectorBackgroundColorEnd : %1".arg(tradeSellModeSelectorBackgroundColorEnd)); console.info("Dex.Themes.CurrentTheme.printValues.tradeMarketModeSelectorNotSelectedBackgroundColor : %1".arg(tradeMarketModeSelectorNotSelectedBackgroundColor)); + console.info("Dex.Themes.CurrentTheme.printValues.addressBookTagColors : %1".arg(addressBookTagColors)); + console.info("Dex.Themes.CurrentTheme.printValues.okColor : %1".arg(okColor)); console.info("Dex.Themes.CurrentTheme.printValues.noColor : %1".arg(noColor)); diff --git a/atomic_defi_design/Dex/Themes/DefaultTheme.js b/atomic_defi_design/Dex/Themes/DefaultTheme.js index 7cf351d449..b98da50a7d 100644 --- a/atomic_defi_design/Dex/Themes/DefaultTheme.js +++ b/atomic_defi_design/Dex/Themes/DefaultTheme.js @@ -97,6 +97,8 @@ function getHardcoded() tradeSellModeSelectorBackgroundColorEnd: "#E216A9FF", tradeMarketModeSelectorNotSelectedBackgroundColor: "#89B6FF21", + addressBookTagColors: ["#627EEAFF", "#FFD87AFF", "#F7931AFF"], + okColor: "#00C058FF", noColor: "#E52167FF", diff --git a/atomic_defi_design/Dex/Themes/ThemeData.qml b/atomic_defi_design/Dex/Themes/ThemeData.qml index 920d59caeb..2ba8e4e1e8 100644 --- a/atomic_defi_design/Dex/Themes/ThemeData.qml +++ b/atomic_defi_design/Dex/Themes/ThemeData.qml @@ -99,6 +99,9 @@ QtObject property color tradeSellModeSelectorBackgroundColorEnd property color tradeMarketModeSelectorNotSelectedBackgroundColor + // Address book page related + property var addressBookTagColors + // Colors used to tell when something is good or wrong. property color okColor property color noColor From e40529c2d92a80d116ad192cd795c2da48060619 Mon Sep 17 00:00:00 2001 From: syl Date: Fri, 20 May 2022 07:21:24 +0200 Subject: [PATCH 059/177] QML Components: Refactor ClickableText --- atomic_defi_design/Dex/Components/ClickableText.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/atomic_defi_design/Dex/Components/ClickableText.qml b/atomic_defi_design/Dex/Components/ClickableText.qml index 8f1af06991..7c4c6e86b6 100644 --- a/atomic_defi_design/Dex/Components/ClickableText.qml +++ b/atomic_defi_design/Dex/Components/ClickableText.qml @@ -4,7 +4,7 @@ import Dex.Themes 1.0 as Dex Text { - id: root + id: control property alias hoverEnabled: _mouseArea.hoverEnabled property alias containsMouse: _mouseArea.containsMouse @@ -26,6 +26,6 @@ Text anchors.fill: parent hoverEnabled: true cursorShape: containsMouse ? Qt.PointingHandCursor : Qt.ArrowCursor - onClicked: root.clicked(); + onClicked: control.clicked() } } From 23a93d7b9fcfb9610ced9e6d77a111203d847e2b Mon Sep 17 00:00:00 2001 From: syl Date: Fri, 20 May 2022 07:22:05 +0200 Subject: [PATCH 060/177] Fix dark theme color badly formatted --- assets/themes/Default - Dark/colors.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/themes/Default - Dark/colors.json b/assets/themes/Default - Dark/colors.json index 44ed38f7b4..2c4fad402a 100644 --- a/assets/themes/Default - Dark/colors.json +++ b/assets/themes/Default - Dark/colors.json @@ -9,7 +9,7 @@ "buttonColorDisabled": "#28375AFF", "buttonColorEnabled": "#293254FF", - "buttonColorHovered": "#4068B929FF", + "buttonColorHovered": "#4068B929", "buttonColorPressed": "#2932546C", "buttonTextDisabledColor": "#444444FF", "buttonTextEnabledColor": "#ffffffFF", From 213798c9f936319619f6da325d7e32aed2da6a2b Mon Sep 17 00:00:00 2001 From: syl Date: Fri, 20 May 2022 07:30:43 +0200 Subject: [PATCH 061/177] Addressbook: Make Edit/Remove labels look like more clickable --- atomic_defi_design/Dex/Addressbook/Main.qml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/atomic_defi_design/Dex/Addressbook/Main.qml b/atomic_defi_design/Dex/Addressbook/Main.qml index a46034e94d..9d388c837d 100644 --- a/atomic_defi_design/Dex/Addressbook/Main.qml +++ b/atomic_defi_design/Dex/Addressbook/Main.qml @@ -231,7 +231,8 @@ Item Dex.ClickableText { anchors.verticalCenter: parent.verticalCenter - font: Dex.DexTypo.body2 + font.underline: true + font.pixelSize: 15 text: qsTr("Edit") onClicked: { @@ -242,7 +243,8 @@ Item Dex.ClickableText { anchors.verticalCenter: parent.verticalCenter - font: Dex.DexTypo.body2 + font.underline: true + font.pixelSize: 15 text: qsTr("Delete") onClicked: Dex.API.app.addressbookPg.model.removeContact(modelData.name) } From ca5e37a0cca4705229544685a303e32cc8f32029 Mon Sep 17 00:00:00 2001 From: syl Date: Fri, 20 May 2022 07:31:10 +0200 Subject: [PATCH 062/177] Addressbook: Add confirmation popup before removing a contact --- atomic_defi_design/Dex/Addressbook/Main.qml | 9 +++- .../Dex/Addressbook/RemoveContactPopup.qml | 51 +++++++++++++++++++ 2 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 atomic_defi_design/Dex/Addressbook/RemoveContactPopup.qml diff --git a/atomic_defi_design/Dex/Addressbook/Main.qml b/atomic_defi_design/Dex/Addressbook/Main.qml index 9d388c837d..f360d46fcd 100644 --- a/atomic_defi_design/Dex/Addressbook/Main.qml +++ b/atomic_defi_design/Dex/Addressbook/Main.qml @@ -246,7 +246,14 @@ Item font.underline: true font.pixelSize: 15 text: qsTr("Delete") - onClicked: Dex.API.app.addressbookPg.model.removeContact(modelData.name) + onClicked: removeContactPopup.open() + + RemoveContactPopup + { + id: removeContactPopup + + contactName: modelData.name + } } } } diff --git a/atomic_defi_design/Dex/Addressbook/RemoveContactPopup.qml b/atomic_defi_design/Dex/Addressbook/RemoveContactPopup.qml new file mode 100644 index 0000000000..7ce8928135 --- /dev/null +++ b/atomic_defi_design/Dex/Addressbook/RemoveContactPopup.qml @@ -0,0 +1,51 @@ +// Qt Imports +import QtQuick 2.15 +import QtQuick.Layouts 1.15 + +// Project Imports +import "../Constants" as Dex +import Dex.Components 1.0 as Dex + +Dex.Popup +{ + id: root + + property string contactName + + width: 120 + height: 100 + + contentItem: ColumnLayout + { + spacing: 8 + width: root.width + + Dex.Text + { + Layout.fillWidth: true + text: qsTr("Do you want to remove this contact ?") + } + + Row + { + Layout.fillWidth: true + spacing: 6 + Dex.ClickableText + { + text: qsTr("Yes") + font.underline: true + onClicked: + { + Dex.API.app.addressbookPg.model.removeContact(contactName) + close() + } + } + Dex.ClickableText + { + text: qsTr("No") + font.underline: true + onClicked: close() + } + } + } +} From af9dc8c3fbb01b0464b0a44533438ffc6cac36b5 Mon Sep 17 00:00:00 2001 From: cipig Date: Fri, 27 May 2022 20:44:08 +0000 Subject: [PATCH 063/177] add BLK-BEP20 --- assets/config/0.5.5-coins.json | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/assets/config/0.5.5-coins.json b/assets/config/0.5.5-coins.json index 0de766b877..c387f6e6f5 100644 --- a/assets/config/0.5.5-coins.json +++ b/assets/config/0.5.5-coins.json @@ -979,6 +979,24 @@ "active": false, "currently_enabled": false }, + "BLK-BEP20": { + "coin": "BLK-BEP20", + "name": "BlackCoin", + "coinpaprika_id": "blk-blackcoin", + "coingecko_id": "blackcoin", + "nomics_id": "BLK", + "nodes": [ + "http://bsc1.cipig.net:8655", + "http://bsc2.cipig.net:8655", + "http://bsc3.cipig.net:8655" + ], + "explorer_url": [ + "https://bscscan.com/" + ], + "type": "BEP-20", + "active": false, + "currently_enabled": false + }, "tBLK": { "coin": "tBLK", "name": "BlackCoin (testnet)", From 634cd9911635200cac32ceb6d6987fdcbb676f45 Mon Sep 17 00:00:00 2001 From: cipig Date: Sat, 28 May 2022 10:31:17 +0000 Subject: [PATCH 064/177] make LUNA and UST wallet_only --- assets/config/0.5.5-coins.json | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/assets/config/0.5.5-coins.json b/assets/config/0.5.5-coins.json index c387f6e6f5..4741f3f87b 100644 --- a/assets/config/0.5.5-coins.json +++ b/assets/config/0.5.5-coins.json @@ -3747,7 +3747,8 @@ ], "type": "ERC-20", "active": false, - "currently_enabled": false + "currently_enabled": false, + "wallet_only": true }, "LUNA-BEP20": { "coin": "LUNA-BEP20", @@ -3764,7 +3765,8 @@ ], "type": "BEP-20", "active": false, - "currently_enabled": false + "currently_enabled": false, + "wallet_only": true }, "LUNA-HRC20": { "coin": "LUNA-HRC20", @@ -3780,7 +3782,8 @@ ], "type": "HRC-20", "active": false, - "currently_enabled": false + "currently_enabled": false, + "wallet_only": true }, "LUNA-PLG20": { "coin": "LUNA-PLG20", @@ -3795,7 +3798,8 @@ ], "type": "Matic", "active": false, - "currently_enabled": false + "currently_enabled": false, + "wallet_only": true }, "LYNX": { "coin": "LYNX", @@ -7364,7 +7368,8 @@ ], "type": "ERC-20", "active": false, - "currently_enabled": false + "currently_enabled": false, + "wallet_only": true }, "UST-BEP20": { "coin": "UST-BEP20", @@ -7381,7 +7386,8 @@ ], "type": "BEP-20", "active": false, - "currently_enabled": false + "currently_enabled": false, + "wallet_only": true }, "UST-HRC20": { "coin": "UST-HRC20", @@ -7397,7 +7403,8 @@ ], "type": "HRC-20", "active": false, - "currently_enabled": false + "currently_enabled": false, + "wallet_only": true }, "UST-PLG20": { "coin": "UST-PLG20", @@ -7412,7 +7419,8 @@ ], "type": "Matic", "active": false, - "currently_enabled": false + "currently_enabled": false, + "wallet_only": true }, "VAL": { "coin": "VAL", From 847161d5053329059e4b0f339f83a812d0dda2cb Mon Sep 17 00:00:00 2001 From: smk762 Date: Wed, 1 Jun 2022 10:49:31 +0800 Subject: [PATCH 065/177] Dex -> Default --- .../Dex/Components/DefaultImage.qml | 5 +-- .../Dex/Components/DefaultModal.qml | 4 +- .../Dex/Components/DefaultMouseArea.qml | 5 +-- .../Dex/Components/DefaultRectangle.qml | 9 +---- .../Dex/Components/DexCheckBox.qml | 8 ++-- .../Dex/Components/DexImage.qml | 3 +- .../Dex/Components/DexListView.qml | 2 +- .../Dex/Components/DexModal.qml | 4 +- .../Dex/Components/DexMouseArea.qml | 3 +- .../Dex/Components/DexPairItemBadge.qml | 2 +- .../Dex/Components/DexRectangle.qml | 6 ++- .../Dex/Components/DexScrollBarHorizontal.qml | 4 +- .../Dex/Components/DexScrollView.qml | 4 +- .../Dex/Components/DexSwitch.qml | 6 +-- .../Dex/Components/EulaModal.qml | 6 +-- .../Dex/Components/TextEditWithTitle.qml | 2 +- .../Dex/Components/TextFieldWithTitle.qml | 4 +- .../Dex/Dashboard/NotificationsModal.qml | 38 +++++++++++++------ .../ProView/PlaceOrderForm/OrderForm.qml | 2 +- .../ProView/TradingInfo/OrderLine.qml | 8 ++-- .../ProView/TradingInfo/OrderList.qml | 2 +- .../Dex/Exchange/Trade/ConfirmTradeModal.qml | 2 +- .../Dex/Portfolio/Portfolio.qml | 2 +- .../Dex/Screens/Startup/ImportWallet.qml | 4 +- .../Dex/Settings/AddCustomCoinModal.qml | 2 +- atomic_defi_design/Dex/Wallet/Main.qml | 2 +- .../Dex/Wallet/TransactionDetailsModal.qml | 2 +- 27 files changed, 73 insertions(+), 68 deletions(-) diff --git a/atomic_defi_design/Dex/Components/DefaultImage.qml b/atomic_defi_design/Dex/Components/DefaultImage.qml index cd38dadb58..09d4a0cb39 100644 --- a/atomic_defi_design/Dex/Components/DefaultImage.qml +++ b/atomic_defi_design/Dex/Components/DefaultImage.qml @@ -1,6 +1,3 @@ import QtQuick 2.15 -Image { - mipmap: true - fillMode: Image.PreserveAspectFit -} +DexImage {} diff --git a/atomic_defi_design/Dex/Components/DefaultModal.qml b/atomic_defi_design/Dex/Components/DefaultModal.qml index 20a9c3b422..8aa3f955bc 100644 --- a/atomic_defi_design/Dex/Components/DefaultModal.qml +++ b/atomic_defi_design/Dex/Components/DefaultModal.qml @@ -20,9 +20,9 @@ Popup closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside - background: DexRectangle { radius: root.radius; color: Dex.CurrentTheme.floatingBackgroundColor } + background: DefaultRectangle { radius: root.radius; color: Dex.CurrentTheme.floatingBackgroundColor } - Overlay.modal: DexRectangle { color: "#AA000000" } + Overlay.modal: DefaultRectangle { color: "#AA000000" } // Fade in animation onVisibleChanged: diff --git a/atomic_defi_design/Dex/Components/DefaultMouseArea.qml b/atomic_defi_design/Dex/Components/DefaultMouseArea.qml index 62648b6f0f..cac534d7ca 100644 --- a/atomic_defi_design/Dex/Components/DefaultMouseArea.qml +++ b/atomic_defi_design/Dex/Components/DefaultMouseArea.qml @@ -1,6 +1,3 @@ import QtQuick 2.15 -MouseArea -{ - cursorShape: containsMouse ? Qt.PointingHandCursor : Qt.ArrowCursor -} +DexMouseArea {} diff --git a/atomic_defi_design/Dex/Components/DefaultRectangle.qml b/atomic_defi_design/Dex/Components/DefaultRectangle.qml index 07fee4bb2a..7b2a0740b2 100644 --- a/atomic_defi_design/Dex/Components/DefaultRectangle.qml +++ b/atomic_defi_design/Dex/Components/DefaultRectangle.qml @@ -1,10 +1,3 @@ import QtQuick 2.15 -import Dex.Themes 1.0 as Dex - -AnimatedRectangle -{ - id: rect - color: Dex.CurrentTheme.backgroundColor -} - +DexRectangle {} diff --git a/atomic_defi_design/Dex/Components/DexCheckBox.qml b/atomic_defi_design/Dex/Components/DexCheckBox.qml index f575a2a5b1..ba70b88ebd 100644 --- a/atomic_defi_design/Dex/Components/DexCheckBox.qml +++ b/atomic_defi_design/Dex/Components/DexCheckBox.qml @@ -23,7 +23,7 @@ CheckBox Layout.preferredWidth: childrenRect.width Layout.preferredHeight: childrenRect.height - indicator: DexRectangle + indicator: DefaultRectangle { id: _indicator anchors.verticalCenter: control.verticalCenter @@ -39,7 +39,7 @@ CheckBox GradientStop { position: 0.6; color: Dex.CurrentTheme.checkBoxGradientEndColor } } - DexRectangle + DefaultRectangle { visible: !control.checked anchors.centerIn: parent @@ -59,7 +59,7 @@ CheckBox height: _label.height spacing: 0 - DexLabel + DefaultText { id: _label text: control.text @@ -72,7 +72,7 @@ CheckBox } } - DexMouseArea + DefaultMouseArea { id: mouse_area anchors.fill: parent diff --git a/atomic_defi_design/Dex/Components/DexImage.qml b/atomic_defi_design/Dex/Components/DexImage.qml index c0cbe489f5..603f734457 100644 --- a/atomic_defi_design/Dex/Components/DexImage.qml +++ b/atomic_defi_design/Dex/Components/DexImage.qml @@ -1,6 +1,7 @@ import QtQuick 2.15 -Image { +Image +{ mipmap: true fillMode: Image.PreserveAspectFit } \ No newline at end of file diff --git a/atomic_defi_design/Dex/Components/DexListView.qml b/atomic_defi_design/Dex/Components/DexListView.qml index 663968d873..120b20afca 100644 --- a/atomic_defi_design/Dex/Components/DexListView.qml +++ b/atomic_defi_design/Dex/Components/DexListView.qml @@ -31,7 +31,7 @@ ListView } } - ScrollBar.vertical: DexScrollBar + ScrollBar.vertical: DefaultScrollBar { id: scrollVert visibleBackground: root.visibleBackground diff --git a/atomic_defi_design/Dex/Components/DexModal.qml b/atomic_defi_design/Dex/Components/DexModal.qml index 80707bc240..915dc94717 100644 --- a/atomic_defi_design/Dex/Components/DexModal.qml +++ b/atomic_defi_design/Dex/Components/DexModal.qml @@ -13,14 +13,14 @@ Popup { property alias footer: _footer.contentItem modal: true padding: 0 - Overlay.modeless: DexRectangle { + Overlay.modeless: DefaultRectangle { color: DexTheme.dexBoxBackgroundColor opacity: .3 } background: ClipRRect { radius: 8 - DexRectangle { + DefaultRectangle { id: _backgroundColor anchors.fill: parent border.width: 2 diff --git a/atomic_defi_design/Dex/Components/DexMouseArea.qml b/atomic_defi_design/Dex/Components/DexMouseArea.qml index fa58b5512f..3f237b7d42 100644 --- a/atomic_defi_design/Dex/Components/DexMouseArea.qml +++ b/atomic_defi_design/Dex/Components/DexMouseArea.qml @@ -1,5 +1,6 @@ import QtQuick 2.15 -MouseArea { +MouseArea +{ cursorShape: enabled ? Qt.PointingHandCursor : Qt.ArrowCursor } \ No newline at end of file diff --git a/atomic_defi_design/Dex/Components/DexPairItemBadge.qml b/atomic_defi_design/Dex/Components/DexPairItemBadge.qml index 5c922acbe6..c50229eb1a 100644 --- a/atomic_defi_design/Dex/Components/DexPairItemBadge.qml +++ b/atomic_defi_design/Dex/Components/DexPairItemBadge.qml @@ -1,7 +1,7 @@ import QtQuick 2.15 import QtQuick.Layouts 1.15 -DexRectangle +DefaultRectangle { id: root property alias source: icon.source diff --git a/atomic_defi_design/Dex/Components/DexRectangle.qml b/atomic_defi_design/Dex/Components/DexRectangle.qml index e204762aba..e50813fd91 100644 --- a/atomic_defi_design/Dex/Components/DexRectangle.qml +++ b/atomic_defi_design/Dex/Components/DexRectangle.qml @@ -1,13 +1,15 @@ import QtQuick 2.15 import App 1.0 +import Dex.Themes 1.0 as Dex + AnimatedRectangle { id: rect property bool sizeAnimation: false property int sizeAnimationDuration: 150 radius: DexTheme.rectangleRadius - color: DexTheme.contentColorTopBold - border.color: DexTheme.contentColorTopBold + color: Dex.CurrentTheme.backgroundColor + border.color: Dex.CurrentTheme.backgroundColor border.width: 1 Behavior on width { diff --git a/atomic_defi_design/Dex/Components/DexScrollBarHorizontal.qml b/atomic_defi_design/Dex/Components/DexScrollBarHorizontal.qml index 858909ec33..6a953c5ca7 100644 --- a/atomic_defi_design/Dex/Components/DexScrollBarHorizontal.qml +++ b/atomic_defi_design/Dex/Components/DexScrollBarHorizontal.qml @@ -17,7 +17,7 @@ ScrollBar contentItem: Item { - DexRectangle + DefaultRectangle { width: parent.width height: parent.height @@ -31,7 +31,7 @@ ScrollBar { width: 6 x: 0 - DexRectangle + DefaultRectangle { visible: control.visibleBackground width: parent.width diff --git a/atomic_defi_design/Dex/Components/DexScrollView.qml b/atomic_defi_design/Dex/Components/DexScrollView.qml index 286dccdf44..2c831b545d 100644 --- a/atomic_defi_design/Dex/Components/DexScrollView.qml +++ b/atomic_defi_design/Dex/Components/DexScrollView.qml @@ -9,13 +9,13 @@ ScrollView property bool h_scrollbar_visible: contentItem.childrenRect.width > width clip: true - ScrollBar.vertical: DexScrollBar + ScrollBar.vertical: DefaultScrollBar { property bool scrollbar_visible: contentItem.childrenRect.height > height anchors.rightMargin: 3 } - ScrollBar.horizontal: DexScrollBar + ScrollBar.horizontal: DefaultScrollBar { property bool scrollbar_visible: h_scrollbar_visible anchors.bottomMargin: 3 diff --git a/atomic_defi_design/Dex/Components/DexSwitch.qml b/atomic_defi_design/Dex/Components/DexSwitch.qml index d0c124e8eb..d3aeb3f4bb 100644 --- a/atomic_defi_design/Dex/Components/DexSwitch.qml +++ b/atomic_defi_design/Dex/Components/DexSwitch.qml @@ -25,7 +25,7 @@ Switch height: 30 font.family: DexTypo.fontFamily - indicator: DexRectangle + indicator: DefaultRectangle { id: _indicator width: 52 @@ -107,7 +107,7 @@ Switch visible: _label.text != '' - DexLabel + DefaultText { id: _label Layout.fillHeight: true @@ -123,7 +123,7 @@ Switch } } - DexMouseArea + DefaultMouseArea { id: _mouseArea anchors.fill: control diff --git a/atomic_defi_design/Dex/Components/EulaModal.qml b/atomic_defi_design/Dex/Components/EulaModal.qml index 25855a1b3e..4191801010 100644 --- a/atomic_defi_design/Dex/Components/EulaModal.qml +++ b/atomic_defi_design/Dex/Components/EulaModal.qml @@ -41,7 +41,7 @@ MultipageModal contentWidth: eula_text.width - 10 contentHeight: eula_text.height - DexLabel + DefaultText { id: eula_text font: DexTypo.body1 @@ -53,7 +53,7 @@ MultipageModal } // Checkboxes - DexCheckBox + DefaultCheckBox { id: accept_eula Layout.preferredWidth: parent.width @@ -62,7 +62,7 @@ MultipageModal text: qsTr("Accept EULA") } - DexCheckBox + DefaultCheckBox { id: accept_tac Layout.preferredWidth: parent.width diff --git a/atomic_defi_design/Dex/Components/TextEditWithTitle.qml b/atomic_defi_design/Dex/Components/TextEditWithTitle.qml index d50b586a51..f1515e2366 100644 --- a/atomic_defi_design/Dex/Components/TextEditWithTitle.qml +++ b/atomic_defi_design/Dex/Components/TextEditWithTitle.qml @@ -23,7 +23,7 @@ ComponentWithTitle { Layout.fillWidth: true - DexLabel + DefaultText { id: text diff --git a/atomic_defi_design/Dex/Components/TextFieldWithTitle.qml b/atomic_defi_design/Dex/Components/TextFieldWithTitle.qml index 4b7728e740..856c19dd0a 100644 --- a/atomic_defi_design/Dex/Components/TextFieldWithTitle.qml +++ b/atomic_defi_design/Dex/Components/TextFieldWithTitle.qml @@ -40,7 +40,7 @@ ColumnLayout visible: text !== '' } - DexLabel + DefaultText { visible: required && input_field.text === '' font.pixelSize: Style.textSizeSmall2 @@ -49,7 +49,7 @@ ColumnLayout } } - DexTextField + DefaultTextField { id: input_field diff --git a/atomic_defi_design/Dex/Dashboard/NotificationsModal.qml b/atomic_defi_design/Dex/Dashboard/NotificationsModal.qml index de85fbad5e..102cdc1ec3 100644 --- a/atomic_defi_design/Dex/Dashboard/NotificationsModal.qml +++ b/atomic_defi_design/Dex/Dashboard/NotificationsModal.qml @@ -389,6 +389,7 @@ DexPopup if (API.app.settings_pg.notification_enabled) tray.showMessage(title, message) } + SystemTrayIcon { id: tray @@ -396,12 +397,14 @@ DexPopup iconSource: General.image_path + "dex-tray-icon.png" tooltip: API.app_name + onMessageClicked: { if (notifications_list.length > 0) performNotificationAction(notifications_list[0]) showApp() } + menu: Menu { MenuItem @@ -430,7 +433,8 @@ DexPopup anchors.margins: 30 anchors.topMargin: 20 spacing: 24 - DexLabel + + DefaultText { Layout.fillWidth: true font @@ -460,7 +464,7 @@ DexPopup { anchors.centerIn: parent visible: !list.visible - text_value: qsTr("There isn't any notification") + text_value: qsTr("There aren't any notifications") font.pixelSize: 14 } @@ -472,13 +476,17 @@ DexPopup height: parent.height anchors.horizontalCenter: parent.horizontalCenter model: notifications_list + delegate: Item { + height: _column.height + 10 + width: list.width Rectangle { anchors.fill: parent opacity: 0.7 + gradient: Gradient { orientation: Qt.Horizontal @@ -500,8 +508,6 @@ DexPopup notifications_list.splice(index, 1) notifications_list = notifications_list } - height: _column.height + 10 - width: list.width RowLayout { @@ -510,29 +516,31 @@ DexPopup { Layout.fillHeight: true Layout.preferredWidth: 60 + Rectangle { width: 23 height: 23 radius: 12 gradient: notification_map[modelData.kind].gradient - anchors.right: parent.right anchors.rightMargin: -5 y: 13 + Qaterial.Icon { anchors.centerIn: parent size: 16 icon: notification_map[modelData.kind].icon - } } } + Item { Layout.fillHeight: true Layout.fillWidth: true + Column { id: _column @@ -541,28 +549,31 @@ DexPopup topPadding: 10 bottomPadding: 5 spacing: 5 - DexLabel + + DefaultText { text: modelData.title font: DexTypo.subtitle1 width: parent.width wrapMode: Label.Wrap } - DexLabel + + DefaultText { text: modelData.message font: DexTypo.subtitle2 width: parent.width - 20 wrapMode: Label.Wrap } - DexLabel + + DefaultText { text: modelData.human_date font: DexTypo.caption opacity: 0.7 } - } + Qaterial.AppBarButton { id: action_button @@ -573,6 +584,7 @@ DexPopup anchors.bottomMargin: -4 foregroundColor: DexTheme.foregroundColor visible: modelData.event_name !== "check" + icon.source: { let name @@ -611,11 +623,13 @@ DexPopup console.log("Retrying to enable", event_before_removal.params.coin, "asset...") API.app.enable_coins([event_before_removal.params.coin]) break + case "onMismatchCustomCoinConfiguration": console.log("Restarting for", event_before_removal.params.asset, "custom asset configuration mismatch...") root.close() restart_modal.open() break + default: removeNotification() break @@ -625,12 +639,13 @@ DexPopup } } - DexMouseArea + DefaultMouseArea { id: mouseArea hoverEnabled: true cursorShape: "PointingHandCursor" anchors.fill: parent + onClicked: { performNotificationAction(notifications_list[index]) @@ -639,7 +654,6 @@ DexPopup } } } - } OutlineButton diff --git a/atomic_defi_design/Dex/Exchange/ProView/PlaceOrderForm/OrderForm.qml b/atomic_defi_design/Dex/Exchange/ProView/PlaceOrderForm/OrderForm.qml index 33b26af5e4..579fd711e6 100644 --- a/atomic_defi_design/Dex/Exchange/ProView/PlaceOrderForm/OrderForm.qml +++ b/atomic_defi_design/Dex/Exchange/ProView/PlaceOrderForm/OrderForm.qml @@ -197,7 +197,7 @@ ColumnLayout Layout.fillWidth: true spacing: 5 - DexCheckBox + DefaultCheckBox { id: _useCustomMinTradeAmountCheckbox boxWidth: 20 diff --git a/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/OrderLine.qml b/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/OrderLine.qml index 428c58fe8b..7ecda52d5d 100644 --- a/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/OrderLine.qml +++ b/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/OrderLine.qml @@ -23,7 +23,7 @@ FloatingBackground color: mouse_area.containsMouse ? Dex.CurrentTheme.accentColor : Dex.CurrentTheme.floatingBackgroundColor radius: 0 - DexMouseArea + DefaultMouseArea { id: mouse_area anchors.fill: parent @@ -153,7 +153,7 @@ FloatingBackground Layout.fillWidth: true Layout.preferredHeight: childrenRect.height - DexImage + DefaultImage { id: baseIcon @@ -208,7 +208,7 @@ FloatingBackground maximumLineCount: 1 } - DexImage + DefaultImage { id: relCoin @@ -238,7 +238,7 @@ FloatingBackground text_value: Style.warningCharacter color: Style.colorYellow - DexTooltip + DefaultTooltip { contentItem: DefaultText { diff --git a/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/OrderList.qml b/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/OrderList.qml index 75586a8511..7a5a4aa007 100644 --- a/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/OrderList.qml +++ b/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/OrderList.qml @@ -27,7 +27,7 @@ Item Layout.maximumWidth: 511 } - DexListView + DefaultListView { id: list diff --git a/atomic_defi_design/Dex/Exchange/Trade/ConfirmTradeModal.qml b/atomic_defi_design/Dex/Exchange/Trade/ConfirmTradeModal.qml index f9859b5d06..9b26578e31 100644 --- a/atomic_defi_design/Dex/Exchange/Trade/ConfirmTradeModal.qml +++ b/atomic_defi_design/Dex/Exchange/Trade/ConfirmTradeModal.qml @@ -101,7 +101,7 @@ MultipageModal spacing: 10 - DexRectangle { + DefaultRectangle { Layout.alignment: Qt.AlignCenter Layout.preferredHeight: fees_detail.height + 20 Layout.preferredWidth: parent.width - 60 diff --git a/atomic_defi_design/Dex/Portfolio/Portfolio.qml b/atomic_defi_design/Dex/Portfolio/Portfolio.qml index b9d34d56f7..6834b55851 100644 --- a/atomic_defi_design/Dex/Portfolio/Portfolio.qml +++ b/atomic_defi_design/Dex/Portfolio/Portfolio.qml @@ -240,7 +240,7 @@ Item { Layout.fillWidth: true } - DexCheckBox + DefaultCheckBox { id: hide_zero_balance_checkbox diff --git a/atomic_defi_design/Dex/Screens/Startup/ImportWallet.qml b/atomic_defi_design/Dex/Screens/Startup/ImportWallet.qml index f5966b22bd..4ae49ccf6e 100644 --- a/atomic_defi_design/Dex/Screens/Startup/ImportWallet.qml +++ b/atomic_defi_design/Dex/Screens/Startup/ImportWallet.qml @@ -40,7 +40,7 @@ SetupPage } } - content: DexRectangle + content: DefaultRectangle { color: Dex.CurrentTheme.floatingBackgroundColor width: column_layout.width + 50 @@ -198,7 +198,7 @@ SetupPage } } - DexLabel + DefaultText { id: _seedError visible: _seedField.error diff --git a/atomic_defi_design/Dex/Settings/AddCustomCoinModal.qml b/atomic_defi_design/Dex/Settings/AddCustomCoinModal.qml index 1bde24162a..da91a1695a 100644 --- a/atomic_defi_design/Dex/Settings/AddCustomCoinModal.qml +++ b/atomic_defi_design/Dex/Settings/AddCustomCoinModal.qml @@ -358,7 +358,7 @@ MultipageModal } } - DexCheckBox + DefaultCheckBox { id: input_active enabled: !has_contract_address diff --git a/atomic_defi_design/Dex/Wallet/Main.qml b/atomic_defi_design/Dex/Wallet/Main.qml index 2ad15bb2f2..407c48a87b 100644 --- a/atomic_defi_design/Dex/Wallet/Main.qml +++ b/atomic_defi_design/Dex/Wallet/Main.qml @@ -875,7 +875,7 @@ Item width: transactions_bg.width height: transactions_bg.height - DexRectangle + DefaultRectangle { anchors.fill: parent gradient: Gradient diff --git a/atomic_defi_design/Dex/Wallet/TransactionDetailsModal.qml b/atomic_defi_design/Dex/Wallet/TransactionDetailsModal.qml index 3e02537010..e5a7c4381a 100644 --- a/atomic_defi_design/Dex/Wallet/TransactionDetailsModal.qml +++ b/atomic_defi_design/Dex/Wallet/TransactionDetailsModal.qml @@ -86,7 +86,7 @@ MultipageModal label.font.pixelSize: 13 } - DexRectangle { + DefaultRectangle { Layout.fillWidth: true Layout.preferredHeight: addressColumn.height + 10 color: DexTheme.contentColorTop From 06d78bae708dfb46c22cc45e25fd68266d52ebdf Mon Sep 17 00:00:00 2001 From: smk762 Date: Wed, 1 Jun 2022 17:36:30 +0800 Subject: [PATCH 066/177] code style --- .../Dex/Components/DefaultPairItemBadge.qml | 7 ----- .../Dex/Components/DexBusyIndicator.qml | 28 +++++++++---------- .../Dex/Components/DexCheckBox.qml | 6 ++-- .../Dex/Components/DexScrollView.qml | 23 --------------- .../Dex/Components/HideFieldButton.qml | 6 ++-- ...DexPairItemBadge.qml => PairItemBadge.qml} | 4 +-- ...Horizontal.qml => ScrollBarHorizontal.qml} | 1 - .../Dex/Components/TextAreaWithTitle.qml | 2 +- .../Dex/Components/TextFieldWithTitle.qml | 2 +- .../ProView/TradingInfo/OrderLine.qml | 10 +++---- .../ProView/TradingInfo/OrderModal.qml | 4 +-- .../Dex/Exchange/Trade/ConfirmTradeModal.qml | 4 +-- atomic_defi_design/Dex/Wallet/Main.qml | 4 +-- 13 files changed, 34 insertions(+), 67 deletions(-) delete mode 100644 atomic_defi_design/Dex/Components/DefaultPairItemBadge.qml delete mode 100644 atomic_defi_design/Dex/Components/DexScrollView.qml rename atomic_defi_design/Dex/Components/{DexPairItemBadge.qml => PairItemBadge.qml} (97%) rename atomic_defi_design/Dex/Components/{DexScrollBarHorizontal.qml => ScrollBarHorizontal.qml} (99%) diff --git a/atomic_defi_design/Dex/Components/DefaultPairItemBadge.qml b/atomic_defi_design/Dex/Components/DefaultPairItemBadge.qml deleted file mode 100644 index eccb53a75f..0000000000 --- a/atomic_defi_design/Dex/Components/DefaultPairItemBadge.qml +++ /dev/null @@ -1,7 +0,0 @@ -import QtQuick 2.15 -import QtQuick.Controls 2.15 -import QtQuick.Controls.Universal 2.15 -import "../Constants" -import App 1.0 - -DexPairItemBadge {} \ No newline at end of file diff --git a/atomic_defi_design/Dex/Components/DexBusyIndicator.qml b/atomic_defi_design/Dex/Components/DexBusyIndicator.qml index 875e3553ad..0390ddea6e 100644 --- a/atomic_defi_design/Dex/Components/DexBusyIndicator.qml +++ b/atomic_defi_design/Dex/Components/DexBusyIndicator.qml @@ -8,21 +8,21 @@ import App 1.0 BusyIndicator { id: control - property int indicator_size: 64 - property int indicator_dot_size: 10 + property int indicatorSize: 64 + property int indicatorDotSize: 10 contentItem: Item { - implicitWidth: indicator_size - implicitHeight: indicator_size + implicitWidth: indicatorSize + implicitHeight: indicatorSize Item { id: item - x: (parent.width - indicator_size) / 2 - y: (parent.height - indicator_size) / 2 - width: indicator_size - height: indicator_size + x: (parent.width - indicatorSize) / 2 + y: (parent.height - indicatorSize) / 2 + width: indicatorSize + height: indicatorSize opacity: control.running ? 1 : 0 Behavior on opacity @@ -52,20 +52,20 @@ BusyIndicator { x: (item.width - width) / 2 y: (item.height - height) / 2 - implicitWidth: indicator_dot_size - implicitHeight: indicator_dot_size - radius: indicator_dot_size / 2 + implicitWidth: indicatorDotSize + implicitHeight: indicatorDotSize + radius: indicatorDotSize / 2 color: Dex.CurrentTheme.busyIndicatorColor transform: [ Translate { - y: -Math.min(item.width, item.height) * 0.5 + indicator_dot_size / 2 + y: -Math.min(item.width, item.height) * 0.5 + indicatorDotSize / 2 }, Rotation { angle: index / repeater.count * 360 - origin.x: indicator_dot_size / 2 - origin.y: indicator_dot_size / 2 + origin.x: indicatorDotSize / 2 + origin.y: indicatorDotSize / 2 } ] } diff --git a/atomic_defi_design/Dex/Components/DexCheckBox.qml b/atomic_defi_design/Dex/Components/DexCheckBox.qml index ba70b88ebd..5bdd10b191 100644 --- a/atomic_defi_design/Dex/Components/DexCheckBox.qml +++ b/atomic_defi_design/Dex/Components/DexCheckBox.qml @@ -15,13 +15,11 @@ CheckBox property alias label: _label property alias boxWidth: _indicator.implicitWidth property alias boxHeight: _indicator.implicitHeight - property alias mouseArea: mouse_area + property alias mouseArea: mouseArea property color textColor: Dex.CurrentTheme.foregroundColor property int labelWidth: 0 font.family: Style.font_family - Layout.preferredWidth: childrenRect.width - Layout.preferredHeight: childrenRect.height indicator: DefaultRectangle { @@ -74,7 +72,7 @@ CheckBox DefaultMouseArea { - id: mouse_area + id: mouseArea anchors.fill: parent acceptedButtons: Qt.NoButton } diff --git a/atomic_defi_design/Dex/Components/DexScrollView.qml b/atomic_defi_design/Dex/Components/DexScrollView.qml deleted file mode 100644 index 2c831b545d..0000000000 --- a/atomic_defi_design/Dex/Components/DexScrollView.qml +++ /dev/null @@ -1,23 +0,0 @@ -import QtQuick 2.15 -import QtQuick.Controls 2.15 - -import Dex.Themes 1.0 as Dex - -ScrollView -{ - id: control - property bool h_scrollbar_visible: contentItem.childrenRect.width > width - clip: true - - ScrollBar.vertical: DefaultScrollBar - { - property bool scrollbar_visible: contentItem.childrenRect.height > height - anchors.rightMargin: 3 - } - - ScrollBar.horizontal: DefaultScrollBar - { - property bool scrollbar_visible: h_scrollbar_visible - anchors.bottomMargin: 3 - } -} diff --git a/atomic_defi_design/Dex/Components/HideFieldButton.qml b/atomic_defi_design/Dex/Components/HideFieldButton.qml index 7ebf622afb..d2657d7873 100644 --- a/atomic_defi_design/Dex/Components/HideFieldButton.qml +++ b/atomic_defi_design/Dex/Components/HideFieldButton.qml @@ -3,7 +3,7 @@ import "../Constants" import App 1.0 DefaultImage { - property alias mouse_area: mouse_area + property alias mouseArea: mouseArea property bool use_default_behaviour: true source: General.image_path + "dashboard-eye" + (hiding ? "" : "-hide") + ".svg" visible: hidable @@ -13,10 +13,10 @@ DefaultImage { anchors.verticalCenter: parent.verticalCenter antialiasing: true - opacity: mouse_area.containsMouse ? Style.hoverOpacity : 1 + opacity: mouseArea.containsMouse ? Style.hoverOpacity : 1 DefaultMouseArea { - id: mouse_area + id: mouseArea anchors { horizontalCenter: parent.horizontalCenter; verticalCenter: parent.verticalCenter } height: input_field.height; width: input_field.height diff --git a/atomic_defi_design/Dex/Components/DexPairItemBadge.qml b/atomic_defi_design/Dex/Components/PairItemBadge.qml similarity index 97% rename from atomic_defi_design/Dex/Components/DexPairItemBadge.qml rename to atomic_defi_design/Dex/Components/PairItemBadge.qml index c50229eb1a..d109a7dd23 100644 --- a/atomic_defi_design/Dex/Components/DexPairItemBadge.qml +++ b/atomic_defi_design/Dex/Components/PairItemBadge.qml @@ -9,8 +9,8 @@ DefaultRectangle property alias fullname: fullname.text property alias amount: amount.text - Layout.preferredWidth: 260 - Layout.preferredHeight: 66 + width: 260 + height: 66 radius: 10 RowLayout diff --git a/atomic_defi_design/Dex/Components/DexScrollBarHorizontal.qml b/atomic_defi_design/Dex/Components/ScrollBarHorizontal.qml similarity index 99% rename from atomic_defi_design/Dex/Components/DexScrollBarHorizontal.qml rename to atomic_defi_design/Dex/Components/ScrollBarHorizontal.qml index 6a953c5ca7..6b4644cd62 100644 --- a/atomic_defi_design/Dex/Components/DexScrollBarHorizontal.qml +++ b/atomic_defi_design/Dex/Components/ScrollBarHorizontal.qml @@ -4,7 +4,6 @@ import QtQuick.Controls 2.15 import App 1.0 import Dex.Themes 1.0 as Dex - ScrollBar { id: control diff --git a/atomic_defi_design/Dex/Components/TextAreaWithTitle.qml b/atomic_defi_design/Dex/Components/TextAreaWithTitle.qml index 93263f2072..9076dd04ce 100644 --- a/atomic_defi_design/Dex/Components/TextAreaWithTitle.qml +++ b/atomic_defi_design/Dex/Components/TextAreaWithTitle.qml @@ -15,7 +15,7 @@ ColumnLayout property alias field: input_field property alias save_button: save_button property alias hide_button: hide_button - property alias hide_button_area: hide_button.mouse_area + property alias hide_button_area: hide_button.mouseArea property bool copyable: false property bool hidable: false property var onReturn // function diff --git a/atomic_defi_design/Dex/Components/TextFieldWithTitle.qml b/atomic_defi_design/Dex/Components/TextFieldWithTitle.qml index 856c19dd0a..0ee1d04381 100644 --- a/atomic_defi_design/Dex/Components/TextFieldWithTitle.qml +++ b/atomic_defi_design/Dex/Components/TextFieldWithTitle.qml @@ -20,7 +20,7 @@ ColumnLayout property alias title: title_text.text property alias field: input_field property alias hide_button: hide_button - property alias hide_button_area: hide_button.mouse_area + property alias hide_button_area: hide_button.mouseArea // Local function reset() diff --git a/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/OrderLine.qml b/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/OrderLine.qml index 7ecda52d5d..4dadd1fe8d 100644 --- a/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/OrderLine.qml +++ b/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/OrderLine.qml @@ -15,17 +15,17 @@ FloatingBackground Layout.fillWidth: true property var details - property alias clickable: mouse_area.enabled + property alias clickable: mouseArea.enabled readonly property bool is_placed_order: !details ? false : details.order_id !== '' height: 50 - color: mouse_area.containsMouse ? Dex.CurrentTheme.accentColor : Dex.CurrentTheme.floatingBackgroundColor + color: mouseArea.containsMouse ? Dex.CurrentTheme.accentColor : Dex.CurrentTheme.floatingBackgroundColor radius: 0 DefaultMouseArea { - id: mouse_area + id: mouseArea anchors.fill: parent hoverEnabled: enabled onClicked: @@ -246,7 +246,7 @@ FloatingBackground font.pixelSize: Style.textSizeSmall4 } - visible: (parent.visible && mouse_area.containsMouse) ?? false + visible: (parent.visible && mouseArea.containsMouse) ?? false } } @@ -256,7 +256,7 @@ FloatingBackground anchors.centerIn: parent anchors.fill: parent - visible: (!is_history ? details.cancellable ?? false : false) === true ? (mouse_area.containsMouse || hovered) ? true : false : false + visible: (!is_history ? details.cancellable ?? false : false) === true ? (mouseArea.containsMouse || hovered) ? true : false : false outlinedColor: Dex.CurrentTheme.noColor hoverEnabled: true diff --git a/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/OrderModal.qml b/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/OrderModal.qml index ff0699c5fd..ed271a7903 100644 --- a/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/OrderModal.qml +++ b/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/OrderModal.qml @@ -60,7 +60,7 @@ MultipageModal Layout.topMargin: 15 height: 70 - DefaultPairItemBadge + PairItemBadge { source: General.coinIcon(!details ? atomic_app_primary_coin : details.base_coin) ticker: details ? details.base_coin : "" @@ -77,7 +77,7 @@ MultipageModal icon: Qaterial.Icons.swapHorizontal } - DefaultPairItemBadge + PairItemBadge { source: General.coinIcon(!details ? atomic_app_primary_coin : details.rel_coin) ticker: details ? details.rel_coin : "" diff --git a/atomic_defi_design/Dex/Exchange/Trade/ConfirmTradeModal.qml b/atomic_defi_design/Dex/Exchange/Trade/ConfirmTradeModal.qml index 9b26578e31..c8ec5cde23 100644 --- a/atomic_defi_design/Dex/Exchange/Trade/ConfirmTradeModal.qml +++ b/atomic_defi_design/Dex/Exchange/Trade/ConfirmTradeModal.qml @@ -33,7 +33,7 @@ MultipageModal { id: dex_pair_badges - DefaultPairItemBadge + PairItemBadge { source: General.coinIcon(!base_ticker ? atomic_app_primary_coin : base_ticker) ticker: base_ticker @@ -50,7 +50,7 @@ MultipageModal icon: Qaterial.Icons.swapHorizontal } - DefaultPairItemBadge + PairItemBadge { source: General.coinIcon(!rel_ticker ? atomic_app_primary_coin : rel_ticker) ticker: rel_ticker diff --git a/atomic_defi_design/Dex/Wallet/Main.qml b/atomic_defi_design/Dex/Wallet/Main.qml index 407c48a87b..46ac84c9b5 100644 --- a/atomic_defi_design/Dex/Wallet/Main.qml +++ b/atomic_defi_design/Dex/Wallet/Main.qml @@ -906,8 +906,8 @@ Item Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter Layout.preferredWidth: Style.textSizeSmall3 Layout.preferredHeight: Layout.preferredWidth - indicator_size: 32 - indicator_dot_size: 5 + indicatorSize: 32 + indicatorDotSize: 5 } DefaultText From acfea51b443069682c79fbaf83b2fbda27432b2d Mon Sep 17 00:00:00 2001 From: cipig Date: Thu, 2 Jun 2022 00:12:27 +0000 Subject: [PATCH 067/177] add ws_url for ILN electrums --- assets/config/0.5.5-coins.json | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/assets/config/0.5.5-coins.json b/assets/config/0.5.5-coins.json index 4741f3f87b..01aad44510 100644 --- a/assets/config/0.5.5-coins.json +++ b/assets/config/0.5.5-coins.json @@ -6242,10 +6242,12 @@ "nomics_id": "ILNPOS", "electrum": [ { - "url": "electrum1.ilien.io:65011" + "url": "electrum1.ilien.io:65011", + "ws_url": "electrum1.ilien.io:30069" }, { - "url": "electrum2.ilien.io:65011" + "url": "electrum2.ilien.io:65011", + "ws_url": "electrum2.ilien.io:30069" } ], "explorer_url": [ From 7fe661e2960fe00b8bd15f582760b0e531e20f0a Mon Sep 17 00:00:00 2001 From: cipig Date: Thu, 2 Jun 2022 00:24:00 +0000 Subject: [PATCH 068/177] add ws_url for LYNX electrums --- assets/config/0.5.5-coins.json | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/assets/config/0.5.5-coins.json b/assets/config/0.5.5-coins.json index 01aad44510..fc5b458121 100644 --- a/assets/config/0.5.5-coins.json +++ b/assets/config/0.5.5-coins.json @@ -3810,23 +3810,28 @@ "electrum": [ { "url": "electrum5.getlynx.io:50002", - "protocol": "SSL" + "protocol": "SSL", + "ws_url": "electrum5.getlynx.io:50004" }, { "url": "electrum6.getlynx.io:50002", - "protocol": "SSL" + "protocol": "SSL", + "ws_url": "electrum6.getlynx.io:50004" }, { "url": "electrum7.getlynx.io:50002", - "protocol": "SSL" + "protocol": "SSL", + "ws_url": "electrum7.getlynx.io:50004" }, { "url": "electrum8.getlynx.io:50002", - "protocol": "SSL" + "protocol": "SSL", + "ws_url": "electrum8.getlynx.io:50004" }, { "url": "electrum9.getlynx.io:50002", - "protocol": "SSL" + "protocol": "SSL", + "ws_url": "electrum9.getlynx.io:50004" } ], "explorer_url": [ From 4957c2fb55233107ca3f9702e5866d20a599ca7b Mon Sep 17 00:00:00 2001 From: cipig Date: Thu, 2 Jun 2022 00:51:57 +0000 Subject: [PATCH 069/177] add ws_url for ZER electrums --- assets/config/0.5.5-coins.json | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/assets/config/0.5.5-coins.json b/assets/config/0.5.5-coins.json index fc5b458121..e93deaec77 100644 --- a/assets/config/0.5.5-coins.json +++ b/assets/config/0.5.5-coins.json @@ -8060,13 +8060,16 @@ "nomics_id": "ZER", "electrum": [ { - "url": "electrum1.cipig.net:10065" + "url": "electrum1.cipig.net:10065", + "ws_url": "electrum1.cipig.net:30065" }, { - "url": "electrum2.cipig.net:10065" + "url": "electrum2.cipig.net:10065", + "ws_url": "electrum2.cipig.net:30065" }, { - "url": "electrum3.cipig.net:10065" + "url": "electrum3.cipig.net:10065", + "ws_url": "electrum3.cipig.net:30065" } ], "explorer_url": [ From 23c740ac6ac462362cf5f90e902dbf568fa1c920 Mon Sep 17 00:00:00 2001 From: cipig Date: Thu, 2 Jun 2022 01:17:01 +0000 Subject: [PATCH 070/177] add ws_url for DIMI electrums --- assets/config/0.5.5-coins.json | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/assets/config/0.5.5-coins.json b/assets/config/0.5.5-coins.json index e93deaec77..02ac55a8ac 100644 --- a/assets/config/0.5.5-coins.json +++ b/assets/config/0.5.5-coins.json @@ -2179,12 +2179,14 @@ { "url": "electrumx1.diminutivecoin.com:50012", "protocol": "SSL", - "disable_cert_verification": true + "disable_cert_verification": true, + "ws_url": "electrumx1.diminutivecoin.com:50013" }, { "url": "electrumx2.diminutivecoin.com:50012", "protocol": "SSL", - "disable_cert_verification": true + "disable_cert_verification": true, + "ws_url": "electrumx2.diminutivecoin.com:50013" } ], "explorer_url": [ From 4ff2a79e6b459a301dafdcee15ca0934dd467def Mon Sep 17 00:00:00 2001 From: cipig Date: Thu, 2 Jun 2022 02:12:44 +0000 Subject: [PATCH 071/177] add ws_url for VAL electrums --- assets/config/0.5.5-coins.json | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/assets/config/0.5.5-coins.json b/assets/config/0.5.5-coins.json index 02ac55a8ac..bff45a8db7 100644 --- a/assets/config/0.5.5-coins.json +++ b/assets/config/0.5.5-coins.json @@ -7441,17 +7441,20 @@ { "url": "e1.validitytech.com:11002", "protocol": "SSL", - "disable_cert_verification": true + "disable_cert_verification": true, + "ws_url": "e1.validitytech.com:11004" }, { "url": "e2.validitytech.com:11002", "protocol": "SSL", - "disable_cert_verification": true + "disable_cert_verification": true, + "ws_url": "e2.validitytech.com:11004" }, { "url": "e3.validitytech.com:11002", "protocol": "SSL", - "disable_cert_verification": true + "disable_cert_verification": true, + "ws_url": "e3.validitytech.com:11004" } ], "explorer_url": [ From abb965b568774301495541a9845e03e7ddf658ec Mon Sep 17 00:00:00 2001 From: cipig Date: Thu, 2 Jun 2022 02:26:31 +0000 Subject: [PATCH 072/177] add ws_url for GRS electrums --- assets/config/0.5.5-coins.json | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/assets/config/0.5.5-coins.json b/assets/config/0.5.5-coins.json index bff45a8db7..5e2b8b820e 100644 --- a/assets/config/0.5.5-coins.json +++ b/assets/config/0.5.5-coins.json @@ -3179,16 +3179,20 @@ "nomics_id": "GRS", "electrum": [ { - "url": "electrum11.groestlcoin.org:50001" + "url": "electrum11.groestlcoin.org:50001", + "ws_url": "electrum11.groestlcoin.org:50004" }, { - "url": "electrum12.groestlcoin.org:50001" + "url": "electrum12.groestlcoin.org:50001", + "ws_url": "electrum12.groestlcoin.org:50004" }, { - "url": "electrum13.groestlcoin.org:50001" + "url": "electrum13.groestlcoin.org:50001", + "ws_url": "electrum13.groestlcoin.org:50004" }, { - "url": "electrum14.groestlcoin.org:50001" + "url": "electrum14.groestlcoin.org:50001", + "ws_url": "electrum14.groestlcoin.org:50004" } ], "explorer_url": [ From fd927a4961cee8c7fac86f0409d52a4c4842e1f2 Mon Sep 17 00:00:00 2001 From: cipig Date: Thu, 2 Jun 2022 02:38:39 +0000 Subject: [PATCH 073/177] more ws_urls --- assets/config/0.5.5-coins.json | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/assets/config/0.5.5-coins.json b/assets/config/0.5.5-coins.json index 5e2b8b820e..54d4302827 100644 --- a/assets/config/0.5.5-coins.json +++ b/assets/config/0.5.5-coins.json @@ -4680,12 +4680,14 @@ { "url": "uno-main.coinmunity.gold:50002", "protocol": "SSL", - "disable_cert_verification": true + "disable_cert_verification": true, + "ws_url": "uno-main.coinmunity.gold:50003" }, { "url": "uno-bkp.coinmunity.gold:50002", "protocol": "SSL", - "disable_cert_verification": true + "disable_cert_verification": true, + "ws_url": "uno-bkp.coinmunity.gold:50003" } ], "explorer_url": [ @@ -5351,13 +5353,16 @@ "coingecko_id": "test-coin", "electrum": [ { - "url": "electrum1.cipig.net:10016" + "url": "electrum1.cipig.net:10016", + "ws_url": "electrum1.cipig.net:30016" }, { - "url": "electrum2.cipig.net:10016" + "url": "electrum2.cipig.net:10016", + "ws_url": "electrum2.cipig.net:30016" }, { - "url": "electrum3.cipig.net:10016" + "url": "electrum3.cipig.net:10016", + "ws_url": "electrum3.cipig.net:30016" } ], "explorer_url": [ @@ -5622,12 +5627,14 @@ { "url": "electrum.peercoinexplorer.net:50002", "protocol": "SSL", - "disable_cert_verification": false + "disable_cert_verification": false, + "ws_url": "electrum.peercoinexplorer.net:50004" }, { "url": "allingas.peercoinexplorer.net:50002", "protocol": "SSL", - "disable_cert_verification": false + "disable_cert_verification": false, + "ws_url": "allingas.peercoinexplorer.net:50004" } ], "explorer_url": [ @@ -6227,12 +6234,14 @@ { "url": "il8p.electrumx.transcenders.name:50002", "protocol": "SSL", - "disable_cert_verification": true + "disable_cert_verification": true, + "ws_url": "il8p.electrumx.transcenders.name:50003" }, { "url": "il9p.electrumx.transcenders.name:50002", "protocol": "SSL", - "disable_cert_verification": true + "disable_cert_verification": true, + "ws_url": "il9p.electrumx.transcenders.name:50003" } ], "explorer_url": [ From 241b3f3fc6c75c5fcdf74a2b13d8c85b137f1b92 Mon Sep 17 00:00:00 2001 From: cipig Date: Thu, 2 Jun 2022 03:03:59 +0000 Subject: [PATCH 074/177] more ws_urls --- assets/config/0.5.5-coins.json | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/assets/config/0.5.5-coins.json b/assets/config/0.5.5-coins.json index 54d4302827..5fc4b31f55 100644 --- a/assets/config/0.5.5-coins.json +++ b/assets/config/0.5.5-coins.json @@ -4657,10 +4657,12 @@ { "url": "failover.trc-uis.ewmcx.biz:50002", "protocol": "SSL", - "disable_cert_verification": true + "disable_cert_verification": true, + "ws_url": "failover.trc-uis.ewmcx.biz:50003" }, { - "url": "electrumx.uis.ewmcx.info:50001" + "url": "electrumx.uis.ewmcx.info:50001", + "ws_url": "electrumx.uis.ewmcx.info:50004" } ], "explorer_url": [ @@ -6205,17 +6207,20 @@ { "url": "el0.verus.io:17486", "protocol": "SSL", - "disable_cert_verification": false + "disable_cert_verification": false, + "ws_url": "el0.verus.io:17488" }, { "url": "el1.verus.io:17486", "protocol": "SSL", - "disable_cert_verification": false + "disable_cert_verification": false, + "ws_url": "el1.verus.io:17488" }, { "url": "el2.verus.io:17486", "protocol": "SSL", - "disable_cert_verification": false + "disable_cert_verification": false, + "ws_url": "el2.verus.io:17488" } ], "explorer_url": [ @@ -7193,13 +7198,16 @@ { "url": "failover.trc-uis.ewmcx.biz:50006", "protocol": "SSL", - "disable_cert_verification": true + "disable_cert_verification": true, + "ws_url": "failover.trc-uis.ewmcx.biz:50007" }, { - "url": "electrum.terracoin.io:50001" + "url": "electrum.terracoin.io:50001", + "ws_url": "electrum.terracoin.io:50004" }, { - "url": "electrum.southofheaven.ca:50001" + "url": "electrum.southofheaven.ca:50001", + "ws_url": "electrum.southofheaven.ca:50004" } ], "explorer_url": [ @@ -7720,7 +7728,8 @@ "electrum": [ { "url": "lenoir.ecoincore.com:10891", - "protocol": "TCP" + "protocol": "TCP", + "ws_url": "lenoir.ecoincore.com:10894" } ], "explorer_url": [ From de2765d7dbd963ebe2f9379fa6e38d1bdb74f6bf Mon Sep 17 00:00:00 2001 From: cipig Date: Thu, 2 Jun 2022 03:16:06 +0000 Subject: [PATCH 075/177] add ws_url for CDN electrums --- assets/config/0.5.5-coins.json | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/assets/config/0.5.5-coins.json b/assets/config/0.5.5-coins.json index 5fc4b31f55..51f875b954 100644 --- a/assets/config/0.5.5-coins.json +++ b/assets/config/0.5.5-coins.json @@ -1666,27 +1666,32 @@ { "url": "mumbai.ecoincore.com:34333", "protocol": "SSL", - "disable_cert_verification": true + "disable_cert_verification": true, + "ws_url": "mumbai.ecoincore.com:34335" }, { "url": "holland.ecoincore.com:34333", "protocol": "SSL", - "disable_cert_verification": true + "disable_cert_verification": true, + "ws_url": "holland.ecoincore.com:34335" }, { "url": "miami.ecoincore.com:34333", "protocol": "SSL", - "disable_cert_verification": true + "disable_cert_verification": true, + "ws_url": "miami.ecoincore.com:34335" }, { "url": "woolloomooloo.ecoincore.com:34333", "protocol": "SSL", - "disable_cert_verification": true + "disable_cert_verification": true, + "ws_url": "woolloomooloo.ecoincore.com:34335" }, { "url": "lenoir.ecoincore.com:34333", "protocol": "SSL", - "disable_cert_verification": true + "disable_cert_verification": true, + "ws_url": "lenoir.ecoincore.com:34335" } ], "explorer_url": [ From 5ba879740f67a6879775ecfa8b7f69ac409b0e49 Mon Sep 17 00:00:00 2001 From: cipig Date: Thu, 2 Jun 2022 14:24:17 +0000 Subject: [PATCH 076/177] more ws_urls --- assets/config/0.5.5-coins.json | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/assets/config/0.5.5-coins.json b/assets/config/0.5.5-coins.json index 51f875b954..367012a90d 100644 --- a/assets/config/0.5.5-coins.json +++ b/assets/config/0.5.5-coins.json @@ -1179,12 +1179,14 @@ { "url": "bsty-main.coinmunity.gold:50012", "protocol": "SSL", - "disable_cert_verification": true + "disable_cert_verification": true, + "ws_url": "bsty-main.coinmunity.gold:50013" }, { "url": "bsty-bkp.coinmunity.gold:50012", "protocol": "SSL", - "disable_cert_verification": true + "disable_cert_verification": true, + "ws_url": "bsty-bkp.coinmunity.gold:50013" } ], "explorer_url": [ @@ -1286,7 +1288,8 @@ { "url": "btx-electrumx.coinsmunity.com:50002", "protocol": "SSL", - "disable_cert_verification": true + "disable_cert_verification": true, + "ws_url": "btx-electrumx.coinsmunity.com:50003" } ], "explorer_url": [ @@ -2121,12 +2124,14 @@ "electrum": [ { "url": "electrumx.dgc.ewmcx.org:50001", - "protocol": "TCP" + "protocol": "TCP", + "ws_url": "electrumx.dgc.ewmcx.org:50003" }, { "url": "failover.dgc.ewmcx.biz:50002", "protocol": "SSL", - "disable_cert_verification": true + "disable_cert_verification": true, + "ws_url": "failover.dgc.ewmcx.biz:50003" } ], "explorer_url": [ @@ -2489,27 +2494,32 @@ { "url": "holland.ecoincore.com:11017", "protocol": "SSL", - "disable_cert_verification": true + "disable_cert_verification": true, + "ws_url": "holland.ecoincore.com:11019" }, { "url": "lenoir.ecoincore.com:11017", "protocol": "SSL", - "disable_cert_verification": true + "disable_cert_verification": true, + "ws_url": "lenoir.ecoincore.com:11019" }, { "url": "electrum1.egulden.org:50002", "protocol": "SSL", - "disable_cert_verification": true + "disable_cert_verification": true, + "ws_url": "electrum1.egulden.org:50004" }, { "url": "electrum2.egulden.org:50002", "protocol": "SSL", - "disable_cert_verification": true + "disable_cert_verification": true, + "ws_url": "electrum2.egulden.org:50004" }, { "url": "electrum5.egulden.org:11017", "protocol": "SSL", - "disable_cert_verification": true + "disable_cert_verification": true, + "ws_url": "electrum5.egulden.org:11019" } ], "explorer_url": [ From 4068f4b69a3ae9b3533e06e27b2066ef1578314b Mon Sep 17 00:00:00 2001 From: cipig Date: Thu, 2 Jun 2022 17:44:06 +0000 Subject: [PATCH 077/177] ws_urls for BLK and tBLK --- assets/config/0.5.5-coins.json | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/assets/config/0.5.5-coins.json b/assets/config/0.5.5-coins.json index 367012a90d..2e6fd0c759 100644 --- a/assets/config/0.5.5-coins.json +++ b/assets/config/0.5.5-coins.json @@ -957,17 +957,20 @@ { "url": "electrum1.blackcoin.nl:10002", "protocol": "SSL", - "disable_cert_verification": false + "disable_cert_verification": false, + "ws_url": "electrum1.blackcoin.nl:10004” }, { "url": "electrum2.blackcoin.nl:20002", "protocol": "SSL", - "disable_cert_verification": false + "disable_cert_verification": false, + "ws_url": "electrum2.blackcoin.nl:20004” }, { "url": "electrum3.blackcoin.nl:30002", "protocol": "SSL", - "disable_cert_verification": false + "disable_cert_verification": false, + "ws_url": "electrum3.blackcoin.nl:30004” } ], "explorer_url": [ @@ -1007,17 +1010,20 @@ { "url": "electrum1.blackcoin.nl:10012", "protocol": "SSL", - "disable_cert_verification": true + "disable_cert_verification": true, + "ws_url": "electrum1.blackcoin.nl:10014” }, { "url": "electrum2.blackcoin.nl:20012", "protocol": "SSL", - "disable_cert_verification": true + "disable_cert_verification": true, + "ws_url": "electrum2.blackcoin.nl:20014” }, { "url": "electrum3.blackcoin.nl:30012", "protocol": "SSL", - "disable_cert_verification": true + "disable_cert_verification": true, + "ws_url": "electrum3.blackcoin.nl:30014” } ], "explorer_url": [ From a8e125dbdff8e839f199ca28e08fd793379b8e3f Mon Sep 17 00:00:00 2001 From: cipig Date: Thu, 2 Jun 2022 19:47:54 +0000 Subject: [PATCH 078/177] fix strange windblows chars --- assets/config/0.5.5-coins.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/assets/config/0.5.5-coins.json b/assets/config/0.5.5-coins.json index 2e6fd0c759..611d211bee 100644 --- a/assets/config/0.5.5-coins.json +++ b/assets/config/0.5.5-coins.json @@ -958,19 +958,19 @@ "url": "electrum1.blackcoin.nl:10002", "protocol": "SSL", "disable_cert_verification": false, - "ws_url": "electrum1.blackcoin.nl:10004” + "ws_url": "electrum1.blackcoin.nl:10004" }, { "url": "electrum2.blackcoin.nl:20002", "protocol": "SSL", "disable_cert_verification": false, - "ws_url": "electrum2.blackcoin.nl:20004” + "ws_url": "electrum2.blackcoin.nl:20004" }, { "url": "electrum3.blackcoin.nl:30002", "protocol": "SSL", "disable_cert_verification": false, - "ws_url": "electrum3.blackcoin.nl:30004” + "ws_url": "electrum3.blackcoin.nl:30004" } ], "explorer_url": [ @@ -1011,19 +1011,19 @@ "url": "electrum1.blackcoin.nl:10012", "protocol": "SSL", "disable_cert_verification": true, - "ws_url": "electrum1.blackcoin.nl:10014” + "ws_url": "electrum1.blackcoin.nl:10014" }, { "url": "electrum2.blackcoin.nl:20012", "protocol": "SSL", "disable_cert_verification": true, - "ws_url": "electrum2.blackcoin.nl:20014” + "ws_url": "electrum2.blackcoin.nl:20014" }, { "url": "electrum3.blackcoin.nl:30012", "protocol": "SSL", "disable_cert_verification": true, - "ws_url": "electrum3.blackcoin.nl:30014” + "ws_url": "electrum3.blackcoin.nl:30014" } ], "explorer_url": [ From 864e4e1c90a6becaccd72f812bea0015d598d474 Mon Sep 17 00:00:00 2001 From: cipig Date: Thu, 2 Jun 2022 20:57:22 +0000 Subject: [PATCH 079/177] add ws_urls for BTCZ electrums --- assets/config/0.5.5-coins.json | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/assets/config/0.5.5-coins.json b/assets/config/0.5.5-coins.json index 611d211bee..1fdcff4e58 100644 --- a/assets/config/0.5.5-coins.json +++ b/assets/config/0.5.5-coins.json @@ -1271,10 +1271,12 @@ "nomics_id": "BTCZ", "electrum": [ { - "url": "electrum1.btcz.rocks:50001" + "url": "electrum1.btcz.rocks:50001", + "ws_url": "electrum1.btcz.rocks:50004" }, { - "url": "electrum2.btcz.rocks:50001" + "url": "electrum2.btcz.rocks:50001", + "ws_url": "electrum2.btcz.rocks:50004" } ], "explorer_url": [ From ea9fd70413bed349ef3f0a5045fed3593ff3ba57 Mon Sep 17 00:00:00 2001 From: cipig Date: Thu, 2 Jun 2022 22:45:36 +0000 Subject: [PATCH 080/177] add ws_urls for AUR and ZET electrums --- assets/config/0.5.5-coins.json | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/assets/config/0.5.5-coins.json b/assets/config/0.5.5-coins.json index 1fdcff4e58..6f5bbef43c 100644 --- a/assets/config/0.5.5-coins.json +++ b/assets/config/0.5.5-coins.json @@ -539,12 +539,14 @@ { "url": "electrumx.aur.ewmcx.info:50002", "protocol": "SSL", - "disable_cert_verification": true + "disable_cert_verification": true, + "ws_url": "electrumx.aur.ewmcx.info:50003" }, { "url": "failover.aur.ewmcx.biz:50002", "protocol": "SSL", - "disable_cert_verification": true + "disable_cert_verification": true, + "ws_url": "failover.aur.ewmcx.biz:50003" } ], "explorer_url": [ @@ -8164,7 +8166,8 @@ "electrum": [ { "url": "207.180.252.200:50011", - "protocol": "TCP" + "protocol": "TCP", + "ws_url": "207.180.252.200:50013" }, { "url": "zeta-seed-c.zetacoin.tech:50012", From b41f4035a75efca722c69d01e8dfe300cb9d4a91 Mon Sep 17 00:00:00 2001 From: syl Date: Fri, 3 Jun 2022 13:03:22 +0200 Subject: [PATCH 081/177] More explicit label in addressbook --- atomic_defi_design/Dex/Addressbook/AddAddressForm.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/atomic_defi_design/Dex/Addressbook/AddAddressForm.qml b/atomic_defi_design/Dex/Addressbook/AddAddressForm.qml index 887130573a..4686325e45 100644 --- a/atomic_defi_design/Dex/Addressbook/AddAddressForm.qml +++ b/atomic_defi_design/Dex/Addressbook/AddAddressForm.qml @@ -81,7 +81,7 @@ Dex.Rectangle Dex.DefaultCheckBox { id: useStandardsCheckBox - text: qsTr("Use asset standard as address type") + text: qsTr("Use standard network address") } AddressTypeSelector From 152ac49cb1d9b44e15b028dfa584a36c37ff135d Mon Sep 17 00:00:00 2001 From: syl Date: Mon, 6 Jun 2022 11:40:15 +0200 Subject: [PATCH 082/177] Fix address check for addressbook entry when it's a standard network address --- atomic_defi_design/Dex/Addressbook/AddAddressForm.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/atomic_defi_design/Dex/Addressbook/AddAddressForm.qml b/atomic_defi_design/Dex/Addressbook/AddAddressForm.qml index 4686325e45..74b7b5680c 100644 --- a/atomic_defi_design/Dex/Addressbook/AddAddressForm.qml +++ b/atomic_defi_design/Dex/Addressbook/AddAddressForm.qml @@ -33,7 +33,7 @@ Dex.Rectangle case "SLP": return "BCH"; } - let coinInfo = API.app.portfolio_pg.global_cfg_mdl.get_coin_info(addressType); + let coinInfo = Dex.API.app.portfolio_pg.global_cfg_mdl.get_coin_info(addressType); if (coinInfo.has_parent_fees_ticker) return coinInfo.fees_ticker; return walletType From e4d47cf17944927684aeea8c89093b391b234bad Mon Sep 17 00:00:00 2001 From: syl Date: Mon, 6 Jun 2022 11:45:01 +0200 Subject: [PATCH 083/177] Addressbook: Fix assets icon not showing up for address network standard --- .../Dex/Addressbook/EditContactModal.qml | 2 +- atomic_defi_design/Dex/Addressbook/Main.qml | 2 +- atomic_defi_design/assets/images/coins/bep.png | Bin 0 -> 10114 bytes atomic_defi_design/assets/images/coins/erc.png | Bin 0 -> 11407 bytes atomic_defi_design/assets/images/coins/qrc.png | Bin 0 -> 17457 bytes .../assets/images/coins/smart chain.png | Bin 0 -> 12553 bytes 6 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 atomic_defi_design/assets/images/coins/bep.png create mode 100644 atomic_defi_design/assets/images/coins/erc.png create mode 100644 atomic_defi_design/assets/images/coins/qrc.png create mode 100644 atomic_defi_design/assets/images/coins/smart chain.png diff --git a/atomic_defi_design/Dex/Addressbook/EditContactModal.qml b/atomic_defi_design/Dex/Addressbook/EditContactModal.qml index 8d392a9f12..4c0adf69bf 100644 --- a/atomic_defi_design/Dex/Addressbook/EditContactModal.qml +++ b/atomic_defi_design/Dex/Addressbook/EditContactModal.qml @@ -83,7 +83,7 @@ Dex.MultipageModal anchors.verticalCenter: parent.verticalCenter width: 25 height: 25 - source: Dex.General.coinIcon(parent.parent.coinInfo.ticker) + source: Dex.General.coinIcon(address_type.toLowerCase()) } Dex.Text diff --git a/atomic_defi_design/Dex/Addressbook/Main.qml b/atomic_defi_design/Dex/Addressbook/Main.qml index f360d46fcd..461d2749e2 100644 --- a/atomic_defi_design/Dex/Addressbook/Main.qml +++ b/atomic_defi_design/Dex/Addressbook/Main.qml @@ -290,7 +290,7 @@ Item anchors.verticalCenter: parent.verticalCenter width: 25 height: 25 - source: Dex.General.coinIcon(parent.parent.coinInfo.ticker) + source: Dex.General.coinIcon(address_type.toLowerCase()) } Dex.Text diff --git a/atomic_defi_design/assets/images/coins/bep.png b/atomic_defi_design/assets/images/coins/bep.png new file mode 100644 index 0000000000000000000000000000000000000000..40ea0e6ab9dca0a18de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KwJaug&nmNZzb4%*fa++6`0!z8@CJBlc- zVR0iR)%*OLrx@zr?u&5nOZ4)0O_9F)zS$_VzMf4)M)a!L2%$bFr`g7!PajGxRl6FLY!Szi&vXr|`}Rs^rI=PruD#E`PbKi{>9iG9(-w#eiLy+1|Ll@rW#wl5eUnzt_?eq^ zu8i+inT~a_O4!1iZF41_urG-{n&J>_dZhR2b@s&XiYF5sGVXl({?0dl|C}7lYrLW# zbeLYW?$K|3vYh$E^toR;4s2pIE{>dWf7zRr&wEbF7{9k#m+`7{%43~lNBNE#l`k^% zTKTi{fO^X}+4t@Ib-!u~ez&tPT(>l#Q9u5duk^l>1FsoBhN|o}jl-&(GB zF`Kn7-j-$AJeO}vgWs!p^=ldOO@73eUQ%Y#*4d3aUnzQssQn}D%-R=nEIal7CSoCa-j}wCwf2*gFkkcZ4g%1-2k~T8*vPS=KIDXJ0 z{P9GW%m1di`0wV)F|&!|ulbu=!m@nMzMuoryuYriN-8$VNk%lhe*ebxQp~SiUm6T| zvD`hneCKlOa#6O@+NUpp2Q9eeUS2)nSM{#$7oYe+CdhVz6ECwS1e+-}mc% ze_1Iz>?)I5Iq7A?UHK1RYnQW?+X_i2y4Gvmxi0kLCEGW9Rl(-}y%Ut~{{Q>cT2_eX z%l<&g|AH^=1sU01Ia_5J-msHC``};N*LslyUtj)bXOYO--`2$7T>1U}7YLM}_D^2f z#(eQ1uEr|hnHs7kt`Q|Ei6yC4$wjF^iowXh$WYh7MAyhN#K6MJ$i<K-<8;%D|u` hH1sKohTQy=%(P0}8dy2rMglc3c)I$ztaD0e0su`%%xnMv literal 0 HcmV?d00001 diff --git a/atomic_defi_design/assets/images/coins/smart chain.png b/atomic_defi_design/assets/images/coins/smart chain.png new file mode 100644 index 0000000000000000000000000000000000000000..11278a0f1110f28f07fe74e1664569b0a5e02aba GIT binary patch literal 12553 zcmZ`=WmH^GtiL$LwJc6?N(+m-d(q1&v0b4ZMYjya)hP$D%$P zAwaJwOr(|N0pJ@gv|lg)J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R8(@07psHRR8^~>4sJwvamfgDn}$)L3bz0ZeLJ%#)2G zqKJT!($ZO|1%bJukxLE#+wv}q<@6o@pX9MIXyq{sJ+z*uM{}&ayc|DGxed64cD@33 z;8ILiub>1HCV@-Fj~_2#cK*)I-BUD|z<5U2G=J5oIfWbV_4CIExo&edzfMg}8CGMX zNk+=TY_iNi0TbG&yomLlZ%dfVo-+K#58X96ExY3P0hdCf+d26;<~`Cg+$%xP8_(S$R~!+`O#pyzF2`Fqjt%c2!f` g{XYZj989guz5f3J2*@W|&;fvqgo1d5sA1s$0NB%tIsgCw literal 0 HcmV?d00001 From b182341613e6c98c0bb7fb6643c14d9263605482 Mon Sep 17 00:00:00 2001 From: syl Date: Mon, 6 Jun 2022 11:50:29 +0200 Subject: [PATCH 084/177] Addressbook: Fix overflow in add address form --- .../Dex/Addressbook/AddAddressForm.qml | 25 ++++++++++++------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/atomic_defi_design/Dex/Addressbook/AddAddressForm.qml b/atomic_defi_design/Dex/Addressbook/AddAddressForm.qml index 74b7b5680c..c74802960f 100644 --- a/atomic_defi_design/Dex/Addressbook/AddAddressForm.qml +++ b/atomic_defi_design/Dex/Addressbook/AddAddressForm.qml @@ -78,18 +78,25 @@ Dex.Rectangle anchors.margins: 21 spacing: 17 - Dex.DefaultCheckBox - { - id: useStandardsCheckBox - text: qsTr("Use standard network address") - } - - AddressTypeSelector + RowLayout { - id: addressTypeComboBox Layout.preferredWidth: 458 Layout.preferredHeight: 44 - showAssetStandards: useStandardsCheckBox.checked + + AddressTypeSelector + { + id: addressTypeComboBox + Layout.fillWidth: true + Layout.fillHeight: true + showAssetStandards: useStandardsCheckBox.checked + } + + Dex.DefaultCheckBox + { + id: useStandardsCheckBox + Layout.preferredWidth: 150 + text: qsTr("Use standard network address") + } } Dex.TextField From c57d40acaebbb385218b319b7bfe93b331248824 Mon Sep 17 00:00:00 2001 From: syl Date: Mon, 6 Jun 2022 11:57:13 +0200 Subject: [PATCH 085/177] Addressbook: Address checking was not working for some assets --- atomic_defi_design/Dex/Addressbook/AddAddressForm.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/atomic_defi_design/Dex/Addressbook/AddAddressForm.qml b/atomic_defi_design/Dex/Addressbook/AddAddressForm.qml index c74802960f..c89ef491f6 100644 --- a/atomic_defi_design/Dex/Addressbook/AddAddressForm.qml +++ b/atomic_defi_design/Dex/Addressbook/AddAddressForm.qml @@ -36,7 +36,7 @@ Dex.Rectangle let coinInfo = Dex.API.app.portfolio_pg.global_cfg_mdl.get_coin_info(addressType); if (coinInfo.has_parent_fees_ticker) return coinInfo.fees_ticker; - return walletType + return addressType } signal cancel() From 9556f75624de2b70edd6d407072e73128cc879e3 Mon Sep 17 00:00:00 2001 From: syl Date: Mon, 6 Jun 2022 11:57:35 +0200 Subject: [PATCH 086/177] Addressbook: Reduce spacing between address entries in contact modal --- atomic_defi_design/Dex/Addressbook/EditContactModal.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/atomic_defi_design/Dex/Addressbook/EditContactModal.qml b/atomic_defi_design/Dex/Addressbook/EditContactModal.qml index 4c0adf69bf..121ffe12f7 100644 --- a/atomic_defi_design/Dex/Addressbook/EditContactModal.qml +++ b/atomic_defi_design/Dex/Addressbook/EditContactModal.qml @@ -46,7 +46,7 @@ Dex.MultipageModal { visible: !addressList.contactAddAddressMode model: contactModel.proxyFilter - spacing: 20 + spacing: 10 height: contentHeight > 190 ? 190 : contentHeight width: parent.width From b83e62ef046681b4ad7422bebc82ddeeb3ac857f Mon Sep 17 00:00:00 2001 From: syl Date: Mon, 6 Jun 2022 11:57:59 +0200 Subject: [PATCH 087/177] Addressbook: Fix sending from contact modal with addr standard network --- atomic_defi_design/Dex/Addressbook/EditContactModal.qml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/atomic_defi_design/Dex/Addressbook/EditContactModal.qml b/atomic_defi_design/Dex/Addressbook/EditContactModal.qml index 121ffe12f7..1800e7d7fa 100644 --- a/atomic_defi_design/Dex/Addressbook/EditContactModal.qml +++ b/atomic_defi_design/Dex/Addressbook/EditContactModal.qml @@ -180,9 +180,7 @@ Dex.MultipageModal iconSource: Qaterial.Icons.sendOutline onClicked: { - Dex.API.app.wallet_pg.ticker = address_type - sendModalLoader.address = address_value - sendModalLoader.open() + trySend(address_value, address_type) } } } From 1e89bda8ecbd16e489f20b5ffd09c9a5ed2ede4d Mon Sep 17 00:00:00 2001 From: syl Date: Mon, 6 Jun 2022 11:58:17 +0200 Subject: [PATCH 088/177] Addressbook: Center invalid address message --- atomic_defi_design/Dex/Addressbook/AddAddressForm.qml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/atomic_defi_design/Dex/Addressbook/AddAddressForm.qml b/atomic_defi_design/Dex/Addressbook/AddAddressForm.qml index c89ef491f6..45b49e204d 100644 --- a/atomic_defi_design/Dex/Addressbook/AddAddressForm.qml +++ b/atomic_defi_design/Dex/Addressbook/AddAddressForm.qml @@ -124,8 +124,10 @@ Dex.Rectangle Dex.Text { id: invalidAddressValueLabel + Layout.fillWidth: true color: Dex.CurrentTheme.noColor wrapMode: Dex.Text.Wrap + horizontalAlignment: Text.AlignHCenter } RowLayout From d8d1eec7713bfed8e7afcdb7b9f4f778feefac01 Mon Sep 17 00:00:00 2001 From: syl Date: Mon, 6 Jun 2022 12:04:33 +0200 Subject: [PATCH 089/177] Addressbook: Fix address checking when address type is a network standard --- atomic_defi_design/Dex/Addressbook/AddressTypeSelector.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/atomic_defi_design/Dex/Addressbook/AddressTypeSelector.qml b/atomic_defi_design/Dex/Addressbook/AddressTypeSelector.qml index 9c873e972d..28cbea459b 100644 --- a/atomic_defi_design/Dex/Addressbook/AddressTypeSelector.qml +++ b/atomic_defi_design/Dex/Addressbook/AddressTypeSelector.qml @@ -19,7 +19,7 @@ Dex.ComboBoxWithSearchBar popupForceMaxHeight: true popupMaxHeight: 265 model: showAssetStandards ? assetStandards : Dex.API.app.portfolio_pg.portfolio_mdl.portfolio_proxy_mdl - textRole: "ticker" + textRole: showAssetStandards ? "" : "ticker" delegate: ItemDelegate { From 958bd35e64c9513d910414aa9974e6b4112d3bb0 Mon Sep 17 00:00:00 2001 From: smk762 Date: Thu, 28 Apr 2022 17:38:30 +0800 Subject: [PATCH 090/177] Revert "components default -> dex" This reverts commit e222b122f911692b174384bb5ca6c84cf887b370. --- atomic_defi_design/Dex/Wallet/SendModal.qml | 38 ++++++++++----------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/atomic_defi_design/Dex/Wallet/SendModal.qml b/atomic_defi_design/Dex/Wallet/SendModal.qml index 3bbe22f1d6..62a1a61d63 100644 --- a/atomic_defi_design/Dex/Wallet/SendModal.qml +++ b/atomic_defi_design/Dex/Wallet/SendModal.qml @@ -272,7 +272,7 @@ MultipageModal property bool cryptoSendMode: true - DexRectangle + DefaultRectangle { enabled: !root.segwit && !root.is_send_busy @@ -284,7 +284,7 @@ MultipageModal color: input_address.background.color radius: input_address.background.radius - DexTextField + DefaultTextField { id: input_address @@ -307,7 +307,7 @@ MultipageModal color: addrbookIconMouseArea.containsMouse ? Dex.CurrentTheme.buttonColorHovered : "transparent" - DexMouseArea + DefaultMouseArea { id: addrbookIconMouseArea anchors.fill: parent @@ -316,7 +316,7 @@ MultipageModal } } - DexImage + DefaultImage { id: addrbookIcon anchors.right: parent.right @@ -342,7 +342,7 @@ MultipageModal Layout.alignment: Qt.AlignHCenter Layout.fillWidth: true - DexLabel + DefaultText { id: reason @@ -354,7 +354,7 @@ MultipageModal text_value: qsTr("The address has to be mixed case.") } - DexButton + DefaultButton { enabled: !root.is_send_busy visible: needFix @@ -393,7 +393,7 @@ MultipageModal } } - DexLabel + DefaultText { anchors.right: maxBut.left anchors.rightMargin: 10 @@ -403,7 +403,7 @@ MultipageModal font.pixelSize: 16 } - DexRectangle + Rectangle { id: maxBut anchors.right: parent.right @@ -414,13 +414,13 @@ MultipageModal radius: 7 color: maxButMouseArea.containsMouse ? Dex.CurrentTheme.buttonColorHovered : Dex.CurrentTheme.buttonColorEnabled - DexLabel + DefaultText { anchors.centerIn: parent text: qsTr("MAX") } - DexMouseArea + DefaultMouseArea { id: maxButMouseArea anchors.fill: parent @@ -448,7 +448,7 @@ MultipageModal Layout.alignment: Qt.AlignHCenter Layout.preferredWidth: 380 - DexLabel + DefaultText { id: equivalentAmount @@ -520,7 +520,7 @@ MultipageModal anchors.verticalCenter: parent.verticalCenter color: Dex.CurrentTheme.backgroundColor - DexLabel + DefaultText { id: fiat_symbol visible: _preparePage.cryptoSendMode && API.app.settings_pg.current_currency_sign != "KMD" @@ -529,7 +529,7 @@ MultipageModal text: API.app.settings_pg.current_currency_sign } - DexImage + DefaultImage { visible: !fiat_symbol.visible anchors.centerIn: parent @@ -539,7 +539,7 @@ MultipageModal } } - DexLabel + DefaultText { id: cryptoFiatSwitchText anchors.left: cryptoFiatSwitchIcon.right @@ -553,7 +553,7 @@ MultipageModal } } - DexMouseArea + DefaultMouseArea { id: cryptoFiatSwitchMouseArea anchors.fill: parent @@ -580,7 +580,7 @@ MultipageModal } // Custom fees warning - DexLabel + DefaultText { visible: custom_fees_switch.checked font.pixelSize: 14 @@ -646,7 +646,7 @@ MultipageModal } // Fee is higher than amount error - DexLabel + DefaultText { id: fee_error visible: feeIsHigherThanAmount() @@ -660,7 +660,7 @@ MultipageModal } // Not enough funds error - DexLabel + DefaultText { Layout.topMargin: 16 wrapMode: Text.Wrap @@ -679,7 +679,7 @@ MultipageModal Layout.alignment: Qt.AlignHCenter Layout.topMargin: 20 - DexButton + DefaultButton { text: qsTr("Close") From 6e1766fe97a7ba890da7347d4cf76a4c9ff47ab3 Mon Sep 17 00:00:00 2001 From: syl Date: Mon, 6 Jun 2022 15:08:10 +0200 Subject: [PATCH 091/177] Force open update modal if the update is recommended or mandatory Also disallow using app if app is mandatory --- atomic_defi_design/Dex/NewUpdateModal.qml | 32 ++++++++++++++++--- .../update/update.checker.service.cpp | 1 + 2 files changed, 29 insertions(+), 4 deletions(-) diff --git a/atomic_defi_design/Dex/NewUpdateModal.qml b/atomic_defi_design/Dex/NewUpdateModal.qml index a60bb098bf..c287f6afed 100644 --- a/atomic_defi_design/Dex/NewUpdateModal.qml +++ b/atomic_defi_design/Dex/NewUpdateModal.qml @@ -1,5 +1,7 @@ import QtQuick 2.12 import QtQuick.Layouts 1.12 +import QtQml 2.15 //> Qt.exit +import QtQuick.Controls 2.15 //> Popup.NoAutoClose import "Components" as Dex import "Constants" as Dex @@ -19,6 +21,17 @@ Dex.MultipageModal return 3 } + Component.onCompleted: + { + if (Dex.API.app.updateCheckerService.updateInfo.status === "recommended" || + Dex.API.app.updateCheckerService.updateInfo.status === "required" ) + { + root.open() + } + } + + closePolicy: Popup.NoAutoClose + Dex.MultipageModalContent { titleText: qsTr("Searching new updates") @@ -72,7 +85,7 @@ Dex.MultipageModal Dex.MultipageModalContent { - titleText: qsTr("New version found") + titleText: Dex.API.app.updateCheckerService.updateInfo.status === "required" ? qsTr("Mandatory version found") : qsTr("New version found") titleAlignment: Qt.AlignHCenter spacing: 16 @@ -82,6 +95,13 @@ Dex.MultipageModal text: qsTr("%1 %2 is available !").arg(Dex.API.app_name).arg(Dex.API.app.updateCheckerService.updateInfo.newVersion) } + Dex.DefaultText + { + visible: Dex.API.app.updateCheckerService.updateInfo.status === "required" + Layout.alignment: Qt.AlignHCenter + text: qsTr("This update is mandatory to continue using the application") + } + footer: [ Item { Layout.fillWidth: true }, @@ -92,8 +112,8 @@ Dex.MultipageModal }, Dex.DefaultButton { - text: qsTr("Close") - onClicked: close() + text: Dex.API.app.updateCheckerService.updateInfo.status === "required" ? qsTr("Close Dex") : qsTr("Close") + onClicked: Dex.API.app.updateCheckerService.updateInfo.status === "required" ? Qt.exit(0) : close() } ] } @@ -128,7 +148,11 @@ Dex.MultipageModal { if (Dex.API.app.updateCheckerService.updateInfo) { - root.open() + if (Dex.API.app.updateCheckerService.updateInfo.status === "recommended" || + Dex.API.app.updateCheckerService.updateInfo.status === "required" ) + { + root.open() + } } } } diff --git a/src/core/atomicdex/services/update/update.checker.service.cpp b/src/core/atomicdex/services/update/update.checker.service.cpp index 8c562fb6da..db89277ca7 100644 --- a/src/core/atomicdex/services/update/update.checker.service.cpp +++ b/src/core/atomicdex/services/update/update.checker.service.cpp @@ -67,6 +67,7 @@ namespace result["newVersion"] = resp["new_version"]; result["downloadUrl"] = resp["download_url"]; result["changelog"] = resp["changelog"]; + result["status"] = resp["status"]; } return result; } From 8b15793428a58cca8fcddbdce33cdc4075283114 Mon Sep 17 00:00:00 2001 From: smk762 Date: Mon, 6 Jun 2022 21:42:56 +0800 Subject: [PATCH 092/177] review fixes --- .../Dex/Components/DexModal.qml | 6 +- .../Dex/Components/TextAreaWithTitle.qml | 2 +- .../Dex/Dashboard/NotificationsModal.qml | 4 +- .../ProView/TradingInfo/OrdersPage.qml | 4 +- .../ProView/TradingInfo/PriceLine.qml | 14 +-- .../ProView/TradingInfo/SwapProgress.qml | 89 ++++++++++--------- .../Dex/Exchange/Trade/ConfirmTradeModal.qml | 2 +- .../Exchange/Trade/PriceLineSimplified.qml | 14 +-- .../Dex/Portfolio/Portfolio.qml | 2 +- atomic_defi_design/Dex/Wallet/AddressList.qml | 3 +- .../Dex/Wallet/TransactionDetailsModal.qml | 4 +- src/core/atomicdex/api/mm2/mm2.cpp | 4 +- .../atomicdex/data/dex/qt.orders.data.hpp | 2 +- src/core/atomicdex/models/qt.orders.model.cpp | 12 +-- 14 files changed, 83 insertions(+), 79 deletions(-) diff --git a/atomic_defi_design/Dex/Components/DexModal.qml b/atomic_defi_design/Dex/Components/DexModal.qml index 915dc94717..7b476bca3a 100644 --- a/atomic_defi_design/Dex/Components/DexModal.qml +++ b/atomic_defi_design/Dex/Components/DexModal.qml @@ -2,6 +2,8 @@ import QtQuick 2.15 import QtQuick.Controls 2.15 import QtQuick.Layouts 1.15 +import Dex.Themes 1.0 as Dex + Popup { id: control parent: Overlay.overlay @@ -14,7 +16,7 @@ Popup { modal: true padding: 0 Overlay.modeless: DefaultRectangle { - color: DexTheme.dexBoxBackgroundColor + color: Dex.CurrentTheme.dexBoxBackgroundColor opacity: .3 } @@ -25,7 +27,7 @@ Popup { anchors.fill: parent border.width: 2 radius: parent.radius - color: DexTheme.dexBoxBackgroundColor + color: Dex.CurrentTheme.dexBoxBackgroundColor Container { id: _header width: parent.width diff --git a/atomic_defi_design/Dex/Components/TextAreaWithTitle.qml b/atomic_defi_design/Dex/Components/TextAreaWithTitle.qml index 9076dd04ce..38d85520e8 100644 --- a/atomic_defi_design/Dex/Components/TextAreaWithTitle.qml +++ b/atomic_defi_design/Dex/Components/TextAreaWithTitle.qml @@ -76,7 +76,7 @@ ColumnLayout color: Dex.CurrentTheme.accentColor opacity: .7 radius: 8 - border.color: input_field.focus ? Dex.CurrentTheme.accentColor : DexTheme.rectangleBorderColor + border.color: input_field.focus ? Dex.CurrentTheme.accentColor : Dex.CurrentTheme.backgroundColor border.width: input_field.focus ? 2 : 0 } HideFieldButton { diff --git a/atomic_defi_design/Dex/Dashboard/NotificationsModal.qml b/atomic_defi_design/Dex/Dashboard/NotificationsModal.qml index 102cdc1ec3..be9837f64c 100644 --- a/atomic_defi_design/Dex/Dashboard/NotificationsModal.qml +++ b/atomic_defi_design/Dex/Dashboard/NotificationsModal.qml @@ -61,7 +61,7 @@ DexPopup }, { icon: Qaterial.Icons.messageOutline, - color: DexTheme.foregroundColor, + color: Dex.CurrentTheme.foregroundColor, gradient: default_gradient }] backgroundColor: Dex.CurrentTheme.floatingBackgroundColor @@ -582,7 +582,7 @@ DexPopup anchors.right: parent.right anchors.rightMargin: 5 anchors.bottomMargin: -4 - foregroundColor: DexTheme.foregroundColor + foregroundColor: Dex.CurrentTheme.foregroundColor visible: modelData.event_name !== "check" icon.source: diff --git a/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/OrdersPage.qml b/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/OrdersPage.qml index a88ef9cd1f..afb30d856d 100644 --- a/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/OrdersPage.qml +++ b/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/OrdersPage.qml @@ -220,7 +220,7 @@ Item { font.pixelSize: 13 opacity: .8 color: Dex.CurrentTheme.foregroundColor - backgroundColor: DexTheme.portfolioPieGradient ? '#FFFFFF' : 'transparent' + backgroundColor: Dex.CurrentTheme.portfolioPieGradient ? '#FFFFFF' : 'transparent' onAccepted: applyDateFilter() Layout.fillWidth: true } @@ -236,7 +236,7 @@ Item { font.pixelSize: 13 opacity: .8 color: Dex.CurrentTheme.foregroundColor - backgroundColor: DexTheme.portfolioPieGradient ? '#FFFFFF' : 'transparent' + backgroundColor: Dex.CurrentTheme.portfolioPieGradient ? '#FFFFFF' : 'transparent' onAccepted: applyDateFilter() Layout.fillWidth: true } diff --git a/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/PriceLine.qml b/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/PriceLine.qml index 332d1eed91..9ebe7892b8 100644 --- a/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/PriceLine.qml +++ b/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/PriceLine.qml @@ -12,13 +12,13 @@ ColumnLayout readonly property string price_reversed: API.app.trading_pg.price_reversed readonly property string cex_price: API.app.trading_pg.cex_price readonly property string cex_price_reversed: API.app.trading_pg.cex_price_reversed - readonly property string cex_price_diff: API.app.trading_pg.cex_price_diff + readonly property string cexPriceDiff: API.app.trading_pg.cex_price_diff readonly property bool invalid_cex_price: API.app.trading_pg.invalid_cex_price readonly property bool price_entered: !General.isZero(non_null_price) readonly property int fontSize: Style.textSizeSmall1 readonly property int fontSizeBigger: Style.textSizeSmall2 - readonly property int line_scale: General.getComparisonScale(cex_price_diff) + readonly property int lineScale: General.getComparisonScale(cexPriceDiff) spacing: 20 @@ -72,8 +72,8 @@ ColumnLayout Layout.topMargin: 10 Layout.bottomMargin: Layout.topMargin Layout.alignment: Qt.AlignHCenter - color: parseFloat(cex_price_diff) <= 0 ? Dex.CurrentTheme.okColor : Dex.CurrentTheme.noColor - text_value: (parseFloat(cex_price_diff) > 0 ? qsTr("Expensive") : qsTr("Expedient")) + ":    " + qsTr("%1 compared to CEX", "PRICE_DIFF%").arg("" + General.formatPercent(General.limitDigits(cex_price_diff)) + "") + color: parseFloat(cexPriceDiff) <= 0 ? Dex.CurrentTheme.okColor : Dex.CurrentTheme.noColor + text_value: (parseFloat(cexPriceDiff) > 0 ? qsTr("Expensive") : qsTr("Expedient")) + ":    " + qsTr("%1 compared to CEX", "PRICE_DIFF%").arg("" + General.formatPercent(General.limitDigits(cexPriceDiff)) + "") font.pixelSize: fontSize } @@ -82,7 +82,7 @@ ColumnLayout Layout.alignment: Qt.AlignHCenter DefaultText { - text_value: General.formatPercent(line_scale) + text_value: General.formatPercent(lineScale) font.pixelSize: fontSize } @@ -99,13 +99,13 @@ ColumnLayout height: parent.height * 2 anchors.verticalCenter: parent.verticalCenter anchors.horizontalCenter: parent.horizontalCenter - anchors.horizontalCenterOffset: 0.5 * parent.width * Math.min(Math.max(parseFloat(cex_price_diff) / line_scale, -1), 1) + anchors.horizontalCenterOffset: 0.5 * parent.width * Math.min(Math.max(parseFloat(cexPriceDiff) / lineScale, -1), 1) } } DefaultText { - text_value: General.formatPercent(-line_scale) + text_value: General.formatPercent(-lineScale) font.pixelSize: fontSize } } diff --git a/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/SwapProgress.qml b/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/SwapProgress.qml index c87534bd6a..3aa6875e32 100644 --- a/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/SwapProgress.qml +++ b/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/SwapProgress.qml @@ -2,6 +2,7 @@ import QtQuick 2.15 import QtQuick.Layouts 1.15 import QtQuick.Controls 2.15 +import Dex.Themes 1.0 as Dex import App 1.0 import "../../../Components" @@ -12,7 +13,7 @@ ColumnLayout id: root property var details - property var last_event + property var lastEvent readonly property var all_events: !details ? [] : has_error_event ? details.events.map(e => e.state) : details.success_events @@ -32,7 +33,7 @@ ColumnLayout } // Total swaptime from sum of events duration - readonly property double total_time_passed: + readonly property double totalTimePassed: { if (!details) return 0 @@ -47,7 +48,7 @@ ColumnLayout // Total swap duration estimate - readonly property double total_time_passed_estimated: + readonly property double totalTimePassedEstimated: { const events = all_events @@ -76,35 +77,35 @@ ColumnLayout } // Simulated time of the running event - property double simulated_time: 0 + property double simulatedTime: 0 function updateSimulatedTime() { if (!details) { - simulated_time = 0 + simulatedTime = 0 return } const events = details.events if (!events || events.length === 0) { - simulated_time = 0 + simulatedTime = 0 return } - last_event = events[events.length - 1] - if (!last_event.timestamp) + lastEvent = events[events.length - 1] + if (!lastEvent.timestamp) { - simulated_time = 0 + simulatedTime = 0 return } if (current_event_idx !== -1) { - const diff = Date.now() - last_event.timestamp - simulated_time = diff - (diff % 1000) + const diff = Date.now() - lastEvent.timestamp + simulatedTime = diff - (diff % 1000) - } else simulated_time = 0 + } else simulatedTime = 0 } Timer @@ -116,13 +117,13 @@ ColumnLayout } // Simulated countdown time until refund unlocked - property double payment_lock_countdown_time: -1 // First we wait for locktime expiry - property double wait_until_countdown_time: -1 // Then we count down to 'wait_until' time + property double paymentLockCountdownTime: -1 // First we wait for locktime expiry + property double waitUntilCountdownTime: -1 // Then we count down to 'wait_until' time function updateCountdownTime() { if (current_event_idx == -1 || !details) { - payment_lock_countdown_time = -1 + paymentLockCountdownTime = -1 return } @@ -133,34 +134,34 @@ ColumnLayout if (events[current_event_idx - 1]['data'].hasOwnProperty('wait_until')) { const diff = events[current_event_idx - 1]['data']['wait_until'] * 1000 - Date.now() - wait_until_countdown_time = diff - (diff % 1000) + waitUntilCountdownTime = diff - (diff % 1000) - if (wait_until_countdown_time <= 0) + if (waitUntilCountdownTime <= 0) { - wait_until_countdown_time = 0 + waitUntilCountdownTime = 0 } } } else { - wait_until_countdown_time = -1 + waitUntilCountdownTime = -1 } - if (details.hasOwnProperty('payment_lock')) + if (details.hasOwnProperty('paymentLock')) { - const lock_diff = details.payment_lock - Date.now() - payment_lock_countdown_time = lock_diff - (lock_diff % 1000) + const lock_diff = details.paymentLock - Date.now() + paymentLockCountdownTime = lock_diff - (lock_diff % 1000) - if (payment_lock_countdown_time <= 0) + if (paymentLockCountdownTime <= 0) { - payment_lock_countdown_time = 0 + paymentLockCountdownTime = 0 } } else { - payment_lock_countdown_time = -1 + paymentLockCountdownTime = -1 } } @@ -174,21 +175,21 @@ ColumnLayout function getTimeText(duration, estimated) { - return `` + qsTr("act", "SHORT FOR ACTUAL TIME") + ": " + `` + - `` + General.durationTextShort(duration) + `` + - ` | ` + qsTr("est", "SHORT FOR ESTIMATED") + ": " + + return `` + qsTr("act", "SHORT FOR ACTUAL TIME") + ": " + `` + + `` + General.durationTextShort(duration) + `` + + ` | ` + qsTr("est", "SHORT FOR ESTIMATED") + ": " + General.durationTextShort(estimated) + `` } function getRefundText() { - if ((payment_lock_countdown_time > 0) && (wait_until_countdown_time == -1)) + if ((paymentLockCountdownTime > 0) && (waitUntilCountdownTime == -1)) { - return `` + qsTr(General.durationTextShort(payment_lock_countdown_time) + " until refund lock is released.") + `` + return `` + qsTr(General.durationTextShort(paymentLockCountdownTime) + " until refund lock is released.") + `` } - else if (wait_until_countdown_time > 0) { - if (last_event.state !== "Finished") { - return `` + qsTr(General.durationTextShort(wait_until_countdown_time) + " until refund completed.") + `` + else if (waitUntilCountdownTime > 0) { + if (lastEvent.state !== "Finished") { + return `` + qsTr(General.durationTextShort(waitUntilCountdownTime) + " until refund completed.") + `` } } return "" @@ -198,9 +199,9 @@ ColumnLayout DefaultText { Layout.fillWidth: true - text_value: `` + qsTr("Progress details") + `` + - ` | ` + - getTimeText(total_time_passed + simulated_time, total_time_passed_estimated) + text_value: `` + qsTr("Progress details") + `` + + ` | ` + + getTimeText(totalTimePassed + simulatedTime, totalTimePassedEstimated) font.pixelSize: Style.textSize1 Layout.bottomMargin: 10 } @@ -226,7 +227,7 @@ ColumnLayout readonly property bool is_active: General.exists(event) || is_current_event - readonly property double time_passed: event ? event.time_diff : is_current_event ? simulated_time : 0 + readonly property double time_passed: event ? event.time_diff : is_current_event ? simulatedTime : 0 width: root.width height: 50 @@ -244,10 +245,10 @@ ColumnLayout if (event) { // Red for the Finished if swap failed - if (event.state === "Finished" && details.order_status === "failed") return DexTheme.redColor + if (event.state === "Finished" && details.order_status === "failed") return Dex.CurrentTheme.redColor // Red for error event, green for the others - return details.error_events.indexOf(event.state) === -1 ? DexTheme.greenColor : DexTheme.redColor + return details.error_events.indexOf(event.state) === -1 ? Dex.CurrentTheme.greenColor : Dex.CurrentTheme.redColor } // In progress one is orange @@ -255,7 +256,7 @@ ColumnLayout return Style.colorOrange // Passive color for the rest - return DexTheme.foregroundColorLightColor2 + return Dex.CurrentTheme.foregroundColorLightColor2 } } @@ -275,7 +276,7 @@ ColumnLayout font.pixelSize: Style.textSizeSmall4 text_value: getEventText(modelData) - color: event ? DexTheme.foregroundColor : is_current_event ? DexTheme.foregroundColorLightColor0 : DexTheme.foregroundColorLightColor2 + color: event ? Dex.CurrentTheme.foregroundColor : is_current_event ? Dex.CurrentTheme.foregroundColorLightColor0 : Dex.CurrentTheme.foregroundColorLightColor2 } AnimatedRectangle @@ -285,13 +286,13 @@ ColumnLayout width: parent.width height: 2 - color: DexTheme.foregroundColorDarkColor3 + color: Dex.CurrentTheme.foregroundColorDarkColor3 AnimatedRectangle { - width: parent.width * (total_time_passed > 0 ? (time_passed / (total_time_passed + simulated_time)) : 0) + width: parent.width * (totalTimePassed > 0 ? (time_passed / (totalTimePassed + simulatedTime)) : 0) height: parent.height - color: DexTheme.greenColor + color: Dex.CurrentTheme.greenColor } } diff --git a/atomic_defi_design/Dex/Exchange/Trade/ConfirmTradeModal.qml b/atomic_defi_design/Dex/Exchange/Trade/ConfirmTradeModal.qml index c8ec5cde23..0867331285 100644 --- a/atomic_defi_design/Dex/Exchange/Trade/ConfirmTradeModal.qml +++ b/atomic_defi_design/Dex/Exchange/Trade/ConfirmTradeModal.qml @@ -232,7 +232,7 @@ MultipageModal Layout.preferredHeight: 10 Layout.alignment: Qt.AlignHCenter text_value: qsTr("Required Confirmations") + ": " + required_confirmation_count.value - color: DexTheme.foregroundColor + color: Dex.CurrentTheme.foregroundColor opacity: parent.enabled ? 1 : .6 } diff --git a/atomic_defi_design/Dex/Exchange/Trade/PriceLineSimplified.qml b/atomic_defi_design/Dex/Exchange/Trade/PriceLineSimplified.qml index c6f75e0351..978ffe7533 100644 --- a/atomic_defi_design/Dex/Exchange/Trade/PriceLineSimplified.qml +++ b/atomic_defi_design/Dex/Exchange/Trade/PriceLineSimplified.qml @@ -14,13 +14,13 @@ ColumnLayout readonly property string price_reversed: API.app.trading_pg.price_reversed readonly property string cex_price: API.app.trading_pg.cex_price readonly property string cex_price_reversed: API.app.trading_pg.cex_price_reversed - readonly property string cex_price_diff: API.app.trading_pg.cex_price_diff + readonly property string cexPriceDiff: API.app.trading_pg.cex_price_diff readonly property bool invalid_cex_price: API.app.trading_pg.invalid_cex_price readonly property bool price_entered: !General.isZero(non_null_price) readonly property int fontSize: Style.textSizeSmall1 readonly property int fontSizeBigger: Style.textSizeSmall2 - readonly property int line_scale: General.getComparisonScale(cex_price_diff) + readonly property int lineScale: General.getComparisonScale(cexPriceDiff) spacing: 35 @@ -120,12 +120,12 @@ ColumnLayout height: parent.height * 2 anchors.verticalCenter: parent.verticalCenter anchors.horizontalCenter: parent.horizontalCenter - anchors.horizontalCenterOffset: 0.5 * parent.width * Math.min(Math.max(parseFloat(cex_price_diff) / line_scale, -1), 1) + anchors.horizontalCenterOffset: 0.5 * parent.width * Math.min(Math.max(parseFloat(cexPriceDiff) / lineScale, -1), 1) } DefaultText { - text_value: General.formatPercent(line_scale) + text_value: General.formatPercent(lineScale) font.pixelSize: fontSize anchors.top: parent.top anchors.topMargin: -15 @@ -133,7 +133,7 @@ ColumnLayout DefaultText { - text_value: General.formatPercent(-line_scale) + text_value: General.formatPercent(-lineScale) font.pixelSize: fontSize anchors.top: parent.top anchors.topMargin: -15 @@ -147,8 +147,8 @@ ColumnLayout id: price_diff_text Layout.topMargin: 10 Layout.alignment: Qt.AlignHCenter - color: parseFloat(cex_price_diff) <= 0 ? Dex.CurrentTheme.okColor : Dex.CurrentTheme.noColor - text_value: (parseFloat(cex_price_diff) > 0 ? qsTr("Expensive") : qsTr("Expedient")) + ":    " + qsTr("%1 compared to CEX", "PRICE_DIFF%").arg("" + General.formatPercent(General.limitDigits(cex_price_diff)) + "") + color: parseFloat(cexPriceDiff) <= 0 ? Dex.CurrentTheme.okColor : Dex.CurrentTheme.noColor + text_value: (parseFloat(cexPriceDiff) > 0 ? qsTr("Expensive") : qsTr("Expedient")) + ":    " + qsTr("%1 compared to CEX", "PRICE_DIFF%").arg("" + General.formatPercent(General.limitDigits(cexPriceDiff)) + "") font.pixelSize: fontSize } } diff --git a/atomic_defi_design/Dex/Portfolio/Portfolio.qml b/atomic_defi_design/Dex/Portfolio/Portfolio.qml index 6834b55851..f947d84570 100644 --- a/atomic_defi_design/Dex/Portfolio/Portfolio.qml +++ b/atomic_defi_design/Dex/Portfolio/Portfolio.qml @@ -225,7 +225,7 @@ Item { SearchField { - id: coin_search_field + id: coinSearchField Layout.alignment: Qt.AlignVCenter Layout.preferredWidth: 206 Layout.preferredHeight: 42 diff --git a/atomic_defi_design/Dex/Wallet/AddressList.qml b/atomic_defi_design/Dex/Wallet/AddressList.qml index dd0067b367..515c5c860c 100644 --- a/atomic_defi_design/Dex/Wallet/AddressList.qml +++ b/atomic_defi_design/Dex/Wallet/AddressList.qml @@ -12,7 +12,7 @@ ColumnLayout id: root property alias title: title.text property alias model: list.model - property real addressFontSize: DefaultText.font.pixelSize + property real addressFontSize: address_text.font.pixelSize TitleText { @@ -31,6 +31,7 @@ ColumnLayout delegate: DefaultText { + id: address_text text_value: model.modelData privacy: true font.pixelSize: root.addressFontSize diff --git a/atomic_defi_design/Dex/Wallet/TransactionDetailsModal.qml b/atomic_defi_design/Dex/Wallet/TransactionDetailsModal.qml index e5a7c4381a..7447bf43e6 100644 --- a/atomic_defi_design/Dex/Wallet/TransactionDetailsModal.qml +++ b/atomic_defi_design/Dex/Wallet/TransactionDetailsModal.qml @@ -33,7 +33,7 @@ MultipageModal { title: qsTr("Amount") text: !details ? "" : General.formatCrypto(!details.am_i_sender, details.amount, api_wallet_page.ticker, details.amount_fiat, API.app.settings_pg.current_currency) - value_color: !details ? "white" : details.am_i_sender ? DexTheme.redColor : DexTheme.greenColor + value_color: !details ? "white" : details.am_i_sender ? Dex.CurrentTheme.redColor : Dex.CurrentTheme.greenColor privacy: true label.font.pixelSize: 13 } @@ -43,7 +43,7 @@ MultipageModal { title: qsTr("Fees") text: !details ? "" : General.formatCrypto(parseFloat(details.fees) < 0, Math.abs(parseFloat(details.fees)), current_ticker_infos.fee_ticker, details.fees_amount_fiat, API.app.settings_pg.current_currency) - value_color: !details ? "white" : parseFloat(details.fees) > 0 ? DexTheme.redColor : DexTheme.greenColor + value_color: !details ? "white" : parseFloat(details.fees) > 0 ? Dex.CurrentTheme.redColor : Dex.CurrentTheme.greenColor privacy: true label.font.pixelSize: 13 } diff --git a/src/core/atomicdex/api/mm2/mm2.cpp b/src/core/atomicdex/api/mm2/mm2.cpp index 2ef312aa83..c35bee2154 100644 --- a/src/core/atomicdex/api/mm2/mm2.cpp +++ b/src/core/atomicdex/api/mm2/mm2.cpp @@ -476,11 +476,11 @@ namespace mm2::api if (jf_evt.at("data").contains("taker_payment_lock")) { - contents.payment_lock = jf_evt.at("data").at("taker_payment_lock").get() * 1000; + contents.paymentLock = jf_evt.at("data").at("taker_payment_lock").get() * 1000; } else if (jf_evt.at("data").contains("maker_payment_lock")) { - contents.payment_lock = jf_evt.at("data").at("maker_payment_lock").get() * 1000; + contents.paymentLock = jf_evt.at("data").at("maker_payment_lock").get() * 1000; } } diff --git a/src/core/atomicdex/data/dex/qt.orders.data.hpp b/src/core/atomicdex/data/dex/qt.orders.data.hpp index 06241b9a8d..f8348c6d6b 100644 --- a/src/core/atomicdex/data/dex/qt.orders.data.hpp +++ b/src/core/atomicdex/data/dex/qt.orders.data.hpp @@ -46,7 +46,7 @@ namespace mm2::api //! eg: 1595406178 unsigned long long unix_timestamp; - unsigned long long payment_lock; + unsigned long long paymentLock; //! eg: b741646a-5738-4012-b5b0-dcd1375affd1 QString order_id; diff --git a/src/core/atomicdex/models/qt.orders.model.cpp b/src/core/atomicdex/models/qt.orders.model.cpp index c53921b49e..64ab7c072f 100644 --- a/src/core/atomicdex/models/qt.orders.model.cpp +++ b/src/core/atomicdex/models/qt.orders.model.cpp @@ -92,7 +92,7 @@ namespace atomic_dex item.unix_timestamp = value.toULongLong(); break; case PaymentLockRole: - item.payment_lock = value.toULongLong(); + item.paymentLock = value.toULongLong(); break; case OrderIdRole: item.order_id = value.toString(); @@ -173,7 +173,7 @@ namespace atomic_dex case UnixTimestampRole: return item.unix_timestamp; case PaymentLockRole: - return item.payment_lock; + return item.paymentLock; case OrderIdRole: return item.order_id; case OrderStatusRole: @@ -237,7 +237,7 @@ namespace atomic_dex {IsMakerRole, "is_maker"}, {HumanDateRole, "date"}, {UnixTimestampRole, "timestamp"}, - {PaymentLockRole, "payment_lock"}, + {PaymentLockRole, "paymentLock"}, {OrderIdRole, "order_id"}, {OrderStatusRole, "order_status"}, {MakerPaymentIdRole, "maker_payment_id"}, @@ -424,7 +424,7 @@ namespace atomic_dex auto&& [prev_value, new_value, is_change] = update_value(OrdersRoles::OrderStatusRole, contents.order_status, idx, *this); update_value(OrdersRoles::UnixTimestampRole, contents.unix_timestamp, idx, *this); - update_value(OrdersRoles::PaymentLockRole, contents.payment_lock, idx, *this); + update_value(OrdersRoles::PaymentLockRole, contents.paymentLock, idx, *this); auto&& [prev_value_d, new_value_d, _] = update_value(OrdersRoles::HumanDateRole, contents.human_date, idx, *this); if (is_change) { @@ -716,14 +716,14 @@ namespace atomic_dex ::mm2::api::to_json(json_data, req); batch.push_back(json_data); - SPDLOG_INFO("recover_funds_of_swap request: {}", json_data.dump(-1)); + SPDLOG_DEBUG("recover_funds_of_swap request: {}", json_data.dump(-1)); auto answer_functor = [this](web::http::http_response resp) { nlohmann::json j_out = nlohmann::json::object(); std::string body = TO_STD_STR(resp.extract_string(true).get()); - SPDLOG_INFO("recover_funds_of_swap answer received: {}", body); + SPDLOG_DEBUG("recover_funds_of_swap answer received: {}", body); if (resp.status_code() == web::http::status_codes::OK) { From 686095e3e7a60484da8965155d8f87ee40e89ea5 Mon Sep 17 00:00:00 2001 From: syl Date: Wed, 8 Jun 2022 13:00:33 +0200 Subject: [PATCH 093/177] Addressbook: Update style --- atomic_defi_design/Dex/Addressbook/AddAddressForm.qml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/atomic_defi_design/Dex/Addressbook/AddAddressForm.qml b/atomic_defi_design/Dex/Addressbook/AddAddressForm.qml index 45b49e204d..cf804e6a33 100644 --- a/atomic_defi_design/Dex/Addressbook/AddAddressForm.qml +++ b/atomic_defi_design/Dex/Addressbook/AddAddressForm.qml @@ -95,7 +95,11 @@ Dex.Rectangle { id: useStandardsCheckBox Layout.preferredWidth: 150 + Layout.leftMargin: 4 + boxWidth: 22 + boxHeight: 22 text: qsTr("Use standard network address") + font: DexTypo.overLine } } From 4b6f1c15c2ef0ab3aa099a947fd7926540256ed9 Mon Sep 17 00:00:00 2001 From: syl Date: Wed, 8 Jun 2022 13:13:24 +0200 Subject: [PATCH 094/177] Addressbook: Update style --- .../Dex/Addressbook/AddAddressForm.qml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/atomic_defi_design/Dex/Addressbook/AddAddressForm.qml b/atomic_defi_design/Dex/Addressbook/AddAddressForm.qml index cf804e6a33..b61ab02956 100644 --- a/atomic_defi_design/Dex/Addressbook/AddAddressForm.qml +++ b/atomic_defi_design/Dex/Addressbook/AddAddressForm.qml @@ -43,7 +43,7 @@ Dex.Rectangle signal addressCreated() width: 500 - height: 302 + height: column.height + 26 radius: 10 onVisibleChanged: @@ -74,14 +74,14 @@ Dex.Rectangle ColumnLayout { - anchors.fill: parent - anchors.margins: 21 + id: column + anchors.centerIn: parent spacing: 17 RowLayout { Layout.preferredWidth: 458 - Layout.preferredHeight: 44 + Layout.preferredHeight: 38 AddressTypeSelector { @@ -99,7 +99,7 @@ Dex.Rectangle boxWidth: 22 boxHeight: 22 text: qsTr("Use standard network address") - font: DexTypo.overLine + font: Dex.DexTypo.caption } } @@ -107,7 +107,7 @@ Dex.Rectangle { id: addressKeyField Layout.preferredWidth: 458 - Layout.preferredHeight: 44 + Layout.preferredHeight: 38 placeholderText: qsTr("Label") Dex.ToolTip @@ -121,7 +121,7 @@ Dex.Rectangle { id: addressValueField Layout.preferredWidth: 458 - Layout.preferredHeight: 44 + Layout.preferredHeight: 38 placeholderText: qsTr("Address") } @@ -129,6 +129,7 @@ Dex.Rectangle { id: invalidAddressValueLabel Layout.fillWidth: true + visible: text !== "" color: Dex.CurrentTheme.noColor wrapMode: Dex.Text.Wrap horizontalAlignment: Text.AlignHCenter From ac1cc232f6ac953a81f84a48d4efd973e922fcdb Mon Sep 17 00:00:00 2001 From: smk762 Date: Sat, 11 Jun 2022 00:09:27 +0800 Subject: [PATCH 095/177] fix swap progress coloring --- .../ProView/TradingInfo/SwapProgress.qml | 27 ++++++++++--------- .../Dex/Wallet/TransactionDetailsModal.qml | 4 +-- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/SwapProgress.qml b/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/SwapProgress.qml index 3aa6875e32..68b534cf99 100644 --- a/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/SwapProgress.qml +++ b/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/SwapProgress.qml @@ -175,9 +175,9 @@ ColumnLayout function getTimeText(duration, estimated) { - return `` + qsTr("act", "SHORT FOR ACTUAL TIME") + ": " + `` + - `` + General.durationTextShort(duration) + `` + - ` | ` + qsTr("est", "SHORT FOR ESTIMATED") + ": " + + return `` + qsTr("act", "SHORT FOR ACTUAL TIME") + ": " + `` + + `` + General.durationTextShort(duration) + `` + + ` | ` + qsTr("est", "SHORT FOR ESTIMATED") + ": " + General.durationTextShort(estimated) + `` } @@ -185,11 +185,11 @@ ColumnLayout { if ((paymentLockCountdownTime > 0) && (waitUntilCountdownTime == -1)) { - return `` + qsTr(General.durationTextShort(paymentLockCountdownTime) + " until refund lock is released.") + `` + return `` + qsTr(General.durationTextShort(paymentLockCountdownTime) + " until refund lock is released.") + `` } else if (waitUntilCountdownTime > 0) { if (lastEvent.state !== "Finished") { - return `` + qsTr(General.durationTextShort(waitUntilCountdownTime) + " until refund completed.") + `` + return `` + qsTr(General.durationTextShort(waitUntilCountdownTime) + " until refund completed.") + `` } } return "" @@ -199,8 +199,8 @@ ColumnLayout DefaultText { Layout.fillWidth: true - text_value: `` + qsTr("Progress details") + `` + - ` | ` + + text_value: `` + qsTr("Progress details") + `` + + ` | ` + getTimeText(totalTimePassed + simulatedTime, totalTimePassedEstimated) font.pixelSize: Style.textSize1 Layout.bottomMargin: 10 @@ -239,16 +239,17 @@ ColumnLayout anchors.left: parent.left anchors.leftMargin: 10 anchors.verticalCenter: col_layout.verticalCenter + color: { // Already exists, completed event if (event) { // Red for the Finished if swap failed - if (event.state === "Finished" && details.order_status === "failed") return Dex.CurrentTheme.redColor + if (event.state === "Finished" && details.order_status === "failed") return Dex.CurrentTheme.noColor // Red for error event, green for the others - return details.error_events.indexOf(event.state) === -1 ? Dex.CurrentTheme.greenColor : Dex.CurrentTheme.redColor + return details.error_events.indexOf(event.state) === -1 ? Dex.CurrentTheme.okColor : Dex.CurrentTheme.noColor } // In progress one is orange @@ -256,7 +257,7 @@ ColumnLayout return Style.colorOrange // Passive color for the rest - return Dex.CurrentTheme.foregroundColorLightColor2 + return Dex.CurrentTheme.foregroundColor3 } } @@ -276,7 +277,7 @@ ColumnLayout font.pixelSize: Style.textSizeSmall4 text_value: getEventText(modelData) - color: event ? Dex.CurrentTheme.foregroundColor : is_current_event ? Dex.CurrentTheme.foregroundColorLightColor0 : Dex.CurrentTheme.foregroundColorLightColor2 + color: event ? Dex.CurrentTheme.foregroundColor : is_current_event ? Dex.CurrentTheme.foregroundColor : Dex.CurrentTheme.foregroundColor3 } AnimatedRectangle @@ -286,13 +287,13 @@ ColumnLayout width: parent.width height: 2 - color: Dex.CurrentTheme.foregroundColorDarkColor3 + color: Dex.CurrentTheme.foregroundColor2 AnimatedRectangle { width: parent.width * (totalTimePassed > 0 ? (time_passed / (totalTimePassed + simulatedTime)) : 0) height: parent.height - color: Dex.CurrentTheme.greenColor + color: Dex.CurrentTheme.okColor } } diff --git a/atomic_defi_design/Dex/Wallet/TransactionDetailsModal.qml b/atomic_defi_design/Dex/Wallet/TransactionDetailsModal.qml index 7447bf43e6..4affd7a75d 100644 --- a/atomic_defi_design/Dex/Wallet/TransactionDetailsModal.qml +++ b/atomic_defi_design/Dex/Wallet/TransactionDetailsModal.qml @@ -33,7 +33,7 @@ MultipageModal { title: qsTr("Amount") text: !details ? "" : General.formatCrypto(!details.am_i_sender, details.amount, api_wallet_page.ticker, details.amount_fiat, API.app.settings_pg.current_currency) - value_color: !details ? "white" : details.am_i_sender ? Dex.CurrentTheme.redColor : Dex.CurrentTheme.greenColor + value_color: !details ? "white" : details.am_i_sender ? Dex.CurrentTheme.noColor : Dex.CurrentTheme.okColor privacy: true label.font.pixelSize: 13 } @@ -43,7 +43,7 @@ MultipageModal { title: qsTr("Fees") text: !details ? "" : General.formatCrypto(parseFloat(details.fees) < 0, Math.abs(parseFloat(details.fees)), current_ticker_infos.fee_ticker, details.fees_amount_fiat, API.app.settings_pg.current_currency) - value_color: !details ? "white" : parseFloat(details.fees) > 0 ? Dex.CurrentTheme.redColor : Dex.CurrentTheme.greenColor + value_color: !details ? "white" : parseFloat(details.fees) > 0 ? Dex.CurrentTheme.noColor : Dex.CurrentTheme.okColor privacy: true label.font.pixelSize: 13 } From a19dbcbff366976f3a8d62285a7bfe52539e2278 Mon Sep 17 00:00:00 2001 From: smk762 Date: Sun, 12 Jun 2022 14:25:21 +0800 Subject: [PATCH 096/177] show protocol in order form --- atomic_defi_design/Dex/Constants/General.qml | 33 +++++ .../Exchange/ProView/PlaceOrderForm/Main.qml | 134 ++++++++++++++---- .../ProView/PlaceOrderForm/TotalView.qml | 10 +- 3 files changed, 141 insertions(+), 36 deletions(-) diff --git a/atomic_defi_design/Dex/Constants/General.qml b/atomic_defi_design/Dex/Constants/General.qml index 5a85f9391f..ba7438f4fe 100644 --- a/atomic_defi_design/Dex/Constants/General.qml +++ b/atomic_defi_design/Dex/Constants/General.qml @@ -102,6 +102,39 @@ QtObject { } } + + function getProtocolText(ticker) { + if(ticker === "" || ticker === "All" || ticker===undefined) { + return "" + } else { + let token_platform = coinPlatform(ticker) + switch(token_platform) { + case "BNB": + return "Binance Smart Chain (BEP20 token)" + case "FTM": + return "Fantom (FTM20 token)" + case "ONE": + return "Harmony (HRC20 token)" + case "ETH": + return "Ethereum (ERC20 token)" + case "KCS": + return "KuCoin (KRC20 token)" + case "MATIC": + return "Polygon (PLG20 token)" + case "AVAX": + return "Avalanche (AVX20 token)" + case "HT": + return "Heco Chain (HCO20 token)" + case "MOVR": + return "Moonriver (MVR20 token)" + case "QTUM": + return "QTUM (QRC20 token)" + default: + return ticker + " (" + token_platform + ")" + } + } + } + function isIDO(ticker) { let IDO_chains = [] return IDO_chains.includes(ticker) diff --git a/atomic_defi_design/Dex/Exchange/ProView/PlaceOrderForm/Main.qml b/atomic_defi_design/Dex/Exchange/ProView/PlaceOrderForm/Main.qml index cc0c2f73bf..37cd5249d1 100644 --- a/atomic_defi_design/Dex/Exchange/ProView/PlaceOrderForm/Main.qml +++ b/atomic_defi_design/Dex/Exchange/ProView/PlaceOrderForm/Main.qml @@ -12,25 +12,76 @@ import AtomicDEX.MarketMode 1.0 Widget { title: qsTr("Place Order") + property string protocolIcon: General.platformIcon(General.coinPlatform(left_ticker)) - margins: 20 + margins: 15 collapsable: false + + // Order selected indicator + Item + { + Layout.topMargin: 5 + Layout.alignment: Qt.AlignHCenter + Layout.preferredWidth: parent.width + Layout.preferredHeight: 40 + visible: API.app.trading_pg.preffered_order.price !== undefined + + RowLayout + { + id: orderSelection + anchors.fill: parent + anchors.verticalCenter: parent.verticalCenter + + DefaultText + { + Layout.leftMargin: 15 + color: Dex.CurrentTheme.noColor + text: qsTr("Order Selected") + } + + Item { Layout.fillWidth: true } + + Qaterial.FlatButton + { + Layout.preferredHeight: parent.height + Layout.preferredWidth: 30 + Layout.rightMargin: 5 + foregroundColor: Dex.CurrentTheme.noColor + onClicked: API.app.trading_pg.reset_order() + + Qaterial.ColorIcon + { + anchors.centerIn: parent + iconSize: 16 + color: Dex.CurrentTheme.noColor + source: Qaterial.Icons.close + } + } + } + + Rectangle + { + anchors.fill: parent + radius: 8 + color: 'transparent' + border.color: Dex.CurrentTheme.noColor + } + } + // Market mode selector RowLayout { - Layout.topMargin: 10 + Layout.topMargin: 5 Layout.alignment: Qt.AlignHCenter - Layout.minimumHeight: 40 - Layout.maximumHeight: 48 - Layout.fillWidth: true + Layout.preferredWidth: parent.width Layout.fillHeight: true MarketModeSelector { Layout.alignment: Qt.AlignLeft Layout.preferredWidth: (parent.width / 100) * 46 - Layout.fillHeight: true + Layout.preferredHeight: 50 marketMode: MarketMode.Buy ticker: atomic_qt_utilities.retrieve_main_ticker(left_ticker) } @@ -41,47 +92,68 @@ Widget { Layout.alignment: Qt.AlignRight Layout.preferredWidth: (parent.width / 100) * 46 - Layout.fillHeight: true + Layout.preferredHeight: 50 ticker: atomic_qt_utilities.retrieve_main_ticker(left_ticker) } } - // Order selected indicator - Rectangle + HorizontalLine { - visible: API.app.trading_pg.preffered_order.price !== undefined + Layout.alignment: Qt.AlignHCenter Layout.preferredWidth: parent.width - Layout.preferredHeight: 40 + visible: protocolIcon != "" + color: Dex.CurrentTheme.backgroundColorDeep + } + + ColumnLayout + { + spacing: 3 Layout.alignment: Qt.AlignHCenter - radius: 8 - color: 'transparent' - border.color: Dex.CurrentTheme.noColor + Layout.preferredWidth: parent.width + visible: protocolIcon != "" - DefaultText + DexLabel { - anchors.verticalCenter: parent.verticalCenter - leftPadding: 15 - color: Dex.CurrentTheme.noColor - text: qsTr("Order Selected") + id: protocolTitle + Layout.preferredWidth: parent.width + text_value: "Protocol:" + font.pixelSize: Style.textSizeSmall1 + horizontalAlignment: Text.AlignHCenter + color: Style.colorText2 } - Qaterial.FlatButton + RowLayout { - anchors.right: parent.right - anchors.rightMargin: 15 - anchors.verticalCenter: parent.verticalCenter - foregroundColor: Dex.CurrentTheme.noColor - icon.source: Qaterial.Icons.close - backgroundImplicitWidth: 40 - backgroundImplicitHeight: 30 + id: protocol + Layout.alignment: Qt.AlignHCenter + Layout.preferredWidth: parent.width - onClicked: API.app.trading_pg.reset_order() + Item { Layout.fillWidth: true } + + DefaultImage + { + id: protocolImg + source: protocolIcon + Layout.preferredHeight: 16 + Layout.preferredWidth: Layout.preferredHeight + } + + DexLabel + { + id: protocolText + text_value: General.getProtocolText(left_ticker) + wrapMode: DexLabel.NoWrap + font.pixelSize: Style.textSizeSmall1 + color: Style.colorText2 + } + + Item { Layout.fillWidth: true } } } OrderForm { - id: form_base + id: formBase Layout.preferredWidth: parent.width Layout.alignment: Qt.AlignHCenter } @@ -97,11 +169,11 @@ Widget Layout.preferredHeight: 40 Layout.preferredWidth: parent.width - 20 Layout.alignment: Qt.AlignHCenter - radius: 18 + radius: 18 text: qsTr("START SWAP") font.weight: Font.Medium - enabled: form_base.can_submit_trade + enabled: formBase.can_submit_trade onClicked: confirm_trade_modal.open() } diff --git a/atomic_defi_design/Dex/Exchange/ProView/PlaceOrderForm/TotalView.qml b/atomic_defi_design/Dex/Exchange/ProView/PlaceOrderForm/TotalView.qml index 396eff9ab2..2372aba493 100644 --- a/atomic_defi_design/Dex/Exchange/ProView/PlaceOrderForm/TotalView.qml +++ b/atomic_defi_design/Dex/Exchange/ProView/PlaceOrderForm/TotalView.qml @@ -30,11 +30,10 @@ ColumnLayout CexInfoTrigger {} } - Item { Layout.fillWidth: true } - DefaultText { - Layout.alignment: Qt.AlignRight + Layout.fillWidth: true + horizontalAlignment: Text.AlignRight font.weight: Font.DemiBold font.pixelSize: 16 font.family: 'lato' @@ -58,16 +57,17 @@ ColumnLayout DexLabel { color: Dex.CurrentTheme.foregroundColor3 + Layout.preferredWidth: parent.width * 0.3 text: "Total " + atomic_qt_utilities.retrieve_main_ticker(right_ticker) font.pixelSize: 14 opacity: .6 font.weight: Font.Normal } - Item { Layout.fillWidth: true } - DefaultText { + Layout.fillWidth: true + horizontalAlignment: Text.AlignRight font.weight: Font.DemiBold font.pixelSize: 16 font.family: 'lato' From d2df569eaabc6c4c9b4b197eea40ad1f953b91f3 Mon Sep 17 00:00:00 2001 From: smk762 Date: Sun, 12 Jun 2022 16:49:39 +0800 Subject: [PATCH 097/177] add nomics charts --- atomic_defi_design/Dex/Constants/General.qml | 10 +++ .../Dex/Exchange/ProView/Chart.qml | 72 ++++++++++++++----- src/core/atomicdex/config/coins.cfg.cpp | 16 +++++ src/core/atomicdex/config/coins.cfg.hpp | 1 + .../models/qt.global.coins.cfg.model.cpp | 1 + 5 files changed, 82 insertions(+), 18 deletions(-) diff --git a/atomic_defi_design/Dex/Constants/General.qml b/atomic_defi_design/Dex/Constants/General.qml index 5a85f9391f..929e6994a5 100644 --- a/atomic_defi_design/Dex/Constants/General.qml +++ b/atomic_defi_design/Dex/Constants/General.qml @@ -38,6 +38,16 @@ QtObject { } } + function getNomicsId(ticker) { + if(ticker === "" || ticker === "All" || ticker===undefined) { + return "" + } else { + const nomics_id = API.app.portfolio_pg.global_cfg_mdl.get_coin_info(ticker).nomics_id + if (nomics_id == 'test-coin') return "" + return nomics_id + } + } + function coinContractAddress(ticker) { var cfg = API.app.trading_pg.get_raw_mm2_coin_cfg(ticker) if (cfg.hasOwnProperty('protocol')) { diff --git a/atomic_defi_design/Dex/Exchange/ProView/Chart.qml b/atomic_defi_design/Dex/Exchange/ProView/Chart.qml index 500c88fd97..9ff3475bfe 100644 --- a/atomic_defi_design/Dex/Exchange/ProView/Chart.qml +++ b/atomic_defi_design/Dex/Exchange/ProView/Chart.qml @@ -19,32 +19,65 @@ Widget property bool pair_supported: false onPair_supportedChanged: if (!pair_supported) webEngineViewPlaceHolder.visible = false - function loadChart(base, rel, force = false) + function loadChart(base, rel, force = false, source="nomics") { - const pair = atomic_qt_utilities.retrieve_main_ticker(base) + "/" + atomic_qt_utilities.retrieve_main_ticker(rel) - const pair_reversed = atomic_qt_utilities.retrieve_main_ticker(rel) + "/" + atomic_qt_utilities.retrieve_main_ticker(base) - // Try checking if pair/reversed-pair exists - let symbol = General.supported_pairs[pair] - if (!symbol) symbol = General.supported_pairs[pair_reversed] + let chart_html = "" + let symbol = "" - if (!symbol) + if (source == "nomics") { - pair_supported = false - return + let base_full = General.coinName(base) + let base_id = General.getNomicsId(base) + let rel_id = General.getNomicsId(rel) + if (base_id != "" && rel_id != "") + { + symbol = base_id+"-"+rel_id + pair_supported = true + if (symbol === loaded_symbol && !force) + { + webEngineViewPlaceHolder.visible = true + return + } + loaded_symbol = symbol + chart_html = ` + + + +

+ + ` + } } + if (chart_html == "") + { + const pair = atomic_qt_utilities.retrieve_main_ticker(base) + "/" + atomic_qt_utilities.retrieve_main_ticker(rel) + const pair_reversed = atomic_qt_utilities.retrieve_main_ticker(rel) + "/" + atomic_qt_utilities.retrieve_main_ticker(base) - pair_supported = true + // Try checking if pair/reversed-pair exists + symbol = General.supported_pairs[pair] + if (!symbol) symbol = General.supported_pairs[pair_reversed] - if (symbol === loaded_symbol && !force) - { - webEngineViewPlaceHolder.visible = true - return - } + if (!symbol) + { + pair_supported = false + return + } + + pair_supported = true + + if (symbol === loaded_symbol && !force) + { + webEngineViewPlaceHolder.visible = true + return + } - loaded_symbol = symbol + loaded_symbol = symbol + console.log("Using Nomics "+ loaded_symbol) - dashboard.webEngineView.loadHtml(` + let chart_html = ` @@ -69,7 +102,10 @@ Widget ); - `) + ` + } + + dashboard.webEngineView.loadHtml(chart_html) } Component.onCompleted: diff --git a/src/core/atomicdex/config/coins.cfg.cpp b/src/core/atomicdex/config/coins.cfg.cpp index ec4f7ccaa8..7fd94b9c98 100644 --- a/src/core/atomicdex/config/coins.cfg.cpp +++ b/src/core/atomicdex/config/coins.cfg.cpp @@ -45,6 +45,7 @@ namespace atomic_dex cfg.minimal_claim_amount = cfg.is_claimable ? j.at("minimal_claim_amount").get() : "0"; j.at("active").get_to(cfg.active); j.at("currently_enabled").get_to(cfg.currently_enabled); + if (j.contains("coinpaprika_id")) { j.at("coinpaprika_id").get_to(cfg.coinpaprika_id); @@ -53,10 +54,25 @@ namespace atomic_dex { cfg.coinpaprika_id = "test-coin"; } + + if (j.contains("nomics_id")) + { + j.at("nomics_id").get_to(cfg.nomics_id); + } + else + { + cfg.nomics_id = "test-coin"; + } + if (j.contains("coingecko_id")) { j.at("coingecko_id").get_to(cfg.coingecko_id); } + else + { + cfg.coingecko_id = "test-coin"; + } + if (j.contains("is_custom_coin")) { cfg.is_custom_coin = true; diff --git a/src/core/atomicdex/config/coins.cfg.hpp b/src/core/atomicdex/config/coins.cfg.hpp index e705630d4c..3c2d7f7033 100644 --- a/src/core/atomicdex/config/coins.cfg.hpp +++ b/src/core/atomicdex/config/coins.cfg.hpp @@ -51,6 +51,7 @@ namespace atomic_dex bool active{false}; std::string coinpaprika_id{"test-coin"}; std::string coingecko_id{"test-coin"}; + std::string nomics_id{"test-coin"}; bool is_custom_coin{false}; std::string type; std::vector explorer_url; ///< usefull for transaction, take this url and append transaction id diff --git a/src/core/atomicdex/models/qt.global.coins.cfg.model.cpp b/src/core/atomicdex/models/qt.global.coins.cfg.model.cpp index 1012b7e9e5..79205dafc3 100644 --- a/src/core/atomicdex/models/qt.global.coins.cfg.model.cpp +++ b/src/core/atomicdex/models/qt.global.coins.cfg.model.cpp @@ -35,6 +35,7 @@ namespace {"ticker", QString::fromStdString(coin.ticker)}, {"name", QString::fromStdString(coin.name)}, {"type", QString::fromStdString(coin.type)}, + {"nomics_id", QString::fromStdString(coin.nomics_id)}, {"explorer_url", QJsonArray::fromStringList(atomic_dex::vector_std_string_to_qt_string_list(coin.explorer_url))}, {"tx_uri", QString::fromStdString(coin.tx_uri)}, {"address_uri", QString::fromStdString(coin.address_url)}, From 75d8d3a1346df8fd2a5cd88407c5b1d5d398e677 Mon Sep 17 00:00:00 2001 From: smk762 Date: Sun, 12 Jun 2022 20:25:08 +0800 Subject: [PATCH 098/177] move chart to tab --- .../Dex/Exchange/ProView/Chart.qml | 20 +++++++------------ .../Dex/Exchange/ProView/TradingInfo/Main.qml | 16 +++++++++++++++ .../Dex/Exchange/Trade/ProView.qml | 17 ++-------------- .../Dex/Exchange/Trade/Trade.qml | 1 - .../Trade/Trading/TradeViewHeader.qml | 6 +++--- 5 files changed, 28 insertions(+), 32 deletions(-) diff --git a/atomic_defi_design/Dex/Exchange/ProView/Chart.qml b/atomic_defi_design/Dex/Exchange/ProView/Chart.qml index 9ff3475bfe..5a9ff2145b 100644 --- a/atomic_defi_design/Dex/Exchange/ProView/Chart.qml +++ b/atomic_defi_design/Dex/Exchange/ProView/Chart.qml @@ -7,12 +7,9 @@ import "../../Components" import "../../Constants" import Dex.Themes 1.0 as Dex -Widget +Item { id: root - title: qsTr("Chart") - background: null - margins: 0 readonly property string theme: Dex.CurrentTheme.getColorMode() === Dex.CurrentTheme.ColorMode.Dark ? "dark" : "light" property string loaded_symbol @@ -42,7 +39,7 @@ Widget loaded_symbol = symbol chart_html = ` @@ -75,11 +72,10 @@ Widget } loaded_symbol = symbol - console.log("Using Nomics "+ loaded_symbol) let chart_html = ` @@ -104,7 +100,6 @@ Widget ` } - dashboard.webEngineView.loadHtml(chart_html) } @@ -120,9 +115,8 @@ Widget RowLayout { - Layout.fillWidth: true - Layout.fillHeight: true - Layout.alignment: Qt.AlignCenter + anchors.fill: parent + anchors.margins: 28 visible: !webEngineViewPlaceHolder.visible DefaultBusyIndicator @@ -152,8 +146,8 @@ Widget Item { id: webEngineViewPlaceHolder - Layout.fillWidth: true - Layout.fillHeight: true + anchors.fill: parent + anchors.margins: 28 visible: false Component.onCompleted: diff --git a/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/Main.qml b/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/Main.qml index c9e5fc0566..f2983d0232 100644 --- a/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/Main.qml +++ b/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/Main.qml @@ -7,6 +7,7 @@ import Qaterial 1.0 as Qaterial import Dex.Themes 1.0 as Dex import "../../../Constants" import "../../../Components" +import "../../ProView" Widget { @@ -21,6 +22,7 @@ Widget property int taux_exchange: 0 property int order_idx: 1 property int history_idx: 2 + property int pair_chart_idx: 3 background: null Layout.leftMargin: 6 @@ -49,6 +51,14 @@ Widget textSecondaryColor: Dex.CurrentTheme.foregroundColor2 indicatorColor: Dex.CurrentTheme.foregroundColor } + Qaterial.LatoTabButton + { + text: qsTr("Chart") + font.pixelSize: 14 + textColor: checked ? Dex.CurrentTheme.foregroundColor : Dex.CurrentTheme.foregroundColor2 + textSecondaryColor: Dex.CurrentTheme.foregroundColor2 + indicatorColor: Dex.CurrentTheme.foregroundColor + } } Rectangle @@ -79,6 +89,12 @@ Widget is_history: true clip: true } + + // Chart + Chart + { + id: chart + } } } } diff --git a/atomic_defi_design/Dex/Exchange/Trade/ProView.qml b/atomic_defi_design/Dex/Exchange/Trade/ProView.qml index 95fb4b98e5..af102607b1 100644 --- a/atomic_defi_design/Dex/Exchange/Trade/ProView.qml +++ b/atomic_defi_design/Dex/Exchange/Trade/ProView.qml @@ -40,7 +40,6 @@ RowLayout { id: form - property alias chart: chart property alias tickerSelectors: selectors property alias trInfo: tradingInfo property alias orderBook: orderBook @@ -112,7 +111,7 @@ RowLayout { Layout.alignment: Qt.AlignTop - Layout.minimumWidth: chart.visible || selectors.visible || tradingInfo.visible ? 480 : -1 + Layout.minimumWidth: selectors.visible || tradingInfo.visible ? 480 : -1 Layout.maximumWidth: (!orderBook.visible && !bestOrders.visible) || (!placeOrderForm.visible) ? -1 : 735 Layout.fillWidth: true @@ -120,18 +119,6 @@ RowLayout spacing: 20 - // Chart - Chart - { - id: chart - - Layout.fillWidth: true - - Layout.minimumHeight: isCollapsed() ? 60 : 190 - Layout.maximumHeight: tradingInfo.isCollapsed() ? -1 : 360 - Layout.fillHeight: !isCollapsed() - } - // Ticker selectors. TickerSelectors { @@ -149,7 +136,7 @@ RowLayout Layout.fillWidth: true Layout.minimumHeight: isCollapsed() ? 60 : 380 - Layout.maximumHeight: chart.isCollapsed() ? -1 : 500 + Layout.maximumHeight: 600 Layout.fillHeight: !isCollapsed() } } diff --git a/atomic_defi_design/Dex/Exchange/Trade/Trade.qml b/atomic_defi_design/Dex/Exchange/Trade/Trade.qml index b3724ac4dd..da80217cea 100644 --- a/atomic_defi_design/Dex/Exchange/Trade/Trade.qml +++ b/atomic_defi_design/Dex/Exchange/Trade/Trade.qml @@ -163,7 +163,6 @@ Item width: parent.width height: parent.height * 0.06 - proViewChart: proView.chart proViewTickerSelectors: proView.tickerSelectors proViewTrInfo: proView.trInfo proViewOrderBook: proView.orderBook diff --git a/atomic_defi_design/Dex/Exchange/Trade/Trading/TradeViewHeader.qml b/atomic_defi_design/Dex/Exchange/Trade/Trading/TradeViewHeader.qml index a6672d67e0..1677584b8e 100644 --- a/atomic_defi_design/Dex/Exchange/Trade/Trading/TradeViewHeader.qml +++ b/atomic_defi_design/Dex/Exchange/Trade/Trading/TradeViewHeader.qml @@ -18,7 +18,7 @@ import "../../../Constants" // Simple/Pro toggle group Item { - property var proViewChart + // property var proViewChart property var proViewTickerSelectors property var proViewTrInfo property var proViewOrderBook @@ -121,11 +121,11 @@ Item DefaultText { text: qsTr("Display Settings"); font: DexTypo.body2 } HorizontalLine { width: parent.width - 20; anchors.horizontalCenter: parent.horizontalCenter; opacity: .4 } - + /* CheckEye { text: qsTr("Chart"); target: proViewChart } HorizontalLine { width: parent.width - 20; anchors.horizontalCenter: parent.horizontalCenter; opacity: .4 } - + */ CheckEye { text: qsTr("Ticker Selectors"); target: proViewTickerSelectors } HorizontalLine { width: parent.width - 20; anchors.horizontalCenter: parent.horizontalCenter; opacity: .4 } From fb15253e0efce733cb23024f041f524cae2eaadb Mon Sep 17 00:00:00 2001 From: smk762 Date: Sun, 12 Jun 2022 23:38:06 +0800 Subject: [PATCH 099/177] fix vars --- atomic_defi_design/Dex/Exchange/ProView/Chart.qml | 3 ++- atomic_defi_design/Dex/Exchange/Trade/ProView.qml | 2 -- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/atomic_defi_design/Dex/Exchange/ProView/Chart.qml b/atomic_defi_design/Dex/Exchange/ProView/Chart.qml index 5a9ff2145b..fbc9fc7ee7 100644 --- a/atomic_defi_design/Dex/Exchange/ProView/Chart.qml +++ b/atomic_defi_design/Dex/Exchange/ProView/Chart.qml @@ -43,9 +43,10 @@ Item -
+
` + console.log(chart_html) } } if (chart_html == "") diff --git a/atomic_defi_design/Dex/Exchange/Trade/ProView.qml b/atomic_defi_design/Dex/Exchange/Trade/ProView.qml index af102607b1..2fe995f6f4 100644 --- a/atomic_defi_design/Dex/Exchange/Trade/ProView.qml +++ b/atomic_defi_design/Dex/Exchange/Trade/ProView.qml @@ -46,8 +46,6 @@ RowLayout property alias bestOrders: bestOrders property alias placeOrderForm: placeOrderForm - spacing: 16 - function selectOrder(is_asks, coin, price, quantity, price_denom, price_numer, quantity_denom, quantity_numer, min_volume, base_min_volume, base_max_volume, rel_min_volume, rel_max_volume, base_max_volume_denom, base_max_volume_numer, uuid) { setMarketMode(!is_asks ? MarketMode.Sell : MarketMode.Buy) From 5b48d30e83f8416d6ef66f71ffb6a7efe7e3d25d Mon Sep 17 00:00:00 2001 From: cipig Date: Sun, 12 Jun 2022 23:04:34 +0000 Subject: [PATCH 100/177] add nomics-ids for couple coins --- assets/config/0.5.5-coins.json | 223 ++++++++++++++++++++++++++------- 1 file changed, 179 insertions(+), 44 deletions(-) diff --git a/assets/config/0.5.5-coins.json b/assets/config/0.5.5-coins.json index 6f5bbef43c..d1eb60b6b6 100644 --- a/assets/config/0.5.5-coins.json +++ b/assets/config/0.5.5-coins.json @@ -392,6 +392,7 @@ "name": "Ankr", "coinpaprika_id": "ankr-ankr-network", "coingecko_id": "ankr", + "nomics_id": "ANKR", "nodes": [ "http://bsc1.cipig.net:8655", "http://bsc2.cipig.net:8655", @@ -409,6 +410,7 @@ "name": "Ankr", "coinpaprika_id": "ankr-ankr-network", "coingecko_id": "ankr", + "nomics_id": "ANKR", "nodes": [ "http://eth1.cipig.net:8555", "http://eth2.cipig.net:8555", @@ -517,6 +519,7 @@ "name": "Cosmos", "coinpaprika_id": "atom-cosmos", "coingecko_id": "cosmos", + "nomics_id": "ATOM", "nodes": [ "http://bsc1.cipig.net:8655", "http://bsc2.cipig.net:8655", @@ -581,6 +584,7 @@ "name": "Avalanche", "coinpaprika_id": "avax-avalanche", "coingecko_id": "avalanche-2", + "nomics_id": "AVAX", "nodes": [ "http://bsc1.cipig.net:8655", "http://bsc2.cipig.net:8655", @@ -598,6 +602,7 @@ "name": "Avalanche", "coinpaprika_id": "avax-avalanche", "coingecko_id": "avalanche-2", + "nomics_id": "AVAX", "nodes": [ "https://api.avax.network/ext/bc/C/rpc" ], @@ -656,6 +661,7 @@ "name": "Axie Infinity", "coinpaprika_id": "axs-axie-infinity", "coingecko_id": "axie-infinity", + "nomics_id": "AXS2", "nodes": [ "http://bsc1.cipig.net:8655", "http://bsc2.cipig.net:8655", @@ -673,6 +679,7 @@ "name": "Axie Infinity", "coinpaprika_id": "axs-axie-infinity", "coingecko_id": "axie-infinity", + "nomics_id": "AXS2", "nodes": [ "http://eth1.cipig.net:8555", "http://eth2.cipig.net:8555", @@ -690,6 +697,7 @@ "name": "Baby Doge Coin", "coinpaprika_id": "babydoge-baby-doge-coin", "coingecko_id": "baby-doge-coin", + "nomics_id": "BABYDOGE2", "nodes": [ "http://bsc1.cipig.net:8655", "http://bsc2.cipig.net:8655", @@ -773,9 +781,9 @@ "BANANO-BEP20": { "coin": "BANANO-BEP20", "name": "Banano", - "nomics_id": "BAN", "coinpaprika_id": "ban-banano", "coingecko_id": "banano", + "nomics_id": "BAN", "nodes": [ "http://bsc1.cipig.net:8655", "http://bsc2.cipig.net:8655", @@ -793,6 +801,7 @@ "name": "Band Protocol", "coinpaprika_id": "band-band-protocol", "coingecko_id": "band-protocol", + "nomics_id": "BAND", "nodes": [ "http://bsc1.cipig.net:8655", "http://bsc2.cipig.net:8655", @@ -827,6 +836,7 @@ "name": "Band Protocol", "coinpaprika_id": "band-band-protocol", "coingecko_id": "band-protocol", + "nomics_id": "BAND", "nodes": [ "https://rpc.ftm.tools/" ], @@ -842,6 +852,7 @@ "name": "Band Protocol", "coinpaprika_id": "band-band-protocol", "coingecko_id": "band-protocol", + "nomics_id": "BAND", "nodes": [ "https://polygon-rpc.com" ], @@ -937,6 +948,7 @@ "forex_id": "IDR", "coinpaprika_id": "bidr-binanceidr", "coingecko_id": "binanceidr", + "nomics_id": "BIDR", "nodes": [ "http://bsc1.cipig.net:8655", "http://bsc2.cipig.net:8655", @@ -1042,6 +1054,7 @@ "name": "Binance Coin", "coinpaprika_id": "bnb-binance-coin", "coingecko_id": "binancecoin", + "nomics_id": "BNB", "nodes": [ "http://bsc1.cipig.net:8655", "http://bsc2.cipig.net:8655", @@ -1075,6 +1088,7 @@ "name": "Bancor", "coinpaprika_id": "bnt-bancor", "coingecko_id": "bancor", + "nomics_id": "BNT", "nodes": [ "http://bsc1.cipig.net:8655", "http://bsc2.cipig.net:8655", @@ -1092,6 +1106,7 @@ "name": "Bancor", "coinpaprika_id": "bnt-bancor", "coingecko_id": "bancor", + "nomics_id": "BNT", "nodes": [ "http://eth1.cipig.net:8555", "http://eth2.cipig.net:8555", @@ -1109,6 +1124,7 @@ "name": "Bancor", "coinpaprika_id": "bnt-bancor", "coingecko_id": "bancor", + "nomics_id": "BNT", "nodes": [ "https://polygon-rpc.com" ], @@ -1143,6 +1159,7 @@ "forex_id": "BRL", "coinpaprika_id": "brz-brazilian-digital-token", "coingecko_id": "brz", + "nomics_id": "BRZ", "nodes": [ "http://bsc1.cipig.net:8655", "http://bsc2.cipig.net:8655", @@ -1161,6 +1178,7 @@ "forex_id": "BRL", "coinpaprika_id": "brz-brazilian-digital-token", "coingecko_id": "brz", + "nomics_id": "BRZ", "nodes": [ "http://eth1.cipig.net:8555", "http://eth2.cipig.net:8555", @@ -1458,6 +1476,7 @@ "name": "Binance USD", "coinpaprika_id": "busd-binance-usd", "coingecko_id": "binance-usd", + "nomics_id": "BUSD", "nodes": [ "https://api.avax.network/ext/bc/C/rpc" ], @@ -1473,6 +1492,7 @@ "name": "Binance USD", "coinpaprika_id": "busd-binance-usd", "coingecko_id": "binance-usd", + "nomics_id": "BUSD", "nodes": [ "https://rpc.api.moonriver.moonbeam.network" ], @@ -1488,6 +1508,7 @@ "name": "Binance USD", "coinpaprika_id": "busd-binance-usd", "coingecko_id": "binance-usd", + "nomics_id": "BUSD", "nodes": [ "http://eth1.cipig.net:8555", "http://eth2.cipig.net:8555", @@ -1505,6 +1526,7 @@ "name": "Binance USD", "coinpaprika_id": "busd-binance-usd", "coingecko_id": "binance-usd", + "nomics_id": "BUSD", "nodes": [ "http://bsc1.cipig.net:8655", "http://bsc2.cipig.net:8655", @@ -1522,6 +1544,7 @@ "name": "Binance USD", "coinpaprika_id": "busd-binance-usd", "coingecko_id": "binance-usd", + "nomics_id": "BUSD", "nodes": [ "https://api.harmony.one", "https://api.s0.t.hmny.io" @@ -1538,6 +1561,7 @@ "name": "Binance USD", "coinpaprika_id": "busd-binance-usd", "coingecko_id": "binance-usd", + "nomics_id": "BUSD", "nodes": [ "https://polygon-rpc.com" ], @@ -1613,6 +1637,7 @@ "name": "PancakeSwap", "coinpaprika_id": "cake-pancakeswap", "coingecko_id": "pancakeswap-token", + "nomics_id": "CAKE", "nodes": [ "http://bsc1.cipig.net:8655", "http://bsc2.cipig.net:8655", @@ -1924,6 +1949,7 @@ "name": "Dai", "coinpaprika_id": "dai-dai", "coingecko_id": "dai", + "nomics_id": "DAI", "nodes": [ "https://api.avax.network/ext/bc/C/rpc" ], @@ -1939,6 +1965,7 @@ "name": "Dai", "coinpaprika_id": "dai-dai", "coingecko_id": "dai", + "nomics_id": "DAI", "nodes": [ "https://rpc.ftm.tools/" ], @@ -1954,6 +1981,7 @@ "name": "Dai", "coinpaprika_id": "dai-dai", "coingecko_id": "dai", + "nomics_id": "DAI", "nodes": [ "https://http-mainnet.hecochain.com" ], @@ -1969,6 +1997,7 @@ "name": "Dai", "coinpaprika_id": "dai-dai", "coingecko_id": "dai", + "nomics_id": "DAI", "nodes": [ "https://api.harmony.one", "https://api.s0.t.hmny.io" @@ -1985,6 +2014,7 @@ "name": "Dai", "coinpaprika_id": "dai-dai", "coingecko_id": "dai", + "nomics_id": "DAI", "nodes": [ "http://bsc1.cipig.net:8655", "http://bsc2.cipig.net:8655", @@ -2002,6 +2032,7 @@ "name": "Dai", "coinpaprika_id": "dai-dai", "coingecko_id": "dai", + "nomics_id": "DAI", "nodes": [ "http://eth1.cipig.net:8555", "http://eth2.cipig.net:8555", @@ -2019,6 +2050,7 @@ "name": "Dai", "coinpaprika_id": "dai-dai", "coingecko_id": "dai", + "nomics_id": "DAI", "nodes": [ "https://rpc.api.moonriver.moonbeam.network" ], @@ -2034,6 +2066,7 @@ "name": "Dai", "coinpaprika_id": "dai-dai", "coingecko_id": "dai", + "nomics_id": "DAI", "nodes": [ "https://polygon-rpc.com" ], @@ -2304,6 +2337,7 @@ "name": "Dogecoin", "coinpaprika_id": "doge-dogecoin", "coingecko_id": "dogecoin", + "nomics_id": "DOGE", "electrum": [ { "url": "electrum1.cipig.net:10060", @@ -2325,50 +2359,12 @@ "active": false, "currently_enabled": false }, - "DOI": { - "coin": "DOI", - "name": "Doichain", - "coinpaprika_id": "doi-doicoin", - "coingecko_id": "doichain", - "nomics_id": "DOI", - "electrum": [ - { - "url": "itchy-jellyfish-89.doi.works:50002", - "protocol": "SSL", - "ws-url": "itchy-jellyfish-89.doi.works:50004" - }, - { - "url": "big-parrot-60.doi.works:50002", - "protocol": "SSL", - "ws-url": "big-parrot-60.doi.works:50004" - }, - { - "url": "ugly-bird-70.doi.works:50002", - "protocol": "SSL", - "ws-url": "ugly-bird-70.doi.works:50004" - }, - { - "url":"pink-deer-69.doi.works:50002", - "protocol": "SSL", - "ws-url": "pink-deer-69.doi.works:50004" - }, - { - "url":"pink-deer-69.doi.works:50001", - "protocol": "TCP" - } - ], - "explorer_url": [ - "https://explorer.doichain.org/" - ], - "type": "UTXO", - "active": false, - "currently_enabled": false - }, "DOGE-BEP20": { "coin": "DOGE-BEP20", "name": "Dogecoin", "coinpaprika_id": "doge-dogecoin", "coingecko_id": "dogecoin", + "nomics_id": "DOGE", "nodes": [ "http://bsc1.cipig.net:8655", "http://bsc2.cipig.net:8655", @@ -2384,9 +2380,9 @@ "DOGEDASH-BEP20": { "coin": "DOGEDASH-BEP20", "name": "Doge Dash", - "nomics_id": "DOGEDASH", "coinpaprika_id": "dogedash-doge-dash", "coingecko_id": "doge-dash", + "nomics_id": "DOGEDASH", "nodes": [ "http://bsc1.cipig.net:8655", "http://bsc2.cipig.net:8655", @@ -2402,9 +2398,9 @@ "DOGGY-BEP20": { "coin": "DOGGY-BEP20", "name": "Doggy", - "nomics_id": "DOGGY", "coinpaprika_id": "doggy-doggy", "coingecko_id": "doggy", + "nomics_id": "DOGGY", "nodes": [ "http://bsc1.cipig.net:8655", "http://bsc2.cipig.net:8655", @@ -2417,11 +2413,51 @@ "active": false, "currently_enabled": false }, + "DOI": { + "coin": "DOI", + "name": "Doichain", + "coinpaprika_id": "doi-doicoin", + "coingecko_id": "doichain", + "nomics_id": "DOI", + "electrum": [ + { + "url": "itchy-jellyfish-89.doi.works:50002", + "protocol": "SSL", + "ws-url": "itchy-jellyfish-89.doi.works:50004" + }, + { + "url": "big-parrot-60.doi.works:50002", + "protocol": "SSL", + "ws-url": "big-parrot-60.doi.works:50004" + }, + { + "url": "ugly-bird-70.doi.works:50002", + "protocol": "SSL", + "ws-url": "ugly-bird-70.doi.works:50004" + }, + { + "url":"pink-deer-69.doi.works:50002", + "protocol": "SSL", + "ws-url": "pink-deer-69.doi.works:50004" + }, + { + "url":"pink-deer-69.doi.works:50001", + "protocol": "TCP" + } + ], + "explorer_url": [ + "https://explorer.doichain.org/" + ], + "type": "UTXO", + "active": false, + "currently_enabled": false + }, "DOT-BEP20": { "coin": "DOT-BEP20", "name": "Polkadot", "coinpaprika_id": "dot-polkadot", "coingecko_id": "polkadot", + "nomics_id": "DOT", "nodes": [ "http://bsc1.cipig.net:8655", "http://bsc2.cipig.net:8655", @@ -2439,6 +2475,7 @@ "name": "Polkadot", "coinpaprika_id": "dot-polkadot", "coingecko_id": "polkadot", + "nomics_id": "DOT", "nodes": [ "https://http-mainnet.hecochain.com" ], @@ -2546,6 +2583,7 @@ "name": "Elrond", "coinpaprika_id": "egld-elrond", "coingecko_id": "elrond-erd-2", + "nomics_id": "EGLD", "nodes": [ "http://bsc1.cipig.net:8655", "http://bsc2.cipig.net:8655", @@ -2581,6 +2619,7 @@ "name": "aelf", "coinpaprika_id": "elf-aelf", "coingecko_id": "aelf", + "nomics_id": "ELF", "nodes": [ "http://bsc1.cipig.net:8655", "http://bsc2.cipig.net:8655", @@ -2598,6 +2637,7 @@ "name": "aelf", "coinpaprika_id": "elf-aelf", "coingecko_id": "aelf", + "nomics_id": "ELF", "nodes": [ "http://eth1.cipig.net:8555", "http://eth2.cipig.net:8555", @@ -2644,6 +2684,7 @@ "name": "EOS", "coinpaprika_id": "eos-eos", "coingecko_id": "eos", + "nomics_id": "EOS", "nodes": [ "http://bsc1.cipig.net:8655", "http://bsc2.cipig.net:8655", @@ -2661,6 +2702,7 @@ "name": "Ethereum Classic", "coinpaprika_id": "etc-ethereum-classic", "coingecko_id": "ethereum-classic", + "nomics_id": "ETC", "nodes": [ "https://www.ethercluster.com/etc" ], @@ -2676,6 +2718,7 @@ "name": "Ethereum Classic", "coinpaprika_id": "etc-ethereum-classic", "coingecko_id": "ethereum-classic", + "nomics_id": "ETC", "nodes": [ "http://bsc1.cipig.net:8655", "http://bsc2.cipig.net:8655", @@ -2693,6 +2736,7 @@ "name": "Fetch.ai", "coinpaprika_id": "fetch-ai", "coingecko_id": "fetch-ai", + "nomics_id": "FET", "nodes": [ "http://eth1.cipig.net:8555", "http://eth2.cipig.net:8555", @@ -2710,6 +2754,7 @@ "name": "Fetch.ai", "coinpaprika_id": "fetch-ai", "coingecko_id": "fetch-ai", + "nomics_id": "FET", "nodes": [ "http://bsc1.cipig.net:8655", "http://bsc2.cipig.net:8655", @@ -2727,6 +2772,7 @@ "name": "Fetch.ai", "coinpaprika_id": "fetch-ai", "coingecko_id": "fetch-ai", + "nomics_id": "FET", "nodes": [ "https://polygon-rpc.com" ], @@ -2742,6 +2788,7 @@ "name": "Filecoin", "coinpaprika_id": "fil-filecoin", "coingecko_id": "filecoin", + "nomics_id": "FIL", "nodes": [ "http://bsc1.cipig.net:8655", "http://bsc2.cipig.net:8655", @@ -2759,6 +2806,7 @@ "name": "Filecoin", "coinpaprika_id": "fil-filecoin", "coingecko_id": "filecoin", + "nomics_id": "FIL", "nodes": [ "https://http-mainnet.hecochain.com" ], @@ -2772,9 +2820,9 @@ "FLOKI-BEP20": { "coin": "FLOKI-BEP20", "name": "Floki Inu", - "nomics_id": "FLOKI15", "coinpaprika_id": "floki-floki-inu", "coingecko_id": "floki-inu", + "nomics_id": "FLOKI15", "nodes": [ "http://bsc1.cipig.net:8655", "http://bsc2.cipig.net:8655", @@ -3035,6 +3083,7 @@ "name": "Fantom", "coinpaprika_id": "ftm-fantom", "coingecko_id": "fantom", + "nomics_id": "FTM", "nodes": [ "https://rpc.ftm.tools/" ], @@ -3050,6 +3099,7 @@ "name": "Fantom", "coinpaprika_id": "ftm-fantom", "coingecko_id": "fantom", + "nomics_id": "FTM", "nodes": [ "http://bsc1.cipig.net:8655", "http://bsc2.cipig.net:8655", @@ -3067,6 +3117,7 @@ "name": "Fantom", "coinpaprika_id": "ftm-fantom", "coingecko_id": "fantom", + "nomics_id": "FTM", "nodes": [ "http://eth1.cipig.net:8555", "http://eth2.cipig.net:8555", @@ -3345,6 +3396,7 @@ "name": "Injective Protocol", "coinpaprika_id": "inj-injective-protocol", "coingecko_id": "injective-protocol", + "nomics_id": "INJ", "nodes": [ "http://bsc1.cipig.net:8655", "http://bsc2.cipig.net:8655", @@ -3362,6 +3414,7 @@ "name": "Injective Protocol", "coinpaprika_id": "inj-injective-protocol", "coingecko_id": "injective-protocol", + "nomics_id": "INJ", "nodes": [ "http://eth1.cipig.net:8555", "http://eth2.cipig.net:8555", @@ -3379,6 +3432,7 @@ "name": "IOTA", "coinpaprika_id": "miota-iota", "coingecko_id": "iota", + "nomics_id": "IOT", "nodes": [ "http://bsc1.cipig.net:8655", "http://bsc2.cipig.net:8655", @@ -3396,6 +3450,7 @@ "name": "IoTeX", "coinpaprika_id": "iotx-iotex", "coingecko_id": "iotex", + "nomics_id": "IOTX", "nodes": [ "http://bsc1.cipig.net:8655", "http://bsc2.cipig.net:8655", @@ -3413,6 +3468,7 @@ "name": "IoTeX", "coinpaprika_id": "iotx-iotex", "coingecko_id": "iotex", + "nomics_id": "IOTX", "nodes": [ "https://polygon-rpc.com" ], @@ -3429,6 +3485,7 @@ "forex_id": "CHF", "coinpaprika_id": "test-coin", "coingecko_id": "jarvis-synthetic-swiss-franc", + "nomics_id": "JCHF", "nodes": [ "http://eth1.cipig.net:8555", "http://eth2.cipig.net:8555", @@ -3447,6 +3504,7 @@ "forex_id": "CHF", "coinpaprika_id": "test-coin", "coingecko_id": "jarvis-synthetic-swiss-franc", + "nomics_id": "JCHF", "nodes": [ "https://polygon-rpc.com" ], @@ -3463,6 +3521,7 @@ "forex_id": "EUR", "coinpaprika_id": "test-coin", "coingecko_id": "jarvis-synthetic-euro", + "nomics_id": "JEUR", "nodes": [ "http://eth1.cipig.net:8555", "http://eth2.cipig.net:8555", @@ -3481,6 +3540,7 @@ "forex_id": "EUR", "coinpaprika_id": "test-coin", "coingecko_id": "jarvis-synthetic-euro", + "nomics_id": "JEUR", "nodes": [ "https://polygon-rpc.com" ], @@ -3497,6 +3557,7 @@ "forex_id": "GBP", "coinpaprika_id": "test-coin", "coingecko_id": "jarvis-synthetic-british-pound", + "nomics_id": "JGBP", "nodes": [ "http://eth1.cipig.net:8555", "http://eth2.cipig.net:8555", @@ -3515,6 +3576,7 @@ "forex_id": "GBP", "coinpaprika_id": "test-coin", "coingecko_id": "jarvis-synthetic-british-pound", + "nomics_id": "JGBP", "nodes": [ "https://polygon-rpc.com" ], @@ -3531,6 +3593,7 @@ "forex_id": "JPY", "coinpaprika_id": "test-coin", "coingecko_id": "jpyc", + "nomics_id": "JPYC", "nodes": [ "http://eth1.cipig.net:8555", "http://eth2.cipig.net:8555", @@ -3549,6 +3612,7 @@ "forex_id": "JPY", "coinpaprika_id": "test-coin", "coingecko_id": "jpyc", + "nomics_id": "JPYC", "nodes": [ "https://polygon-rpc.com" ], @@ -3641,6 +3705,7 @@ "name": "Kyber Network", "coinpaprika_id": "knc-kyber-network", "coingecko_id": "kyber-network-crystal", + "nomics_id": "KNC3", "nodes": [ "http://bsc1.cipig.net:8655", "http://bsc2.cipig.net:8655", @@ -3658,6 +3723,7 @@ "name": "Kyber Network", "coinpaprika_id": "knc-kyber-network", "coingecko_id": "kyber-network-crystal", + "nomics_id": "KNC3", "nodes": [ "http://eth1.cipig.net:8555", "http://eth2.cipig.net:8555", @@ -4216,6 +4282,7 @@ "name": "NEAR Protocol", "coinpaprika_id": "near-near-protocol", "coingecko_id": "near", + "nomics_id": "NEAR", "nodes": [ "http://bsc1.cipig.net:8655", "http://bsc2.cipig.net:8655", @@ -4233,6 +4300,7 @@ "name": "Ocean Protocol", "coinpaprika_id": "ocean-ocean-protocol", "coingecko_id": "ocean-protocol", + "nomics_id": "OCEAN", "nodes": [ "http://bsc1.cipig.net:8655", "http://bsc2.cipig.net:8655", @@ -4250,6 +4318,7 @@ "name": "Ocean Protocol", "coinpaprika_id": "ocean-ocean-protocol", "coingecko_id": "ocean-protocol", + "nomics_id": "OCEAN", "nodes": [ "http://eth1.cipig.net:8555", "http://eth2.cipig.net:8555", @@ -4267,6 +4336,7 @@ "name": "Ocean Protocol", "coinpaprika_id": "ocean-ocean-protocol", "coingecko_id": "ocean-protocol", + "nomics_id": "OCEAN", "nodes": [ "https://polygon-rpc.com" ], @@ -4282,6 +4352,7 @@ "coin": "ONE", "coingecko_id": "harmony", "coinpaprika_id": "one-harmony", + "nomics_id": "HARMONY", "currently_enabled": false, "nodes": [ "https://api.harmony.one", @@ -4298,6 +4369,7 @@ "name": "Ontology", "coinpaprika_id": "ont-ontology", "coingecko_id": "ontology", + "nomics_id": "ONT", "nodes": [ "http://bsc1.cipig.net:8655", "http://bsc2.cipig.net:8655", @@ -4315,6 +4387,7 @@ "name": "Paxos Standard", "coinpaprika_id": "pax-paxos-standard-token", "coingecko_id": "paxos-standard", + "nomics_id": "PAX", "nodes": [ "http://bsc1.cipig.net:8655", "http://bsc2.cipig.net:8655", @@ -4332,6 +4405,7 @@ "name": "Paxos Standard", "coinpaprika_id": "pax-paxos-standard-token", "coingecko_id": "paxos-standard", + "nomics_id": "PAX", "nodes": [ "http://eth1.cipig.net:8555", "http://eth2.cipig.net:8555", @@ -4349,6 +4423,7 @@ "name": "Paxos Standard", "coinpaprika_id": "pax-paxos-standard-token", "coingecko_id": "paxos-standard", + "nomics_id": "PAX", "nodes": [ "https://rpc-mainnet.kcc.network" ], @@ -4364,6 +4439,7 @@ "name": "Paxos Standard", "coinpaprika_id": "pax-paxos-standard-token", "coingecko_id": "paxos-standard", + "nomics_id": "PAX", "nodes": [ "https://polygon-rpc.com" ], @@ -4379,6 +4455,7 @@ "name": "PAX Gold", "coinpaprika_id": "paxg-pax-gold", "coingecko_id": "pax-gold", + "nomics_id": "PAXG", "nodes": [ "http://bsc1.cipig.net:8655", "http://bsc2.cipig.net:8655", @@ -4396,6 +4473,7 @@ "name": "PAX Gold", "coinpaprika_id": "paxg-pax-gold", "coingecko_id": "pax-gold", + "nomics_id": "PAXG", "nodes": [ "http://eth1.cipig.net:8555", "http://eth2.cipig.net:8555", @@ -4414,6 +4492,7 @@ "name": "PAX Gold", "coinpaprika_id": "paxg-pax-gold", "coingecko_id": "pax-gold", + "nomics_id": "PAXG", "nodes": [ "https://polygon-rpc.com" ], @@ -4731,6 +4810,7 @@ "name": "USD Coin", "coinpaprika_id": "usdc-usd-coin", "coingecko_id": "usd-coin", + "nomics_id": "USDC", "nodes": [ "https://api.avax.network/ext/bc/C/rpc" ], @@ -4746,6 +4826,7 @@ "name": "USD Coin", "coinpaprika_id": "usdc-usd-coin", "coingecko_id": "usd-coin", + "nomics_id": "USDC", "nodes": [ "https://rpc.api.moonriver.moonbeam.network" ], @@ -4761,6 +4842,7 @@ "name": "USD Coin", "coinpaprika_id": "usdc-usd-coin", "coingecko_id": "usd-coin", + "nomics_id": "USDC", "nodes": [ "https://rpc.ftm.tools/" ], @@ -4776,6 +4858,7 @@ "name": "USD Coin", "coinpaprika_id": "usdc-usd-coin", "coingecko_id": "usd-coin", + "nomics_id": "USDC", "nodes": [ "http://bsc1.cipig.net:8655", "http://bsc2.cipig.net:8655", @@ -4793,6 +4876,7 @@ "name": "USD Coin", "coinpaprika_id": "usdc-usd-coin", "coingecko_id": "usd-coin", + "nomics_id": "USDC", "nodes": [ "http://eth1.cipig.net:8555", "http://eth2.cipig.net:8555", @@ -4810,6 +4894,7 @@ "name": "USD Coin", "coinpaprika_id": "usdc-usd-coin", "coingecko_id": "usd-coin", + "nomics_id": "USDC", "nodes": [ "https://rpc-mainnet.kcc.network" ], @@ -4825,6 +4910,7 @@ "name": "USD Coin", "coinpaprika_id": "usdc-usd-coin", "coingecko_id": "usd-coin", + "nomics_id": "USDC", "nodes": [ "https://http-mainnet.hecochain.com" ], @@ -4840,6 +4926,7 @@ "name": "USD Coin", "coinpaprika_id": "usdc-usd-coin", "coingecko_id": "usd-coin", + "nomics_id": "USDC", "nodes": [ "https://api.harmony.one", "https://api.s0.t.hmny.io" @@ -4856,6 +4943,7 @@ "name": "USD Coin", "coinpaprika_id": "usdc-usd-coin", "coingecko_id": "usd-coin", + "nomics_id": "USDC", "nodes": [ "https://polygon-rpc.com" ], @@ -4896,6 +4984,7 @@ "name": "Tether", "coinpaprika_id": "usdt-tether", "coingecko_id": "tether", + "nomics_id": "USDT", "nodes": [ "https://rpc.api.moonriver.moonbeam.network" ], @@ -4911,6 +5000,7 @@ "name": "Tether", "coinpaprika_id": "usdt-tether", "coingecko_id": "tether", + "nomics_id": "USDT", "nodes": [ "https://http-mainnet.hecochain.com" ], @@ -4926,6 +5016,7 @@ "name": "Tether", "coinpaprika_id": "usdt-tether", "coingecko_id": "tether", + "nomics_id": "USDT", "nodes": [ "https://rpc.ftm.tools/" ], @@ -4941,6 +5032,7 @@ "name": "Tether", "coinpaprika_id": "usdt-tether", "coingecko_id": "tether", + "nomics_id": "USDT", "nodes": [ "https://rpc-mainnet.kcc.network" ], @@ -4957,6 +5049,7 @@ "wallet_only": true, "coinpaprika_id": "usdt-tether", "coingecko_id": "tether", + "nomics_id": "USDT", "nodes": [ "https://arb1.arbitrum.io/rpc" ], @@ -4972,6 +5065,7 @@ "name": "Tether", "coinpaprika_id": "usdt-tether", "coingecko_id": "tether", + "nomics_id": "USDT", "nodes": [ "https://api.avax.network/ext/bc/C/rpc" ], @@ -4987,6 +5081,7 @@ "name": "Tether", "coinpaprika_id": "usdt-tether", "coingecko_id": "tether", + "nomics_id": "USDT", "nodes": [ "https://polygon-rpc.com" ], @@ -5002,6 +5097,7 @@ "name": "Tether", "coinpaprika_id": "usdt-tether", "coingecko_id": "tether", + "nomics_id": "USDT", "nodes": [ "http://bsc1.cipig.net:8655", "http://bsc2.cipig.net:8655", @@ -5019,6 +5115,7 @@ "name": "Tether", "coinpaprika_id": "usdt-tether", "coingecko_id": "tether", + "nomics_id": "USDT", "nodes": [ "http://eth1.cipig.net:8555", "http://eth2.cipig.net:8555", @@ -5037,6 +5134,7 @@ "name": "Tether", "coinpaprika_id": "usdt-tether", "coingecko_id": "tether", + "nomics_id": "USDT", "nodes": [ "https://api.harmony.one", "https://api.s0.t.hmny.io" @@ -5907,6 +6005,7 @@ "name": "Swipe", "coinpaprika_id": "sxp-swipe", "coingecko_id": "swipe", + "nomics_id": "SXP", "nodes": [ "http://bsc1.cipig.net:8655", "http://bsc2.cipig.net:8655", @@ -5924,6 +6023,7 @@ "name": "Swipe", "coinpaprika_id": "sxp-swipe", "coingecko_id": "swipe", + "nomics_id": "SXP", "nodes": [ "http://eth1.cipig.net:8555", "http://eth2.cipig.net:8555", @@ -6777,6 +6877,7 @@ "name": "Ren", "coinpaprika_id": "ren-republic-protocol", "coingecko_id": "republic-protocol", + "nomics_id": "REN", "nodes": [ "http://eth1.cipig.net:8555", "http://eth2.cipig.net:8555", @@ -6794,6 +6895,7 @@ "name": "Ren", "coinpaprika_id": "ren-republic-protocol", "coingecko_id": "republic-protocol", + "nomics_id": "REN", "nodes": [ "https://api.harmony.one", "https://api.s0.t.hmny.io" @@ -6810,6 +6912,7 @@ "name": "Ren", "coinpaprika_id": "ren-republic-protocol", "coingecko_id": "republic-protocol", + "nomics_id": "REN", "nodes": [ "https://http-mainnet.hecochain.com" ], @@ -7249,6 +7352,7 @@ "name": "TRON", "coinpaprika_id": "trx-tron", "coingecko_id": "tron", + "nomics_id": "TRX", "nodes": [ "http://bsc1.cipig.net:8655", "http://bsc2.cipig.net:8655", @@ -7267,6 +7371,7 @@ "forex_id": "TRY", "coinpaprika_id": "tryb-bilira", "coingecko_id": "bilira", + "nomics_id": "TRYB", "nodes": [ "https://api.avax.network/ext/bc/C/rpc" ], @@ -7283,6 +7388,7 @@ "forex_id": "TRY", "coinpaprika_id": "tryb-bilira", "coingecko_id": "bilira", + "nomics_id": "TRYB", "nodes": [ "http://bsc1.cipig.net:8655", "http://bsc2.cipig.net:8655", @@ -7301,6 +7407,7 @@ "forex_id": "TRY", "coinpaprika_id": "tryb-bilira", "coingecko_id": "bilira", + "nomics_id": "TRYB", "nodes": [ "https://polygon-rpc.com" ], @@ -7317,6 +7424,7 @@ "forex_id": "TRY", "coinpaprika_id": "tryb-bilira", "coingecko_id": "bilira", + "nomics_id": "TRYB", "nodes": [ "http://eth1.cipig.net:8555", "http://eth2.cipig.net:8555", @@ -7334,6 +7442,7 @@ "name": "TrueUSD", "coinpaprika_id": "tusd-trueusd", "coingecko_id": "true-usd", + "nomics_id": "TUSD", "nodes": [ "http://bsc1.cipig.net:8655", "http://bsc2.cipig.net:8655", @@ -7351,6 +7460,7 @@ "name": "TrueUSD", "coinpaprika_id": "tusd-trueusd", "coingecko_id": "true-usd", + "nomics_id": "TUSD", "nodes": [ "http://eth1.cipig.net:8555", "http://eth2.cipig.net:8555", @@ -7368,6 +7478,7 @@ "name": "TrueUSD", "coinpaprika_id": "tusd-trueusd", "coingecko_id": "true-usd", + "nomics_id": "TUSD", "nodes": [ "https://http-mainnet.hecochain.com" ], @@ -7383,6 +7494,7 @@ "name": "TrueUSD", "coinpaprika_id": "tusd-trueusd", "coingecko_id": "true-usd", + "nomics_id": "TUSD", "nodes": [ "https://rpc-mainnet.kcc.network" ], @@ -7398,6 +7510,7 @@ "name": "TrueUSD", "coinpaprika_id": "tusd-trueusd", "coingecko_id": "true-usd", + "nomics_id": "TUSD", "nodes": [ "https://polygon-rpc.com" ], @@ -7799,6 +7912,7 @@ "name": "XRP", "coinpaprika_id": "xrp-xrp", "coingecko_id": "ripple", + "nomics_id": "XRP", "nodes": [ "http://bsc1.cipig.net:8655", "http://bsc2.cipig.net:8655", @@ -7841,6 +7955,7 @@ "forex_id": "SGD", "coinpaprika_id": "xsgd-xsgd", "coingecko_id": "xsgd", + "nomics_id": "XSGD", "nodes": [ "http://eth1.cipig.net:8555", "http://eth2.cipig.net:8555", @@ -7859,6 +7974,7 @@ "forex_id": "SGD", "coinpaprika_id": "xsgd-xsgd", "coingecko_id": "xsgd", + "nomics_id": "XSGD", "nodes": [ "https://polygon-rpc.com" ], @@ -7874,6 +7990,7 @@ "name": "Tezos", "coinpaprika_id": "xtz-tezos", "coingecko_id": "tezos", + "nomics_id": "XTZ", "nodes": [ "http://bsc1.cipig.net:8655", "http://bsc2.cipig.net:8655", @@ -7946,6 +8063,7 @@ "name": "Venus", "coinpaprika_id": "xvs-venus", "coingecko_id": "venus", + "nomics_id": "XVS", "nodes": [ "http://bsc1.cipig.net:8655", "http://bsc2.cipig.net:8655", @@ -8047,6 +8165,7 @@ "name": "DFI.Money", "coinpaprika_id": "yfii-dfimoney", "coingecko_id": "yfii-finance", + "nomics_id": "YFII", "nodes": [ "http://bsc1.cipig.net:8655", "http://bsc2.cipig.net:8655", @@ -8064,6 +8183,7 @@ "name": "DFI.Money", "coinpaprika_id": "yfii-dfimoney", "coingecko_id": "yfii-finance", + "nomics_id": "YFII", "nodes": [ "http://eth1.cipig.net:8555", "http://eth2.cipig.net:8555", @@ -8234,6 +8354,7 @@ "name": "0x", "coinpaprika_id": "zrx-0x", "coingecko_id": "0x", + "nomics_id": "ZRX", "nodes": [ "https://api.avax.network/ext/bc/C/rpc" ], @@ -8249,6 +8370,7 @@ "name": "0x", "coinpaprika_id": "zrx-0x", "coingecko_id": "0x", + "nomics_id": "ZRX", "nodes": [ "http://eth1.cipig.net:8555", "http://eth2.cipig.net:8555", @@ -8266,6 +8388,7 @@ "name": "0x", "coinpaprika_id": "zrx-0x", "coingecko_id": "0x", + "nomics_id": "ZRX", "nodes": [ "https://polygon-rpc.com" ], @@ -8914,6 +9037,7 @@ "forex_id": "EUR", "coinpaprika_id": "eurs-stasis-eurs", "coingecko_id": "stasis-eurs", + "nomics_id": "EURS", "nodes": [ "http://eth1.cipig.net:8555", "http://eth2.cipig.net:8555", @@ -8932,6 +9056,7 @@ "forex_id": "EUR", "coinpaprika_id": "eurs-stasis-eurs", "coingecko_id": "stasis-eurs", + "nomics_id": "EURS", "nodes": [ "https://polygon-rpc.com" ], @@ -9083,6 +9208,7 @@ "name": "HUSD", "coinpaprika_id": "husd-husd", "coingecko_id": "husd", + "nomics_id": "HUSD", "nodes": [ "http://eth1.cipig.net:8555", "http://eth2.cipig.net:8555", @@ -9100,6 +9226,7 @@ "name": "HUSD", "coinpaprika_id": "husd-husd", "coingecko_id": "husd", + "nomics_id": "HUSD", "nodes": [ "https://http-mainnet.hecochain.com" ], @@ -9115,6 +9242,7 @@ "name": "HUSD", "coinpaprika_id": "husd-husd", "coingecko_id": "husd", + "nomics_id": "HUSD", "nodes": [ "https://rpc-mainnet.kcc.network" ], @@ -9130,6 +9258,7 @@ "name": "HUSD", "coinpaprika_id": "husd-husd", "coingecko_id": "husd", + "nomics_id": "HUSD", "nodes": [ "https://polygon-rpc.com" ], @@ -9810,6 +9939,7 @@ "name": "Uniswap", "coinpaprika_id": "uni-uniswap", "coingecko_id": "uniswap", + "nomics_id": "UNI", "nodes": [ "https://api.avax.network/ext/bc/C/rpc" ], @@ -9825,6 +9955,7 @@ "name": "Uniswap", "coinpaprika_id": "uni-uniswap", "coingecko_id": "uniswap", + "nomics_id": "UNI", "nodes": [ "http://bsc1.cipig.net:8655", "http://bsc2.cipig.net:8655", @@ -9842,6 +9973,7 @@ "name": "Uniswap", "coinpaprika_id": "uni-uniswap", "coingecko_id": "uniswap", + "nomics_id": "UNI", "nodes": [ "http://eth1.cipig.net:8555", "http://eth2.cipig.net:8555", @@ -9859,6 +9991,7 @@ "name": "Uniswap", "coinpaprika_id": "uni-uniswap", "coingecko_id": "uniswap", + "nomics_id": "UNI", "nodes": [ "https://http-mainnet.hecochain.com" ], @@ -9874,6 +10007,7 @@ "name": "Uniswap", "coinpaprika_id": "uni-uniswap", "coingecko_id": "uniswap", + "nomics_id": "UNI", "nodes": [ "https://rpc-mainnet.kcc.network" ], @@ -9889,6 +10023,7 @@ "name": "Uniswap", "coinpaprika_id": "uni-uniswap", "coingecko_id": "uniswap", + "nomics_id": "UNI", "nodes": [ "https://polygon-rpc.com" ], @@ -10083,9 +10218,9 @@ "ZINU-BEP20": { "coin": "ZINU-BEP20", "name": "Zombie Inu", - "nomics_id": "ZINUBEP20", "coinpaprika_id": "zombie-inu", "coingecko_id": "zinu-zombie-inu", + "nomics_id": "ZINUBEP20", "nodes": [ "http://bsc1.cipig.net:8655", "http://bsc2.cipig.net:8655", From 5d4dbc15a0611665f98a0c4ffb028514036dc445 Mon Sep 17 00:00:00 2001 From: syl Date: Mon, 13 Jun 2022 03:19:32 +0200 Subject: [PATCH 101/177] Addressbook: Update style and improve address creation --- .../Dex/Addressbook/AddAddressForm.qml | 110 +++++++++++++++--- .../Dex/Addressbook/AddressTypeSelector.qml | 24 ++-- .../Dex/Components/ComboBoxWithSearchBar.qml | 3 +- 3 files changed, 114 insertions(+), 23 deletions(-) diff --git a/atomic_defi_design/Dex/Addressbook/AddAddressForm.qml b/atomic_defi_design/Dex/Addressbook/AddAddressForm.qml index b61ab02956..98c946d896 100644 --- a/atomic_defi_design/Dex/Addressbook/AddAddressForm.qml +++ b/atomic_defi_design/Dex/Addressbook/AddAddressForm.qml @@ -21,16 +21,18 @@ Dex.Rectangle property string addressKey property string addressValue + property var availableNetworkStandards: ["QRC-20", "ERC-20", "BEP-20", "Smart Chain"] + // Return the asset type that will be used in the backend to validate the address function getTypeForAddressChecker(addressType) { switch (addressType) { - case "QRC-20": return "QTUM"; - case "BEP-20": return "BNB"; - case "ERC-20": return "ETH"; - case "Smart Chain": return "KMD"; - case "SLP": return "BCH"; + case "QRC-20": return "QTUM" + case "BEP-20": return "BNB" + case "ERC-20": return "ETH" + case "Smart Chain": return "KMD" + case "SLP": return "BCH" } let coinInfo = Dex.API.app.portfolio_pg.global_cfg_mdl.get_coin_info(addressType); @@ -39,6 +41,20 @@ Dex.Rectangle return addressType } + // Tells if the given address type represents a network standard address (e.g. BEP-20) + function isNetworkStandard(addressType) + { + switch (addressType) + { + case "QRC-20": return true + case "BEP-20": return true + case "ERC-20": return true + case "Smart Chain": return true + case "SLP": return true + } + return false + } + signal cancel() signal addressCreated() @@ -54,6 +70,7 @@ Dex.Rectangle addressTypeComboBox.currentIndex = 0 addressKeyField.text = "" addressValueField.text = "" + invalidAddressValueLabel.text = "" editionMode = false addressType = "" addressKey = "" @@ -62,11 +79,22 @@ Dex.Rectangle else if (editionMode) { // Feeds form with the data we are currently editing. - var indexLis = - Dex.API.app.portfolio_pg.portfolio_mdl.match( - Dex.API.app.portfolio_pg.portfolio_mdl.index(0, 0), - Qt.UserRole + 1, addressType) - //addres + + if (!isNetworkStandard(addressType)) + { + useStandardsCheckBox.checked = false + let addressTypeIndex = + Dex.API.app.portfolio_pg.global_cfg_mdl.all_proxy.match( + Dex.API.app.portfolio_pg.global_cfg_mdl.all_proxy.index(0, 0), + Qt.UserRole + 1, addressType, 1, Qt.MatchExactly)[0] + addressTypeComboBox.currentItem = addressTypeIndex + } + else + { + useStandardsCheckBox.checked = true + let addressTypeIndex = availableNetworkStandards.indexOf(addressType) + addressTypeComboBox.currentIndex = addressTypeIndex + } addressKeyField.text = addressKey addressValueField.text = addressValue } @@ -162,10 +190,17 @@ Dex.Rectangle text: isConvertMode ? qsTr("Convert") : editionMode ? qsTr("Edit") : qsTr("Add") onClicked: { - if (isConvertMode) - Dex.API.app.wallet_pg.convert_address(addressValueField.text, root.getTypeForAddressChecker(addressTypeComboBox.currentText), API.app.wallet_pg.validate_address_data.to_address_format); + let addressType = getTypeForAddressChecker(addressTypeComboBox.currentText) + + if (!Dex.API.app.portfolio_pg.global_cfg_mdl.get_coin_info(addressType).is_enabled) + { + enableAssetModal.assetTicker = addressType + enableAssetModal.open() + } + else if (isConvertMode) + Dex.API.app.wallet_pg.convert_address(addressValueField.text, addressType, API.app.wallet_pg.validate_address_data.to_address_format); else - Dex.API.app.wallet_pg.validate_address(addressValueField.text, root.getTypeForAddressChecker(addressTypeComboBox.currentText)) + Dex.API.app.wallet_pg.validate_address(addressValueField.text, addressType) } } } @@ -216,4 +251,53 @@ Dex.Rectangle } } } + + Dex.ModalLoader + { + id: enableAssetModal + + property string assetTicker + + onLoaded: item.assetTicker = assetTicker + + sourceComponent: Dex.MultipageModal + { + property string assetTicker + Dex.MultipageModalContent + { + Layout.fillWidth: true + titleText: qsTr("Enable " + assetTicker) + + Dex.Text + { + Layout.fillWidth: true + text: qsTr("You need to enable %1 before adding this kind of address.").arg(assetTicker) + } + + footer: + [ + // Enable button + Dex.Button + { + text: qsTr("Enable") + + onClicked: + { + Dex.API.app.enable_coin(assetTicker) + close() + } + }, + + // Cancel button + Dex.Button + { + Layout.rightMargin: 5 + text: qsTr("Cancel") + + onClicked: close() + } + ] + } + } + } } diff --git a/atomic_defi_design/Dex/Addressbook/AddressTypeSelector.qml b/atomic_defi_design/Dex/Addressbook/AddressTypeSelector.qml index 28cbea459b..9853cbbbe0 100644 --- a/atomic_defi_design/Dex/Addressbook/AddressTypeSelector.qml +++ b/atomic_defi_design/Dex/Addressbook/AddressTypeSelector.qml @@ -12,21 +12,26 @@ Dex.ComboBoxWithSearchBar { id: control - property var currentItem: Dex.API.app.portfolio_pg.portfolio_mdl.portfolio_proxy_mdl.get(currentIndex) + property var currentItem: Dex.API.app.portfolio_pg.global_cfg_mdl.all_proxy.index(currentIndex, 0) property bool showAssetStandards: false - property var assetStandards: ["QRC-20", "ERC-20", "BEP-20", "Smart Chain"] + property var assetStandards: availableNetworkStandards + property string searchPattern popupForceMaxHeight: true popupMaxHeight: 265 - model: showAssetStandards ? assetStandards : Dex.API.app.portfolio_pg.portfolio_mdl.portfolio_proxy_mdl + model: showAssetStandards ? assetStandards : Dex.API.app.portfolio_pg.global_cfg_mdl.all_proxy textRole: showAssetStandards ? "" : "ticker" + onCurrentIndexChanged: currentItem = Dex.API.app.portfolio_pg.global_cfg_mdl.all_proxy.index(currentIndex, 0) + delegate: ItemDelegate { id: _delegate + visible: model.ticker !== "All" + width: control.width - height: 40 + height: visible ? 40 : 0 highlighted: control.highlightedIndex === index contentItem: AssetRow @@ -50,12 +55,13 @@ Dex.ComboBoxWithSearchBar anchors.left: parent.left anchors.leftMargin: 13 anchors.verticalCenter: parent.verticalCenter - ticker: showAssetStandards ? assetStandards[currentIndex] : control.currentItem.ticker - name: showAssetStandards ? assetStandards[currentIndex] : control.currentItem.name - type: showAssetStandards ? assetStandards[currentIndex] : control.currentItem.type + ticker: showAssetStandards ? assetStandards[currentIndex] : Dex.API.app.portfolio_pg.global_cfg_mdl.all_proxy.data(control.currentItem, Qt.UserRole + 1) + name: showAssetStandards ? assetStandards[currentIndex] : Dex.API.app.portfolio_pg.global_cfg_mdl.all_proxy.data(control.currentItem, Qt.UserRole + 3) + type: showAssetStandards ? assetStandards[currentIndex] : Dex.API.app.portfolio_pg.global_cfg_mdl.all_proxy.data(control.currentItem, Qt.UserRole + 9) } } - onSearchBarTextChanged: Dex.API.app.portfolio_pg.portfolio_mdl.portfolio_proxy_mdl.setFilterFixedString(patternStr) - Component.onDestruction: Dex.API.app.portfolio_pg.portfolio_mdl.portfolio_proxy_mdl.setFilterFixedString("") + onSearchBarTextChanged: Dex.API.app.portfolio_pg.global_cfg_mdl.all_proxy.setFilterFixedString(patternStr) + Component.onDestruction: Dex.API.app.portfolio_pg.global_cfg_mdl.all_proxy.setFilterFixedString("") + onVisibleChanged: if (!visible) Dex.API.app.portfolio_pg.global_cfg_mdl.all_proxy.setFilterFixedString("") } diff --git a/atomic_defi_design/Dex/Components/ComboBoxWithSearchBar.qml b/atomic_defi_design/Dex/Components/ComboBoxWithSearchBar.qml index d0dbb7152b..cc66c387f8 100644 --- a/atomic_defi_design/Dex/Components/ComboBoxWithSearchBar.qml +++ b/atomic_defi_design/Dex/Components/ComboBoxWithSearchBar.qml @@ -12,6 +12,7 @@ ComboBox id: control property int radius: 20 + property int popupWidth: width property int popupMaxHeight: 450 property bool popupForceMaxHeight: false property color backgroundColor: Dex.CurrentTheme.comboBoxBackgroundColor @@ -33,7 +34,7 @@ ComboBox popup: Popup { id: popup - width: control.width + width: control.popupWidth height: popupForceMaxHeight ? control.popupMaxHeight : Math.min(contentItem.implicitHeight, control.popupMaxHeight) leftPadding: 0 rightPadding: 0 From 53be631a1d6419d2f8ca18047b1ca77dde0366c1 Mon Sep 17 00:00:00 2001 From: syl Date: Mon, 13 Jun 2022 07:36:50 +0200 Subject: [PATCH 102/177] Fix qml warnings --- atomic_defi_design/Dex/Wallet/SendModal.qml | 1 - .../Dex/Wallet/SendModalContactList.qml | 26 +++++++++---------- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/atomic_defi_design/Dex/Wallet/SendModal.qml b/atomic_defi_design/Dex/Wallet/SendModal.qml index 3590602027..68daa0d2ec 100644 --- a/atomic_defi_design/Dex/Wallet/SendModal.qml +++ b/atomic_defi_design/Dex/Wallet/SendModal.qml @@ -714,7 +714,6 @@ MultipageModal input_address.text = selected_address selected_address = "" - console.debug("SendModal: Selected %1 address from addressbook.".arg(input_address.text)) } } } diff --git a/atomic_defi_design/Dex/Wallet/SendModalContactList.qml b/atomic_defi_design/Dex/Wallet/SendModalContactList.qml index 20984b8dd2..9e9bbd58aa 100644 --- a/atomic_defi_design/Dex/Wallet/SendModalContactList.qml +++ b/atomic_defi_design/Dex/Wallet/SendModalContactList.qml @@ -18,6 +18,9 @@ MultipageModal property string ticker: api_wallet_page.ticker property var selected_address: "" + Component.onCompleted: API.app.addressbookPg.model.proxy.typeFilter = ticker + Component.onDestruction: API.app.addressbookPg.model.proxy.typeFilter = "" + MultipageModalContent { titleText: qsTr("Select a contact with an %1 address").arg(ticker) @@ -28,8 +31,8 @@ MultipageModal Layout.alignment: Qt.AlignHCenter Layout.fillWidth: true placeholderText: qsTr("Search for contacts...") - onTextChanged: API.app.addressbook_pg.model.proxy.search_exp = text - Component.onDestruction: API.app.addressbook_pg.model.proxy.search_exp = "" + onTextChanged: API.app.addressbookPg.model.proxy.searchExp = text + Component.onDestruction: API.app.addressbookPg.model.proxy.searchExp = "" } // Contact List @@ -39,7 +42,7 @@ MultipageModal Layout.fillWidth: true - model: API.app.addressbook_pg.model.proxy + model: API.app.addressbookPg.model.proxy delegate: DefaultRectangle { property int addressesCount @@ -51,10 +54,10 @@ MultipageModal Component.onCompleted: { - modelData.proxy_filter.filter_type = ticker - addressesCount = modelData.proxy_filter.rowCount() + modelData.proxyFilter.filterType = ticker + addressesCount = modelData.proxyFilter.rowCount() } - Component.onDestruction: contactModel.proxy_filter.filter_type = "" + Component.onDestruction: contactModel.proxyFilter.typeFilter = "" DefaultMouseArea { @@ -95,9 +98,6 @@ MultipageModal anchors.bottom: parent.bottom } } - - Component.onCompleted: API.app.addressbook_pg.model.proxy.type_filter = ticker - Component.onDestruction: API.app.addressbook_pg.model.proxy.type_filter = "" } footer: @@ -120,9 +120,9 @@ MultipageModal readonly property var defaultContactModel: { - "proxy_filter": + "proxyFilter": { - "filter_type": "" + "filterType": "" }, "name": "" } @@ -131,7 +131,7 @@ MultipageModal property int columnsMargin: 10 property int nameColumnWidth: width * 0.3 - titleText: qsTr("Choose an %1 address of %2").arg(contactModel.proxy_filter.filter_type).arg(contactModel.name) + titleText: qsTr("Choose an %1 address of %2").arg(contactModel.proxyFilter.filterType).arg(contactModel.name) RowLayout { @@ -160,7 +160,7 @@ MultipageModal Layout.fillWidth: true - model: addressesView.contactModel.proxy_filter + model: addressesView.contactModel.proxyFilter delegate: DefaultRectangle { width: addressListView.width From fc1731e5705e31615750ba955f5cf942338daa7f Mon Sep 17 00:00:00 2001 From: smk762 Date: Mon, 13 Jun 2022 13:47:56 +0800 Subject: [PATCH 103/177] move priceline --- .../Dex/Exchange/ProView/Chart.qml | 2 - .../Dex/Exchange/ProView/TradingInfo/Main.qml | 45 ++++++++++++------- 2 files changed, 28 insertions(+), 19 deletions(-) diff --git a/atomic_defi_design/Dex/Exchange/ProView/Chart.qml b/atomic_defi_design/Dex/Exchange/ProView/Chart.qml index fbc9fc7ee7..a6b8e3c9de 100644 --- a/atomic_defi_design/Dex/Exchange/ProView/Chart.qml +++ b/atomic_defi_design/Dex/Exchange/ProView/Chart.qml @@ -117,7 +117,6 @@ Item RowLayout { anchors.fill: parent - anchors.margins: 28 visible: !webEngineViewPlaceHolder.visible DefaultBusyIndicator @@ -148,7 +147,6 @@ Item { id: webEngineViewPlaceHolder anchors.fill: parent - anchors.margins: 28 visible: false Component.onCompleted: diff --git a/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/Main.qml b/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/Main.qml index f2983d0232..ff6b534041 100644 --- a/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/Main.qml +++ b/atomic_defi_design/Dex/Exchange/ProView/TradingInfo/Main.qml @@ -7,6 +7,7 @@ import Qaterial 1.0 as Qaterial import Dex.Themes 1.0 as Dex import "../../../Constants" import "../../../Components" +import "../../Trade" import "../../ProView" Widget @@ -19,22 +20,13 @@ Widget Qaterial.LatoTabBar { id: tabView - property int taux_exchange: 0 - property int order_idx: 1 - property int history_idx: 2 - property int pair_chart_idx: 3 + property int order_idx: 0 + property int history_idx: 1 + property int pair_chart_idx: 2 background: null Layout.leftMargin: 6 - Qaterial.LatoTabButton - { - text: qsTr("Exchange Rates") - font.pixelSize: 14 - textColor: checked ? Dex.CurrentTheme.foregroundColor : Dex.CurrentTheme.foregroundColor2 - indicatorColor: Dex.CurrentTheme.foregroundColor - textSecondaryColor: Dex.CurrentTheme.foregroundColor2 - } Qaterial.LatoTabButton { text: qsTr("Orders") @@ -80,8 +72,6 @@ Widget swipeView.currentItem.update(); } - PriceLine { } - OrdersPage { clip: true } OrdersPage @@ -90,10 +80,31 @@ Widget clip: true } - // Chart - Chart + ColumnLayout { - id: chart + // Chart + Chart + { + id: chart + Layout.topMargin: 10 + Layout.bottomMargin: 10 + Layout.leftMargin: 28 + Layout.rightMargin: 28 + Layout.fillWidth: true + Layout.preferredHeight: 310 + + } + + PriceLineSimplified + { + id: price_line2 + Layout.topMargin: 10 + Layout.bottomMargin: 10 + Layout.leftMargin: 28 + Layout.rightMargin: 28 + Layout.fillWidth: true + Layout.preferredHeight: 120 + } } } } From 6796c86e114135b945992417df3e7b966b1028cc Mon Sep 17 00:00:00 2001 From: syl Date: Tue, 14 Jun 2022 13:22:56 +0200 Subject: [PATCH 104/177] Addressbook: Fix wrong default selection when adding an address --- atomic_defi_design/Dex/Addressbook/AddAddressForm.qml | 1 - .../Dex/Addressbook/AddressTypeSelector.qml | 11 +++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/atomic_defi_design/Dex/Addressbook/AddAddressForm.qml b/atomic_defi_design/Dex/Addressbook/AddAddressForm.qml index 98c946d896..5ffc3c9f7d 100644 --- a/atomic_defi_design/Dex/Addressbook/AddAddressForm.qml +++ b/atomic_defi_design/Dex/Addressbook/AddAddressForm.qml @@ -67,7 +67,6 @@ Dex.Rectangle if (!visible) { // Resets data when address is added/edited. - addressTypeComboBox.currentIndex = 0 addressKeyField.text = "" addressValueField.text = "" invalidAddressValueLabel.text = "" diff --git a/atomic_defi_design/Dex/Addressbook/AddressTypeSelector.qml b/atomic_defi_design/Dex/Addressbook/AddressTypeSelector.qml index 9853cbbbe0..59560ffb57 100644 --- a/atomic_defi_design/Dex/Addressbook/AddressTypeSelector.qml +++ b/atomic_defi_design/Dex/Addressbook/AddressTypeSelector.qml @@ -15,15 +15,12 @@ Dex.ComboBoxWithSearchBar property var currentItem: Dex.API.app.portfolio_pg.global_cfg_mdl.all_proxy.index(currentIndex, 0) property bool showAssetStandards: false property var assetStandards: availableNetworkStandards - property string searchPattern popupForceMaxHeight: true popupMaxHeight: 265 model: showAssetStandards ? assetStandards : Dex.API.app.portfolio_pg.global_cfg_mdl.all_proxy textRole: showAssetStandards ? "" : "ticker" - onCurrentIndexChanged: currentItem = Dex.API.app.portfolio_pg.global_cfg_mdl.all_proxy.index(currentIndex, 0) - delegate: ItemDelegate { id: _delegate @@ -52,6 +49,8 @@ Dex.ComboBoxWithSearchBar { AssetRow { + id: _contentRow + anchors.left: parent.left anchors.leftMargin: 13 anchors.verticalCenter: parent.verticalCenter @@ -61,7 +60,11 @@ Dex.ComboBoxWithSearchBar } } + onShowAssetStandardsChanged: if (showAssetStandards) {currentIndex = 0; _contentRow.ticker = assetStandards[currentIndex]; _contentRow.name = assetStandards[currentIndex]; _contentRow.type = assetStandards[currentIndex]} + else {currentIndex = 1; _contentRow.ticker = Dex.API.app.portfolio_pg.global_cfg_mdl.all_proxy.data(control.currentItem, Qt.UserRole + 1); _contentRow.name = Dex.API.app.portfolio_pg.global_cfg_mdl.all_proxy.data(control.currentItem, Qt.UserRole + 3); _contentRow.type = Dex.API.app.portfolio_pg.global_cfg_mdl.all_proxy.data(control.currentItem, Qt.UserRole + 9)} + onCurrentIndexChanged: currentItem = Dex.API.app.portfolio_pg.global_cfg_mdl.all_proxy.index(currentIndex, 0) onSearchBarTextChanged: Dex.API.app.portfolio_pg.global_cfg_mdl.all_proxy.setFilterFixedString(patternStr) - Component.onDestruction: Dex.API.app.portfolio_pg.global_cfg_mdl.all_proxy.setFilterFixedString("") onVisibleChanged: if (!visible) Dex.API.app.portfolio_pg.global_cfg_mdl.all_proxy.setFilterFixedString("") + Component.onDestruction: Dex.API.app.portfolio_pg.global_cfg_mdl.all_proxy.setFilterFixedString("") + Component.onCompleted: if (showAssetStandards) currentIndex = 0; else currentIndex = 1 } From 4edecbee0935063db33fc666cea028632f4e567a Mon Sep 17 00:00:00 2001 From: syl Date: Tue, 14 Jun 2022 13:26:02 +0200 Subject: [PATCH 105/177] Addressbook: Increase width and height of remove popup --- atomic_defi_design/Dex/Addressbook/RemoveContactPopup.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/atomic_defi_design/Dex/Addressbook/RemoveContactPopup.qml b/atomic_defi_design/Dex/Addressbook/RemoveContactPopup.qml index 7ce8928135..419c5c64b4 100644 --- a/atomic_defi_design/Dex/Addressbook/RemoveContactPopup.qml +++ b/atomic_defi_design/Dex/Addressbook/RemoveContactPopup.qml @@ -12,8 +12,8 @@ Dex.Popup property string contactName - width: 120 - height: 100 + width: 140 + height: 120 contentItem: ColumnLayout { From bbff23d03e2f16388f34b1321a84c290079fc667 Mon Sep 17 00:00:00 2001 From: syl Date: Tue, 14 Jun 2022 13:33:14 +0200 Subject: [PATCH 106/177] Send Modal: Custom fees switch text was in wrong color --- atomic_defi_design/Dex/Components/DexSwitch.qml | 13 ++++++------- atomic_defi_design/Dex/Wallet/SendModal.qml | 8 +++++++- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/atomic_defi_design/Dex/Components/DexSwitch.qml b/atomic_defi_design/Dex/Components/DexSwitch.qml index d3c0779f82..9d194ca46b 100644 --- a/atomic_defi_design/Dex/Components/DexSwitch.qml +++ b/atomic_defi_design/Dex/Components/DexSwitch.qml @@ -21,7 +21,7 @@ Switch Universal.background: Dex.CurrentTheme.backgroundColor font.family: DexTypo.fontFamily - indicator: DexRectangle + indicator: DefaultRectangle { id: indicator anchors.verticalCenter: parent.verticalCenter @@ -55,11 +55,11 @@ Switch orientation: Gradient.Horizontal GradientStop { - position: 0;color: control.checked ? Dex.CurrentTheme.switchGradientStartColor : Dex.CurrentTheme.switchGradientStartColor2 + position: 0; color: control.checked ? Dex.CurrentTheme.switchGradientStartColor : Dex.CurrentTheme.switchGradientStartColor2 } GradientStop { - position: 0.9311;color: control.checked ? Dex.CurrentTheme.switchGradientEndColor : Dex.CurrentTheme.switchGradientEndColor2 + position: 0.9311; color: control.checked ? Dex.CurrentTheme.switchGradientEndColor : Dex.CurrentTheme.switchGradientEndColor2 } } } @@ -77,11 +77,11 @@ Switch orientation: Gradient.Horizontal GradientStop { - position: 0;color: control.checked ? Dex.CurrentTheme.switchGradientStartColor2 : Dex.CurrentTheme.switchGradientStartColor + position: 0; color: control.checked ? Dex.CurrentTheme.switchGradientStartColor2 : Dex.CurrentTheme.switchGradientStartColor } GradientStop { - position: 0.9311;color: control.checked ? Dex.CurrentTheme.switchGradientEndColor2 : Dex.CurrentTheme.switchGradientEndColor + position: 0.9311; color: control.checked ? Dex.CurrentTheme.switchGradientEndColor2 : Dex.CurrentTheme.switchGradientEndColor } } } @@ -93,5 +93,4 @@ Switch anchors.fill: parent acceptedButtons: Qt.NoButton } - -} \ No newline at end of file +} diff --git a/atomic_defi_design/Dex/Wallet/SendModal.qml b/atomic_defi_design/Dex/Wallet/SendModal.qml index 68daa0d2ec..3d339dcfce 100644 --- a/atomic_defi_design/Dex/Wallet/SendModal.qml +++ b/atomic_defi_design/Dex/Wallet/SendModal.qml @@ -568,8 +568,14 @@ MultipageModal id: custom_fees_switch enabled: !root.is_send_busy Layout.topMargin: 32 - text: qsTr("Enable Custom Fees") onCheckedChanged: input_custom_fees.text = "" + + DefaultText + { + anchors.left: parent.right + anchors.verticalCenter: parent.verticalCenter + text: qsTr("Enable custom fees") + } } // Custom fees warning From 2c74c72fd34754f81c447d69328d03fe18fbbf6e Mon Sep 17 00:00:00 2001 From: syl Date: Tue, 14 Jun 2022 13:42:20 +0200 Subject: [PATCH 107/177] Addressbook: Add asset search when sending to a standard network address --- .../Addressbook/AssetFromStandardSelector.qml | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/atomic_defi_design/Dex/Addressbook/AssetFromStandardSelector.qml b/atomic_defi_design/Dex/Addressbook/AssetFromStandardSelector.qml index 19f9f73bd4..c7416f1727 100644 --- a/atomic_defi_design/Dex/Addressbook/AssetFromStandardSelector.qml +++ b/atomic_defi_design/Dex/Addressbook/AssetFromStandardSelector.qml @@ -15,9 +15,39 @@ Dex.MultipageModal width: 560 + Component.onDestruction: + { + Dex.API.app.portfolio_pg.global_cfg_mdl.all_qrc20_proxy.setFilterFixedString("") + Dex.API.app.portfolio_pg.global_cfg_mdl.all_erc20_proxy.setFilterFixedString("") + Dex.API.app.portfolio_pg.global_cfg_mdl.all_bep20_proxy.setFilterFixedString("") + Dex.API.app.portfolio_pg.global_cfg_mdl.all_smartchains_proxy.setFilterFixedString("") + } + Dex.MultipageModalContent { titleText: qsTr("Choose a valid ") + standard + qsTr(" asset") + contentSpacing: 8 + + Dex.SearchField + { + Layout.fillWidth: true + Layout.preferredHeight: 30 + textField.placeholderText: qsTr("Search an asset") + textField.onTextChanged: + { + switch (standard) + { + case "QRC-20": Dex.API.app.portfolio_pg.global_cfg_mdl.all_qrc20_proxy.setFilterFixedString(textField.text) + break; + case "ERC-20": Dex.API.app.portfolio_pg.global_cfg_mdl.all_erc20_proxy.setFilterFixedString(textField.text) + break; + case "BEP-20": Dex.API.app.portfolio_pg.global_cfg_mdl.all_bep20_proxy.setFilterFixedString(textField.text) + break; + default: Dex.API.app.portfolio_pg.global_cfg_mdl.all_smartchains_proxy.setFilterFixedString(textField.text) + break; + } + } + } Dex.ListView { From dbc8463f2f7543965d9bda73ff9bbe665765f2a4 Mon Sep 17 00:00:00 2001 From: syl Date: Tue, 14 Jun 2022 14:07:29 +0200 Subject: [PATCH 108/177] Trading View: Show full ticker in total row of place order form --- .../Dex/Exchange/ProView/PlaceOrderForm/TotalView.qml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/atomic_defi_design/Dex/Exchange/ProView/PlaceOrderForm/TotalView.qml b/atomic_defi_design/Dex/Exchange/ProView/PlaceOrderForm/TotalView.qml index 2372aba493..81144b324b 100644 --- a/atomic_defi_design/Dex/Exchange/ProView/PlaceOrderForm/TotalView.qml +++ b/atomic_defi_design/Dex/Exchange/ProView/PlaceOrderForm/TotalView.qml @@ -21,6 +21,7 @@ ColumnLayout DefaultText { + Layout.fillWidth: true Layout.alignment: Qt.AlignLeft color: Dex.CurrentTheme.foregroundColor3 text: "Total " + API.app.settings_pg.current_fiat + " " + General.cex_icon @@ -54,11 +55,11 @@ ColumnLayout Layout.preferredWidth: parent.width Layout.preferredHeight: 30 - DexLabel + DefaultText { + Layout.fillWidth: true color: Dex.CurrentTheme.foregroundColor3 - Layout.preferredWidth: parent.width * 0.3 - text: "Total " + atomic_qt_utilities.retrieve_main_ticker(right_ticker) + text: "Total " + right_ticker font.pixelSize: 14 opacity: .6 font.weight: Font.Normal From 2fadccab1f4551818350af140e6c8c7d65c735ae Mon Sep 17 00:00:00 2001 From: smk762 Date: Tue, 14 Jun 2022 20:09:47 +0800 Subject: [PATCH 109/177] clean up --- atomic_defi_design/Dex/Exchange/ProView/Chart.qml | 7 +++++-- .../Dex/Exchange/ProView/TradingInfo/Main.qml | 12 ++++++------ atomic_defi_design/Dex/Exchange/Trade/ProView.qml | 5 ++--- atomic_defi_design/Dex/Exchange/Trade/Trade.qml | 2 +- .../Dex/Exchange/Trade/Trading/TradeViewHeader.qml | 4 ---- 5 files changed, 14 insertions(+), 16 deletions(-) diff --git a/atomic_defi_design/Dex/Exchange/ProView/Chart.qml b/atomic_defi_design/Dex/Exchange/ProView/Chart.qml index a6b8e3c9de..f7e5b88545 100644 --- a/atomic_defi_design/Dex/Exchange/ProView/Chart.qml +++ b/atomic_defi_design/Dex/Exchange/ProView/Chart.qml @@ -18,7 +18,6 @@ Item function loadChart(base, rel, force = false, source="nomics") { - let chart_html = "" let symbol = "" @@ -27,16 +26,20 @@ Item let base_full = General.coinName(base) let base_id = General.getNomicsId(base) let rel_id = General.getNomicsId(rel) + if (base_id != "" && rel_id != "") { symbol = base_id+"-"+rel_id + pair_supported = true if (symbol === loaded_symbol && !force) { webEngineViewPlaceHolder.visible = true return } + loaded_symbol = symbol + chart_html = ` -
+
` } @@ -54,8 +54,8 @@ Item if (chart_html == "") { - const pair = atomic_qt_utilities.retrieve_main_ticker(base) + "/" + atomic_qt_utilities.retrieve_main_ticker(rel) - const pair_reversed = atomic_qt_utilities.retrieve_main_ticker(rel) + "/" + atomic_qt_utilities.retrieve_main_ticker(base) + const pair = atomic_qt_utilities.retrieve_main_ticker(left_ticker) + "/" + atomic_qt_utilities.retrieve_main_ticker(right_ticker) + const pair_reversed = atomic_qt_utilities.retrieve_main_ticker(right_ticker) + "/" + atomic_qt_utilities.retrieve_main_ticker(left_ticker) // Try checking if pair/reversed-pair exists symbol = General.supported_pairs[pair] @@ -182,9 +182,9 @@ Item Connections { target: app - function onPairChanged(base, rel) + function onPairChanged() { - root.loadChart(base, rel) + root.loadChart(left_ticker, right_ticker) } } From 130d623f20f82a8893478b6905259661ac8b4b8a Mon Sep 17 00:00:00 2001 From: smk762 Date: Mon, 4 Jul 2022 03:33:37 +0800 Subject: [PATCH 171/177] fix custom fees --- .../Dex/Components/DexSwitch.qml | 8 +- atomic_defi_design/Dex/Constants/General.qml | 11 ++- atomic_defi_design/Dex/Wallet/SendModal.qml | 81 ++++++++++--------- 3 files changed, 57 insertions(+), 43 deletions(-) diff --git a/atomic_defi_design/Dex/Components/DexSwitch.qml b/atomic_defi_design/Dex/Components/DexSwitch.qml index fc3c507334..0d9799dd2a 100644 --- a/atomic_defi_design/Dex/Components/DexSwitch.qml +++ b/atomic_defi_design/Dex/Components/DexSwitch.qml @@ -112,28 +112,28 @@ Switch { id: _label Layout.fillHeight: true - + Layout.alignment: Qt.AlignVCenter + visible: _label.text != '' font: control.font color: control.textColor leftPadding: _indicator.width + control.spacing horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter + anchors.verticalCenter: _label2.text != '' ? control.verticalCenter : undefined wrapMode: Label.Wrap - } DefaultText { id: _label2 Layout.fillHeight: true - + visible: _label2.text != '' font: DexTypo.caption color: control.textColor leftPadding: _indicator.width + control.spacing horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter wrapMode: Label.Wrap - } } diff --git a/atomic_defi_design/Dex/Constants/General.qml b/atomic_defi_design/Dex/Constants/General.qml index c5ac44e5e5..c75cc53bad 100644 --- a/atomic_defi_design/Dex/Constants/General.qml +++ b/atomic_defi_design/Dex/Constants/General.qml @@ -526,15 +526,20 @@ QtObject { } function tokenUnitName(type) { - return type === "ERC-20" ? "Gwei" : "Satoshi" + return type === "QRC-20" ? "Satoshi" : "Gwei" } function isParentCoin(ticker) { - return ticker === "KMD" || ticker === "ETH" || ticker === "QTUM" + return ["KMD", "ETH", "MATIC", "AVAX", "FTM", "QTUM"].includes(ticker) } function isTokenType(type) { - return type === "ERC-20" || type === "QRC-20" + return ["ERC-20", "QRC-20", "PLG-20", "AVX-20", "FTM-20"].includes(type) + } + + function getFeesTicker(coin_info) { + if (coin_info.has_parent_fees_ticker) + return coin_info.fees_ticker } function getParentCoin(type) { diff --git a/atomic_defi_design/Dex/Wallet/SendModal.qml b/atomic_defi_design/Dex/Wallet/SendModal.qml index bebdbc5077..1987af4839 100644 --- a/atomic_defi_design/Dex/Wallet/SendModal.qml +++ b/atomic_defi_design/Dex/Wallet/SendModal.qml @@ -69,7 +69,7 @@ MultipageModal } function isSpecialToken() { - return General.isTokenType(current_ticker_infos.type) + return current_ticker_infos.has_parent_fees_ticker } function isERC20() { @@ -96,47 +96,41 @@ MultipageModal } function feeIsHigherThanAmount() { - if(!custom_fees_switch.checked) return false - - const amt = parseFloat(getCryptoAmount()) - const fee_amt = parseFloat(input_custom_fees.text) - return amt < fee_amt - } + if(!custom_fees_switch.checked) return false - function hasFunds() { - if(!General.hasEnoughFunds(true, api_wallet_page.ticker, "", "", _preparePage.cryptoSendMode ? input_amount.text : equivalentAmount.value)) - return false + const amount = parseFloat(getCryptoAmount()) - if(custom_fees_switch.checked) { - if(isSpecialToken()) { - const gas_limit = parseFloat(input_custom_fees_gas.text) - const gas_price = parseFloat(input_custom_fees_gas_price.text) + if(isSpecialToken()) { + const parent_ticker = General.getFeesTicker(current_ticker_infos) + const gas_limit = parseFloat(input_custom_fees_gas.text) + const gas_price = parseFloat(input_custom_fees_gas_price.text) + if (isNaN(gas_price) || isNaN(gas_limit)) return false - const unit = current_ticker_infos.type === "ERC-20" ? 1000000000 : 100000000 - const fee_parent_token = (gas_limit * gas_price)/unit + const unit = current_ticker_infos.type === "ERC-20" ? 1000000000 : 100000000 + const fee_parent_token = (gas_limit * gas_price)/unit - const parent_ticker = current_ticker_infos.type === "ERC-20" ? "ETH" : "QTUM" - if(api_wallet_page.ticker === parent_ticker) { - const amount = parseFloat(getCryptoAmount()) - const total_needed = amount + fee_parent_token - if(!General.hasEnoughFunds(true, parent_ticker, "", "", total_needed.toString())) - return false - } - else { - if(!General.hasEnoughFunds(true, parent_ticker, "", "", fee_parent_token.toString())) - return false - } + if(api_wallet_page.ticker === parent_ticker) { + const total_needed = amount + fee_parent_token + if(General.hasEnoughFunds(true, parent_ticker, "", "", total_needed.toString())) + return false } else { - if(feeIsHigherThanAmount()) return false - - if(!General.hasEnoughFunds(true, api_wallet_page.ticker, "", "", input_custom_fees.text)) + if(General.hasEnoughFunds(true, parent_ticker, "", "", fee_parent_token.toString())) return false } + return true + } + else { + const fee_amt = parseFloat(input_custom_fees.text) + return amount < fee_amt } + } - return true + function hasFunds() { + if(!General.hasEnoughFunds(true, api_wallet_page.ticker, "", "", _preparePage.cryptoSendMode ? input_amount.text : equivalentAmount.value)) + return false + return true } function feesAreFilled() { @@ -334,13 +328,15 @@ MultipageModal visible: errorView && input_address.text !== "" Layout.alignment: Qt.AlignHCenter Layout.fillWidth: true + spacing: 4 + + Item { Layout.fillWidth: true } DefaultText { id: reason Layout.alignment: Qt.AlignVCenter - Layout.fillWidth: true wrapMode: Text.WrapAtWordBoundaryOrAnywhere color: Dex.CurrentTheme.noColor @@ -361,6 +357,8 @@ MultipageModal onClicked: api_wallet_page.convert_address(input_address.text, address_data.to_address_format) } + + Item { Layout.fillWidth: true } } // Amount to send @@ -566,15 +564,18 @@ MultipageModal { Layout.preferredWidth: 380 Layout.alignment: Qt.AlignHCenter + Layout.topMargin: 32 // Custom fees switch DefaultSwitch { id: custom_fees_switch enabled: !root.is_send_busy - Layout.topMargin: 32 - label.text: qsTr("Enable Custom Fees") + Layout.preferredWidth: 260 onCheckedChanged: input_custom_fees.text = "" + labelWidth: 200 + label.text: qsTr("Enable Custom Fees") + label.wrapMode: Label.NoWrap } // Custom fees warning @@ -582,6 +583,8 @@ MultipageModal { visible: custom_fees_switch.checked font.pixelSize: 14 + Layout.alignment: Qt.AlignHCenter + horizontalAlignment: DefaultText.AlignHCenter color: Dex.CurrentTheme.noColor text_value: qsTr("Only use custom fees if you know what you are doing!") } @@ -593,6 +596,7 @@ MultipageModal visible: custom_fees_switch.checked Layout.preferredWidth: parent.width + Layout.alignment: Qt.AlignHCenter Layout.topMargin: 8 // Normal coins, Custom fees input @@ -651,10 +655,12 @@ MultipageModal visible: feeIsHigherThanAmount() Layout.alignment: Qt.AlignHCenter + horizontalAlignment: DefaultText.AlignHCenter wrapMode: Text.Wrap color: Style.colorRed - text_value: qsTr("Custom Fee can't be higher than the amount") + text_value: qsTr("Custom Fee can't be higher than the amount") + "\n" + + qsTr("You have %1", "AMT TICKER").arg(General.formatCrypto("", API.app.get_balance(General.getFeesTicker(current_ticker_infos)), General.getFeesTicker(current_ticker_infos))) } } @@ -662,12 +668,15 @@ MultipageModal DefaultText { Layout.topMargin: 16 + Layout.alignment: Qt.AlignHCenter + horizontalAlignment: DefaultText.AlignHCenter wrapMode: Text.Wrap visible: !fee_error.visible && !hasFunds() color: Dex.CurrentTheme.noColor - text_value: qsTr("Not enough funds.") + "\n" + qsTr("You have %1", "AMT TICKER").arg(General.formatCrypto("", API.app.get_balance(api_wallet_page.ticker), api_wallet_page.ticker)) + text_value: qsTr("Not enough funds.") + "\n" + + qsTr("You have %1", "AMT TICKER").arg(General.formatCrypto("", API.app.get_balance(api_wallet_page.ticker), api_wallet_page.ticker)) } DexBusyIndicator { visible: root.is_send_busy } From ec0915494147d6225f831bf497299caeb94ac7c4 Mon Sep 17 00:00:00 2001 From: cipig Date: Sun, 3 Jul 2022 20:34:34 +0000 Subject: [PATCH 172/177] XVC chain switch --- assets/config/0.5.5.1-coins.json | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/assets/config/0.5.5.1-coins.json b/assets/config/0.5.5.1-coins.json index ea9563840d..34cbcd9722 100644 --- a/assets/config/0.5.5.1-coins.json +++ b/assets/config/0.5.5.1-coins.json @@ -8006,8 +8006,8 @@ "active": false, "currently_enabled": false }, - "XVC": { - "coin": "XVC", + "XVC-OLD": { + "coin": "XVC-OLD", "name": "Vanillacash", "coinpaprika_id": "xvc-vcash", "coingecko_id": "vcash", @@ -8030,6 +8030,29 @@ "currently_enabled": false, "wallet_only": true }, + "XVC": { + "coin": "XVC", + "name": "Vanillacash", + "coinpaprika_id": "xvc-vcash", + "coingecko_id": "vcash", + "nomics_id": "XVC", + "electrum": [ + { + "url": "electrumx1.vanillacash.info:50011" + }, + { + "url": "electrumx2.vanillacash.info:50011" + } + ], + "explorer_url": [ + "https://chainz.cryptoid.info/xvc/" + ], + "explorer_tx_url": "tx.dws?", + "explorer_address_url": "address.dws?", + "type": "UTXO", + "active": false, + "currently_enabled": false + }, "XVC-BEP20": { "coin": "XVC-BEP20", "name": "Vanillacash", From f7caf652137c06ee2e2d57bab7bb2de0a1b86e2d Mon Sep 17 00:00:00 2001 From: cipig Date: Sun, 3 Jul 2022 22:07:10 +0000 Subject: [PATCH 173/177] add ws_urls --- assets/config/0.5.5.1-coins.json | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/assets/config/0.5.5.1-coins.json b/assets/config/0.5.5.1-coins.json index 34cbcd9722..764ee073d9 100644 --- a/assets/config/0.5.5.1-coins.json +++ b/assets/config/0.5.5.1-coins.json @@ -8038,10 +8038,12 @@ "nomics_id": "XVC", "electrum": [ { - "url": "electrumx1.vanillacash.info:50011" + "url": "electrumx1.vanillacash.info:50011", + "ws_url": "electrumx1.vanillacash.info:50013" }, { - "url": "electrumx2.vanillacash.info:50011" + "url": "electrumx2.vanillacash.info:50011", + "ws_url": "electrumx2.vanillacash.info:50013" } ], "explorer_url": [ From ab22c3ff8cb65046ccc38ec9f01ca2d5c5885b7a Mon Sep 17 00:00:00 2001 From: smk762 Date: Mon, 4 Jul 2022 13:16:19 +0800 Subject: [PATCH 174/177] add otherGas --- atomic_defi_design/Dex/Wallet/SendModal.qml | 6 ++++-- src/core/atomicdex/api/mm2/rpc.withdraw.cpp | 6 ++++++ src/core/atomicdex/pages/qt.wallet.page.cpp | 6 ++++++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/atomic_defi_design/Dex/Wallet/SendModal.qml b/atomic_defi_design/Dex/Wallet/SendModal.qml index 1987af4839..288baadbee 100644 --- a/atomic_defi_design/Dex/Wallet/SendModal.qml +++ b/atomic_defi_design/Dex/Wallet/SendModal.qml @@ -69,7 +69,9 @@ MultipageModal } function isSpecialToken() { - return current_ticker_infos.has_parent_fees_ticker + if (current_ticker_infos.hasOwnProperty("has_parent_fees_ticker")) + return current_ticker_infos.has_parent_fees_ticker + return false } function isERC20() { @@ -602,7 +604,7 @@ MultipageModal // Normal coins, Custom fees input AmountField { - visible: !isSpecialToken() + visible: !isSpecialToken() && !isParentCoin(api_wallet_page.ticker) id: input_custom_fees diff --git a/src/core/atomicdex/api/mm2/rpc.withdraw.cpp b/src/core/atomicdex/api/mm2/rpc.withdraw.cpp index fbbb291aa0..dd4b51b052 100644 --- a/src/core/atomicdex/api/mm2/rpc.withdraw.cpp +++ b/src/core/atomicdex/api/mm2/rpc.withdraw.cpp @@ -24,6 +24,12 @@ namespace mm2::api j["gas_limit"] = cfg.gas_limit.value_or(40); j["gas_price"] = std::stoi(cfg.gas_price.value()); } + else if (cfg.type == "otherGas") + { + j["type"] = "EthGas"; + j["gas"] = cfg.gas_limit.value_or(55000); + j["gas_price"] = std::stoi(cfg.gas_price.value()); + } else { j["amount"] = cfg.amount.value(); diff --git a/src/core/atomicdex/pages/qt.wallet.page.cpp b/src/core/atomicdex/pages/qt.wallet.page.cpp index 2b801f81b9..57532f71a3 100644 --- a/src/core/atomicdex/pages/qt.wallet.page.cpp +++ b/src/core/atomicdex/pages/qt.wallet.page.cpp @@ -274,6 +274,8 @@ namespace atomic_dex obj["type"] = QString::fromStdString(coin_info.type); obj["segwit_supported"] = coin_info.segwit; obj["is_segwit_on"] = coin_info.is_segwit_on; + obj["has_parent_fees_ticker"] = coin_info.has_parent_fees_ticker; + obj["fees_ticker"] = QString::fromStdString(coin_info.fees_ticker); obj["is_claimable"] = coin_info.is_claimable; obj["address"] = QString::fromStdString(mm2_system.address(ticker, ec)); obj["minimal_balance_for_asking_rewards"] = QString::fromStdString(coin_info.minimal_claim_amount); @@ -496,6 +498,10 @@ namespace atomic_dex { withdraw_req.fees->type = "Qrc20Gas"; } + else if (coin_info.has_parent_fees_ticker) + { + withdraw_req.fees->type = "otherGas"; + } } nlohmann::json json_data = ::mm2::api::template_request("withdraw", true); ::mm2::api::to_json(json_data, withdraw_req); From 8a0fc3b42d3a90b1bce78b9451e937034dafbbe3 Mon Sep 17 00:00:00 2001 From: syl Date: Mon, 4 Jul 2022 12:59:15 +0200 Subject: [PATCH 175/177] Pro Trading View: Fix error in orderbook row tooltip --- .../Dex/Exchange/Trade/OrderBook/ListDelegate.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/atomic_defi_design/Dex/Exchange/Trade/OrderBook/ListDelegate.qml b/atomic_defi_design/Dex/Exchange/Trade/OrderBook/ListDelegate.qml index 646f40dab2..a665959c08 100644 --- a/atomic_defi_design/Dex/Exchange/Trade/OrderBook/ListDelegate.qml +++ b/atomic_defi_design/Dex/Exchange/Trade/OrderBook/ListDelegate.qml @@ -76,7 +76,7 @@ Item right_ticker) } - if (isBid && API.app.trading_pg.market_mode == MarketMode.Sell) + if (!isAsk && API.app.trading_pg.market_mode == MarketMode.Sell) { return General.getTradingError( last_trading_error, curr_fee_info, From 7d06385386c14f5b045523e37af65f21600fc0f8 Mon Sep 17 00:00:00 2001 From: syl Date: Mon, 4 Jul 2022 13:04:01 +0200 Subject: [PATCH 176/177] Fix some notifications on click callbacks --- atomic_defi_design/Dex/App.qml | 18 +++++++----------- .../Dex/Dashboard/NotificationsModal.qml | 13 ++++--------- 2 files changed, 11 insertions(+), 20 deletions(-) diff --git a/atomic_defi_design/Dex/App.qml b/atomic_defi_design/Dex/App.qml index 8fe45cb878..0aac79294a 100644 --- a/atomic_defi_design/Dex/App.qml +++ b/atomic_defi_design/Dex/App.qml @@ -23,29 +23,25 @@ DexRectangle // This enumeration represents every possible visual state (commonly named "screen") of the application enum ScreenType { - Startup, // Wallets selection, login, create wallet, import wallet, etc. - Dashboard // After logged to a wallet. + Startup, // Wallets selection, login, create wallet, import wallet, etc. + Dashboard // After logged to a wallet. } property string currentWalletName: API.app.wallet_mgr.wallet_default_name property bool debug: debug_bar - property - var notification_modal: notifications_modal - property - var notifications_list: _currentPage === App.ScreenType.Dashboard ? loader.item.notifications_list : [] + property var notification_modal: notifications_modal + property var notifications_list: _currentPage === App.ScreenType.Dashboard ? loader.item.notifications_list : [] property bool segwit_on: false - property - var _currentPage: API.app.wallet_mgr.log_status() ? App.ScreenType.Dashboard : App.ScreenType.Startup - property - var _availablePages: [_startup, dashboard] + property var _currentPage: API.app.wallet_mgr.log_status() ? App.ScreenType.Dashboard : App.ScreenType.Startup + property var _availablePages: [_startup, dashboard] + property alias pageLoader: loader property alias globalGradient: globalGradient // Preload Chart signal pairChanged(string base, string rel) - function onDisconnect() { app.notifications_list = []; diff --git a/atomic_defi_design/Dex/Dashboard/NotificationsModal.qml b/atomic_defi_design/Dex/Dashboard/NotificationsModal.qml index be9837f64c..0473fda9ed 100644 --- a/atomic_defi_design/Dex/Dashboard/NotificationsModal.qml +++ b/atomic_defi_design/Dex/Dashboard/NotificationsModal.qml @@ -107,21 +107,16 @@ DexPopup break case "open_wallet_page": API.app.wallet_pg.ticker = notification.params.ticker - dashboard.switchPage(Dashboard.PageType.Wallet) + app.pageLoader.item.switchPage(Dashboard.PageType.Wallet) break case "open_swaps_page": - dashboard.switchPage(Dashboard.PageType.DEX) - - dashboard.loader.onLoadComplete = () => - { - dashboard.current_component.current_page = dashboard.isSwapDone(notification.params.new_swap_status) ? idx_exchange_history : idx_exchange_orders - } + app.pageLoader.item.switchPage(Dashboard.PageType.DEX) break case "open_log_modal": showError(notification.title, notification.long_message) break default: - console.log("Unknown notification click action", notification.click_action) + console.warn("Unknown notification click action", notification.click_action) break } } @@ -664,4 +659,4 @@ DexPopup onClicked: root.reset() } } -} \ No newline at end of file +} From ffcc0133353cacd087b4c97076d184fa7d7d0e62 Mon Sep 17 00:00:00 2001 From: smk762 Date: Mon, 4 Jul 2022 23:13:24 +0800 Subject: [PATCH 177/177] increace opacity for disabled coin icons --- .../Dex/Exchange/Trade/SimpleView/SubBestOrder.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/atomic_defi_design/Dex/Exchange/Trade/SimpleView/SubBestOrder.qml b/atomic_defi_design/Dex/Exchange/Trade/SimpleView/SubBestOrder.qml index 9a291e3c28..5283df1664 100644 --- a/atomic_defi_design/Dex/Exchange/Trade/SimpleView/SubBestOrder.qml +++ b/atomic_defi_design/Dex/Exchange/Trade/SimpleView/SubBestOrder.qml @@ -168,7 +168,7 @@ DexListView Layout.preferredWidth: parent._iconWidth Layout.preferredHeight: 24 source: General.coinIcon(coin) - opacity: !_isCoinEnabled? .1 : 1 + opacity: !_isCoinEnabled? .3 : 1 } DexLabel // Order Token Name