height
+ property alias position: scrollVert.position
+ property alias scrollVert: scrollVert
readonly property double scrollbar_margin: scrollbar_visible ? 8 : 0
property bool visibleBackground: false
boundsBehavior: Flickable.StopAtBounds
- ScrollBar.vertical: DefaultScrollBar { visibleBackground: root.visibleBackground }
+ ScrollBar.vertical: DexScrollBar {
+ id: scrollVert
+ visibleBackground: root.visibleBackground
+ }
implicitWidth: contentItem.childrenRect.width
implicitHeight: contentItem.childrenRect.height
@@ -20,5 +27,9 @@ ListView {
// Opacity animation
opacity: root.count === 0 ? 0 : enabled ? 1 : 0.2
- Behavior on opacity { SmoothedAnimation { duration: Style.animationDuration * 0.5; velocity: -1 } }
-}
+ Behavior on opacity {
+ SmoothedAnimation {
+ duration: Constants.Style.animationDuration * 0.5;velocity: -1
+ }
+ }
+}
\ No newline at end of file
diff --git a/atomic_defi_design/qml/Components/DexLoader.qml b/atomic_defi_design/qml/Components/DexLoader.qml
index 442dad0b1f..202a3bb795 100644
--- a/atomic_defi_design/qml/Components/DexLoader.qml
+++ b/atomic_defi_design/qml/Components/DexLoader.qml
@@ -1,7 +1,8 @@
import QtQuick 2.15
Loader {
- property var onLoadComplete: () => {}
+ property
+ var onLoadComplete: () => {}
onLoaded: {
onLoadComplete()
@@ -10,4 +11,4 @@ Loader {
asynchronous: true
visible: status === Loader.Ready
-}
+}
\ No newline at end of file
diff --git a/atomic_defi_design/qml/Components/DexMacControl.qml b/atomic_defi_design/qml/Components/DexMacControl.qml
new file mode 100644
index 0000000000..bc27b9d4a5
--- /dev/null
+++ b/atomic_defi_design/qml/Components/DexMacControl.qml
@@ -0,0 +1,110 @@
+import QtQuick 2.15
+import QtQuick.Controls 2.15
+import Qaterial 1.0 as Qaterial
+import QtQuick.Controls.Universal 2.15
+import QtQuick.Layouts 1.12
+
+import App 1.0
+
+Item {
+ anchors.fill: parent
+ Item {
+ width: parent.width
+ y: 1
+ height: 30
+ Rectangle {
+ width: parent.width - 2
+ height: 30
+ border.color: 'transparent'
+ border.width: 2
+ anchors.horizontalCenter: parent.horizontalCenter
+ gradient: Gradient {
+ orientation: Qt.Horizontal
+ GradientStop {
+ position: 0.0;color: "transparent"
+ }
+ GradientStop {
+ position: 0.4;color: "transparent"
+ }
+ GradientStop {
+ position: 0.6;color: DexTheme.surfaceColor
+ }
+ GradientStop {
+ position: 1.0;color: Qt.darker(DexTheme.dexBoxBackgroundColor, 0.9)
+ }
+ }
+ }
+ MouseArea {
+ onPressed: window.startSystemMove();
+ anchors.fill: parent
+ anchors.rightMargin: 280
+ onDoubleClicked: {
+ if (window.visibility === ApplicationWindow.Maximized) {
+ window.showNormal()
+ } else {
+ window.showMaximized()
+ }
+ }
+ }
+ DexMacosHeaderControl {
+ anchors.verticalCenter: parent.verticalCenter
+ }
+ }
+ Item {
+ id: _left_resize
+ height: parent.height
+ width: 3
+ MouseArea {
+ onPressed: window.startSystemResize(Qt.LeftEdge)
+ anchors.fill: parent
+ cursorShape: "SizeHorCursor"
+ }
+ }
+ Item {
+ id: _right_resize
+ height: parent.height
+ anchors.right: parent.right
+ width: 3
+ MouseArea {
+ onPressed: {
+ window.startSystemResize(Qt.RightEdge)
+ }
+ cursorShape: "SizeHorCursor"
+ }
+ }
+ Item {
+ id: _bottom_resize
+ height: 3
+ width: parent.width
+ anchors.bottom: parent.bottom
+ MouseArea {
+ onPressed: if (active) window.startSystemResize(Qt.BottomEdge)
+ //target: null
+ anchors.fill: parent
+ cursorShape: "SizeVerCursor"
+ }
+ }
+ Item {
+ id: _top_resize
+ height: 3
+ width: parent.width
+ MouseArea {
+ onPressed: window.startSystemResize(Qt.TopEdge)
+ //target: null
+ anchors.fill: parent
+ cursorShape: "SizeVerCursor"
+ }
+ }
+ Item {
+ id: _bottom_right_resize
+ height: 6
+ width: 6
+ anchors.right: parent.right
+ anchors.bottom: parent.bottom
+ MouseArea {
+ onPressed: if (active) window.startSystemResize(Qt.BottomEdge | Qt.RightEdge)
+ anchors.fill: parent
+ cursorShape: "SizeFDiagCursor"
+ }
+ }
+}
\ No newline at end of file
diff --git a/atomic_defi_design/qml/Components/DexMacosHeaderControl.qml b/atomic_defi_design/qml/Components/DexMacosHeaderControl.qml
index 7af189715e..a180b230f5 100644
--- a/atomic_defi_design/qml/Components/DexMacosHeaderControl.qml
+++ b/atomic_defi_design/qml/Components/DexMacosHeaderControl.qml
@@ -5,6 +5,7 @@ import QtQuick.Controls.Universal 2.15
import QtQuick.Layouts 1.12
import "../Constants"
+import App 1.0
Row {
id: _headerControlRow
@@ -19,14 +20,14 @@ Row {
Rectangle {
width: parent.size
height: width
- radius: width/2
- color: closeButton.containsPress? Qt.lighter("#FF5E57") : "#FF5E57"
+ radius: width / 2
+ color: closeButton.containsPress ? Qt.lighter("#FF5E57") : "#FF5E57"
anchors.verticalCenter: parent.verticalCenter
Qaterial.ColorIcon {
visible: _headerControlRow.hovered
anchors.centerIn: parent
source: Qaterial.Icons.close
- iconSize: parent.width-2
+ iconSize: parent.width - 2
color: 'black'
}
MouseArea {
@@ -35,20 +36,20 @@ Row {
anchors.fill: parent
onClicked: {
Qt.quit()
- console.log("Window.visibility: "+window.visibility)
+ console.log("Window.visibility: " + window.visibility)
}
}
}
Rectangle {
width: parent.size
height: width
- radius: width/2
- color: minimizeButton.containsPress? Qt.lighter("#FFBC2C") : "#FFBC2C"
+ radius: width / 2
+ color: minimizeButton.containsPress ? Qt.lighter("#FFBC2C") : "#FFBC2C"
Qaterial.ColorIcon {
visible: _headerControlRow.hovered
anchors.centerIn: parent
- source:Qaterial.Icons.windowMinimize
- iconSize: parent.width-2
+ source: Qaterial.Icons.windowMinimize
+ iconSize: parent.width - 2
color: 'black'
}
anchors.verticalCenter: parent.verticalCenter
@@ -64,13 +65,13 @@ Row {
Rectangle {
width: parent.size
height: width
- radius: width/2
- color: extendButton.containsPress? Qt.lighter("#26CA42") : "#26CA42"
+ radius: width / 2
+ color: extendButton.containsPress ? Qt.lighter("#26CA42") : "#26CA42"
Qaterial.ColorIcon {
visible: _headerControlRow.hovered
anchors.centerIn: parent
- source: window.visibility===ApplicationWindow.Maximized? Qaterial.Icons.arrowCollapse : Qaterial.Icons.arrowExpand
- iconSize: parent.width-2
+ source: window.visibility === ApplicationWindow.Maximized ? Qaterial.Icons.arrowCollapse : Qaterial.Icons.arrowExpand
+ iconSize: parent.width - 2
color: 'black'
}
anchors.verticalCenter: parent.verticalCenter
@@ -79,9 +80,9 @@ Row {
hoverEnabled: true
anchors.fill: parent
onClicked: {
- if(window.visibility===ApplicationWindow.Maximized){
+ if (window.visibility === ApplicationWindow.Maximized) {
window.showNormal()
- }else {
+ } else {
window.showMaximized()
}
}
@@ -89,4 +90,4 @@ Row {
}
-}
+}
\ No newline at end of file
diff --git a/atomic_defi_design/qml/Components/DexModal.qml b/atomic_defi_design/qml/Components/DexModal.qml
index 3303936c81..d5d1781717 100644
--- a/atomic_defi_design/qml/Components/DexModal.qml
+++ b/atomic_defi_design/qml/Components/DexModal.qml
@@ -1,33 +1,70 @@
-import QtQuick 2.15
-import QtQuick.Controls 2.15
-import "../Constants"
-
-Popup {
- id: root
- anchors.centerIn: Overlay.overlay
- modal: true
- focus: true
- closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside
-
- Overlay.modal: Rectangle {
- color: "#AA000000"
- }
-
- // Fade in animation
- onVisibleChanged: {
- if(visible) {
- opacity = 0
- fade_animation.start()
- }
- }
-
- NumberAnimation {
- id: fade_animation
- target: root
- property: "opacity"
- duration: Style.animationDuration
- to: 1
- }
-
- background: FloatingBackground { }
-}
+import QtQuick 2.15
+import QtQuick.Controls 2.15
+import QtQuick.Layouts 1.15
+
+Popup {
+ id: control
+ parent: Overlay.overlay
+ property alias title: _headerBackground.text
+ property alias headerBackground: _headerBackground
+ property alias backgroundColor: _backgroundColor.color
+ property alias currentIndex: _layoutPopup.currentIndex
+ property alias header: _header.contentItem
+ property alias footer: _footer.contentItem
+ modal: true
+ padding: 0
+ Overlay.modeless: DexRectangle {
+ color: DexTheme.dexBoxBackgroundColor
+ opacity: .3
+ }
+ background: ClipRRect {
+ radius: 8
+ DexRectangle {
+ id: _backgroundColor
+ anchors.fill: parent
+ border.width: 2
+ radius: parent.radius
+ color: DexTheme.dexBoxBackgroundColor
+ Container {
+ id: _header
+ width: parent.width
+ height: 60
+ contentItem: DexModalHeader {
+ id: _headerBackground
+ }
+ }
+ HorizontalLine {
+ anchors.top: _footer.top
+ width: _headerBackground.width
+ opacity: .7
+ }
+ Container {
+ id: _footer
+ anchors.bottom: parent.bottom
+ height: try {
+ contentItem.height
+ } catch (e) {
+ 0
+ }
+ width: parent.width
+ }
+
+ }
+ }
+ contentItem: StackLayout {
+ id: _layoutPopup
+ anchors.fill: parent
+ anchors.topMargin: try {
+ control.header.height
+ } catch (e) {
+ 0
+ }
+ anchors.bottomMargin: try {
+ control.footer.height
+ } catch (e) {
+ 0
+ }
+
+ }
+
+}
\ No newline at end of file
diff --git a/atomic_defi_design/qml/Components/DexModalHeader.qml b/atomic_defi_design/qml/Components/DexModalHeader.qml
new file mode 100644
index 0000000000..9eb7fbfc26
--- /dev/null
+++ b/atomic_defi_design/qml/Components/DexModalHeader.qml
@@ -0,0 +1,24 @@
+import QtQuick 2.15
+
+DexRectangle {
+ id: _headerBackground
+ property alias text: _title.text
+ /*width: parent.width
+ height: parent.height*/
+ color: DexTheme.accentColor
+ border.width: 0
+ radius: 0
+ DexLabel {
+ id: _title
+ anchors.verticalCenter: parent.verticalCenter
+ text: ""
+ opacity: .8
+ font: DexTypo.head6
+ leftPadding: 10
+ }
+ HorizontalLine {
+ anchors.bottom: parent.bottom
+ width: _headerBackground.width
+ opacity: .7
+ }
+}
\ No newline at end of file
diff --git a/atomic_defi_design/qml/Components/DexMouseArea.qml b/atomic_defi_design/qml/Components/DexMouseArea.qml
index fdb71d12ea..fa58b5512f 100644
--- a/atomic_defi_design/qml/Components/DexMouseArea.qml
+++ b/atomic_defi_design/qml/Components/DexMouseArea.qml
@@ -2,4 +2,4 @@ import QtQuick 2.15
MouseArea {
cursorShape: enabled ? Qt.PointingHandCursor : Qt.ArrowCursor
-}
+}
\ No newline at end of file
diff --git a/atomic_defi_design/qml/Components/DexPaginator.qml b/atomic_defi_design/qml/Components/DexPaginator.qml
new file mode 100644
index 0000000000..1787687485
--- /dev/null
+++ b/atomic_defi_design/qml/Components/DexPaginator.qml
@@ -0,0 +1,151 @@
+import QtQuick 2.15
+import QtQuick.Layouts 1.15
+import QtQuick.Controls 2.15
+import Qaterial 1.0 as Qaterial
+import "../Constants"
+as Constants
+import App 1.0
+
+RowLayout {
+ id: root
+
+ spacing: 6
+
+ property
+ var pageSize: Constants.API.app.orders_mdl.nb_pages
+ property
+ var currentValue: Constants.API.app.orders_mdl.current_page
+
+ function refreshBtn() {
+ currentValue = Constants.API.app.orders_mdl.current_page
+ var model = []
+ if (pageSize < 10) {
+ for (var i = 0; i < pageSize; i++) {
+ model.push({
+ number: i + 1,
+ selected: currentValue === i + 1
+ })
+ }
+ } else {
+
+ [1, 2].map(v => model.push({
+ number: v,
+ selected: currentValue === v
+ }));
+
+ model.push({
+ number: currentValue - 2 > 1 + 3 ? -1 : 1 + 2,
+ selected: currentValue === 3
+ });
+
+ for (var k = Math.max(1 + 3, currentValue - 2); k <= Math.min(pageSize - 3, currentValue + 2); k++) {
+ model.push({
+ number: k,
+ selected: currentValue === k
+ });
+ }
+
+ model.push({
+ number: currentValue + 2 < pageSize - 3 ? -1 : pageSize - 2,
+ selected: currentValue === pageSize - 2
+ });
+ [pageSize - 1, pageSize].map(v => model.push({
+ number: v,
+ selected: currentValue === v
+ }));
+ }
+ btnGroup.model = model
+ }
+
+ onPageSizeChanged: {
+ currentValue = 1
+ if (pageSize < 1) {
+ pageSize = 1
+ }
+ refreshBtn()
+ }
+ DefaultComboBox {
+ readonly property int item_count: Constants.API.app.orders_mdl.limit_nb_elements
+ readonly property
+ var options: [5, 10, 25, 50, 100, 200]
+
+ Layout.leftMargin: 0
+ Layout.alignment: Qt.AlignCenter
+ Layout.preferredWidth: 70
+
+ model: options
+ currentIndex: options.indexOf(item_count)
+ onCurrentValueChanged: Constants.API.app.orders_mdl.limit_nb_elements = currentValue
+ }
+
+ DefaultText {
+ Layout.alignment: Qt.AlignCenter
+ font.pixelSize: 11
+ text_value: qsTr("items per page")
+ }
+ Item {
+ Layout.fillWidth: true
+ Layout.fillHeight: true
+ }
+
+ PaginationButton {
+ Layout.preferredWidth: 32
+ Layout.preferredHeight: 32
+ radius: 20
+ opacity: enabled ? 1 : .5
+ Qaterial.ColorIcon {
+ anchors.centerIn: parent
+ iconSize: 14
+ color: DexTheme.foregroundColor
+ source: Qaterial.Icons.skipPreviousOutline
+ }
+ enabled: currentValue > 1
+ onClicked: {
+ --Constants.API.app.orders_mdl.current_page
+ refreshBtn()
+ }
+ }
+
+
+ Repeater {
+ id: btnGroup
+ model: [{
+ number: 1,
+ selected: true
+ }]
+ delegate: PaginationButton {
+ text: modelData.number === -1 ? "..." : ("" + modelData.number)
+ radius: 30
+ Layout.preferredWidth: 32
+ Layout.preferredHeight: 32
+ Layout.alignment: Qt.AlignVCenter
+ color: modelData.number === currentValue ? 'transparent' : backgroundColor
+ foregroundColor: modelData.number === currentValue ? DexTheme.accentColor : DexTheme.buttonColorTextEnabled
+ onClicked: {
+ if (currentValue !== model.modelData) {
+ Constants.API.app.orders_mdl.current_page = btnGroup.model[index].number
+ refreshBtn()
+ }
+ }
+ }
+ }
+ PaginationButton {
+ Layout.preferredWidth: 32
+ Layout.preferredHeight: 32
+ radius: 20
+ opacity: enabled ? 1 : .5
+ Qaterial.ColorIcon {
+ anchors.centerIn: parent
+ iconSize: 14
+ color: DexTheme.foregroundColor
+ source: Qaterial.Icons.skipNextOutline
+ }
+ enabled: pageSize > 1 && currentValue < pageSize
+ onClicked: {
+ ++Constants.API.app.orders_mdl.current_page
+ refreshBtn()
+ }
+
+ }
+
+}
\ No newline at end of file
diff --git a/atomic_defi_design/qml/Components/DexPopup.qml b/atomic_defi_design/qml/Components/DexPopup.qml
new file mode 100644
index 0000000000..16ebf7e104
--- /dev/null
+++ b/atomic_defi_design/qml/Components/DexPopup.qml
@@ -0,0 +1,119 @@
+import QtQuick 2.12
+import QtQuick.Controls 2.12
+
+import Qaterial 1.0 as Qaterial
+
+Qaterial.Popup {
+ id: root
+
+ parent: Overlay.overlay
+
+ spacing: 8
+ padding: 4
+ property int arrowXDecalage: 0
+
+ property int _arrowOrigin
+ property color backgroundColor: Qaterial.Style.dialogColor
+
+ function openAt(origin, transformOrigin) {
+ root.transformOrigin = transformOrigin
+ root._arrowOrigin = transformOrigin
+
+ if (transformOrigin === Item.Top || transformOrigin === Item.Bottom)
+ x = origin.x - implicitWidth / 2
+ else if (transformOrigin === Item.Left)
+ x = origin.x + spacing
+ else
+ x = origin.x - implicitWidth - spacing
+
+ if (transformOrigin === Item.Left || transformOrigin === Item.Right)
+ y = origin.y - implicitHeight / 2
+ else if (transformOrigin === Item.Top)
+ y = origin.y + spacing
+ else
+ y = origin.y - implicitHeight - spacing
+
+ open()
+ }
+
+ background: Item {
+ implicitWidth: 50
+ implicitHeight: Qaterial.Style.menu.implicitHeight
+
+ Rectangle {
+ anchors.fill: parent
+
+ radius: 4
+ color: root.backgroundColor
+ layer.enabled: true
+ layer.effect: Qaterial.ElevationEffect {
+ elevation: Qaterial.Style.menu.elevation
+ } // ElevationEffect
+ }
+
+ Rectangle {
+ x: {
+ if (root._arrowOrigin === Item.Top || root._arrowOrigin === Item.Bottom)
+ return ((parent.width - width) / 2) + root.arrowXDecalage
+ else if (root._arrowOrigin === Item.Left)
+ return (-width / 2) + root.arrowXDecalage
+ else
+ return (parent.width - width / 2) + root.arrowXDecalage
+ }
+ y: {
+ if (root._arrowOrigin === Item.Left || root._arrowOrigin === Item.Right)
+ return (parent.height - height) / 2
+ else if (root._arrowOrigin === Item.Top)
+ return -height / 2
+ else
+ return parent.height - height / 2
+ }
+ width: 8
+ height: 8
+ rotation: 45
+ color: root.backgroundColor
+ } // Triangle
+ } // Rectangle
+
+ enter: Transition {
+ NumberAnimation {
+ property: "scale"
+ from: 0.0
+ to: 1.0
+ easing.type: Easing.OutQuint
+ duration: 220
+ }
+
+ NumberAnimation {
+ property: "opacity"
+ from: 0.0
+ to: 1.0
+ easing.type: Easing.OutCubic
+ duration: 150
+ }
+ // NumberAnimation
+ }
+ // Transition
+
+ exit: Transition {
+ NumberAnimation {
+ property: "scale"
+ from: 1.0
+ to: 0.0
+ easing.type: Easing.OutQuint
+ duration: 220
+ }
+ // NumberAnimation
+
+ NumberAnimation {
+ property: "opacity"
+ from: 1.0
+ to: 0.0
+ easing.type: Easing.OutCubic
+ duration: 150
+ }
+ // NumberAnimation
+ }
+ // Transition
+}
+// Popup
\ No newline at end of file
diff --git a/atomic_defi_design/qml/Components/DexRangeSlider.qml b/atomic_defi_design/qml/Components/DexRangeSlider.qml
index c48e88cab4..b138b4ce81 100644
--- a/atomic_defi_design/qml/Components/DexRangeSlider.qml
+++ b/atomic_defi_design/qml/Components/DexRangeSlider.qml
@@ -4,15 +4,21 @@ import QtQuick.Controls 2.15
import QtQuick.Layouts 1.12
import QtWebEngine 1.8
import "../Exchange/Trade/"
-import "../Constants/" as Constants
+import "../Constants/"
+as Constants
RangeSlider {
id: control
- opacity: enabled? 1 : .5
+
+
+ opacity: enabled ? 1 : .5
first.value: 0.25
second.value: .75
property color rangeDistanceColor: Constants.Style.colorGreen
property color rangeBackgroundColor: Constants.Style.colorTheme9
+ property bool firstDisabled: false
+ property
+ var defaultFirstValue: 0.0
property alias leftText: _left_item.text
property alias halfText: _half_item.text
@@ -38,13 +44,18 @@ RangeSlider {
radius: 2
}
}
-
+ first.onValueChanged: {
+ if (firstDisabled) {
+ first.value = defaultFirstValue
+ }
+ }
first.handle: FloatingBackground {
x: control.leftPadding + control.first.visualPosition * (control.availableWidth - width)
y: control.topPadding + control.availableHeight / 2 - height / 2
implicitWidth: 26
implicitHeight: 26
radius: 13
+ visible: !control.firstDisabled
Rectangle {
anchors.centerIn: parent
width: 8
@@ -111,4 +122,4 @@ RangeSlider {
text_value: qsTr("Max")
}
-}
+}
\ No newline at end of file
diff --git a/atomic_defi_design/qml/Components/DexRectangle.qml b/atomic_defi_design/qml/Components/DexRectangle.qml
index cf75c5ee5a..e204762aba 100644
--- a/atomic_defi_design/qml/Components/DexRectangle.qml
+++ b/atomic_defi_design/qml/Components/DexRectangle.qml
@@ -1,11 +1,25 @@
import QtQuick 2.15
-import "../Constants"
+import App 1.0
AnimatedRectangle {
id: rect
- radius: Style.rectangleCornerRadius
- color: theme.backgroundColor
- border.color: Style.colorBorder
+ property bool sizeAnimation: false
+ property int sizeAnimationDuration: 150
+ radius: DexTheme.rectangleRadius
+ color: DexTheme.contentColorTopBold
+ border.color: DexTheme.contentColorTopBold
border.width: 1
-}
+ Behavior on width {
+ enabled: rect.sizeAnimation
+ NumberAnimation {
+ duration: rect.sizeAnimationDuration
+ }
+ }
+ Behavior on height {
+ enabled: rect.sizeAnimation
+ NumberAnimation {
+ duration: rect.sizeAnimationDuration
+ }
+ }
+}
\ No newline at end of file
diff --git a/atomic_defi_design/qml/Components/DexScrollBar.qml b/atomic_defi_design/qml/Components/DexScrollBar.qml
index 5226c25ef8..e58650cb3b 100644
--- a/atomic_defi_design/qml/Components/DexScrollBar.qml
+++ b/atomic_defi_design/qml/Components/DexScrollBar.qml
@@ -1,6 +1,7 @@
import QtQuick 2.15
import QtQuick.Controls 2.15
-import "../Constants"
+
+import App 1.0
ScrollBar {
id: control
@@ -9,29 +10,26 @@ ScrollBar {
anchors.rightMargin: 3
policy: scrollbar_visible ? ScrollBar.AlwaysOn : ScrollBar.AlwaysOff
property bool visibleBackground: true
- width: 6
+ width: 10
contentItem: Item {
- FloatingBackground {
+ DexRectangle {
width: parent.width
- height: parent.height - 7 - 4
+ height: parent.height
anchors.verticalCenter: parent.verticalCenter
- color: Style.colorScrollbar
- border_color_start: Style.colorScrollbarGradient1
- border_color_end: Style.colorScrollbarGradient2
+ color: DexTheme.portfolioPieGradient ? DexTheme.buttonColorHovered : DexTheme.backgroundDarkColor7
}
}
background: Item {
width: 10
- x: -width/2 + 6/2
- InnerBackground {
+ x: 0
+ DexRectangle {
visible: control.visibleBackground
width: parent.width
- height: parent.height - 7
+ height: parent.height
anchors.verticalCenter: parent.verticalCenter
- color: Style.colorScrollbarBackground
}
}
-}
+}
\ No newline at end of file
diff --git a/atomic_defi_design/qml/Components/DexSelectableButton.qml b/atomic_defi_design/qml/Components/DexSelectableButton.qml
index 025804ece8..0bf8c8cddd 100644
--- a/atomic_defi_design/qml/Components/DexSelectableButton.qml
+++ b/atomic_defi_design/qml/Components/DexSelectableButton.qml
@@ -4,6 +4,7 @@ import QtQuick.Controls 2.15
import QtGraphicalEffects 1.0
import Qt.labs.settings 1.0
+import App 1.0
import QtQuick.Window 2.12
@@ -13,28 +14,37 @@ Item {
property bool selected: false
property alias text: _label.text
property alias hovered: area.containsMouse
- signal clicked()
- width: parent.width-20
+ property bool outlined: false
+
anchors.horizontalCenter: parent.horizontalCenter
+
+ width: parent.width - 20
height: 45
- Rectangle {
+
+ signal clicked()
+
+ DexRectangle {
anchors.fill: parent
height: 45
radius: 5
- opacity: parent.hovered? .4 : !parent.selected? 0 : .9
- color: theme.hightlightColor
+ opacity: parent.hovered ? .6 : !parent.selected ? 0 : .9
+ color: outlined ? 'transparent' : DexTheme.accentColor
+ border.color: outlined ? DexTheme.accentColor : 'transparent'
}
+
DexLabel {
id: _label
anchors.centerIn: parent
- font: theme.textType.button
+ font: DexTypo.button
+ color: DexTheme.foregroundColor
text: ""
- opacity: area.containsMouse? 1 : .7
+ opacity: area.containsMouse ? 1 : .7
}
- MouseArea {
+
+ DexMouseArea {
id: area
- cursorShape: "PointingHandCursor"
+ hoverEnabled: true
onClicked: parent.clicked()
anchors.fill: parent
}
-}
+}
\ No newline at end of file
diff --git a/atomic_defi_design/qml/Components/DexSlider.qml b/atomic_defi_design/qml/Components/DexSlider.qml
index 32dd5a87c9..be3dfc714d 100644
--- a/atomic_defi_design/qml/Components/DexSlider.qml
+++ b/atomic_defi_design/qml/Components/DexSlider.qml
@@ -1,10 +1,11 @@
import QtQuick 2.15
import QtQuick.Controls 2.15
import "../Constants"
+import App 1.0
Slider {
id: control
value: 0.5
- opacity: enabled? 1 : .5
+ opacity: enabled ? 1 : .5
background: Rectangle {
x: control.leftPadding
@@ -19,7 +20,7 @@ Slider {
Rectangle {
width: control.visualPosition * parent.width
height: parent.height
- color: Style.colorGreen
+ color: DexTheme.accentColor
radius: 2
}
}
@@ -34,8 +35,7 @@ Slider {
width: 10
height: 10
radius: 10
- color: Style.colorGreen
+ color: DexTheme.accentColor
}
- //border.color: "#bdbebf"
}
-}
+}
\ No newline at end of file
diff --git a/atomic_defi_design/qml/Components/DexSplitView.qml b/atomic_defi_design/qml/Components/DexSplitView.qml
index 020a126f52..f6a1209ef0 100644
--- a/atomic_defi_design/qml/Components/DexSplitView.qml
+++ b/atomic_defi_design/qml/Components/DexSplitView.qml
@@ -3,6 +3,7 @@ import QtQuick.Controls 2.15
SplitView {
- property var items: []
+ property
+ var items: []
-}
+}
\ No newline at end of file
diff --git a/atomic_defi_design/qml/Components/DexSubstractRectangle.qml b/atomic_defi_design/qml/Components/DexSubstractRectangle.qml
index de70e60039..1fe19e541b 100644
--- a/atomic_defi_design/qml/Components/DexSubstractRectangle.qml
+++ b/atomic_defi_design/qml/Components/DexSubstractRectangle.qml
@@ -7,10 +7,12 @@ import Qt.labs.settings 1.0
import AtomicDEX.MarketMode 1.0
import "../Constants"
+import App 1.0
Rectangle {
id: _mask
- property var target
+ property
+ var target
property alias subStractItem: maskSubstract
anchors.fill: target
color: "transparent"
@@ -18,7 +20,7 @@ Rectangle {
radius: 10
Rectangle {
id: maskSubstract
- x: parent.width-20
+ x: parent.width - 20
anchors.verticalCenter: parent.verticalCenter
radius: 100
width: 60
@@ -29,13 +31,13 @@ Rectangle {
layer.effect: ShaderEffect {
property variant source: _mask.target
fragmentShader: "
- varying highp vec2 qt_TexCoord0;
- uniform highp float qt_Opacity;
- uniform lowp sampler2D source;
- uniform lowp sampler2D maskSource;
- void main(void) {
- gl_FragColor = texture2D(source, qt_TexCoord0.st) * (1.0-texture2D(maskSource, qt_TexCoord0.st).a) * qt_Opacity;
- }
- "
+ varying highp vec2 qt_TexCoord0;
+ uniform highp float qt_Opacity;
+ uniform lowp sampler2D source;
+ uniform lowp sampler2D maskSource;
+ void main(void) {
+ gl_FragColor = texture2D(source, qt_TexCoord0.st) * (1.0 - texture2D(maskSource, qt_TexCoord0.st).a) * qt_Opacity;
+ }
+ "
}
-}
+}
\ No newline at end of file
diff --git a/atomic_defi_design/qml/Components/DexSweetComboBox.qml b/atomic_defi_design/qml/Components/DexSweetComboBox.qml
index a84e2e71cc..b667b28413 100644
--- a/atomic_defi_design/qml/Components/DexSweetComboBox.qml
+++ b/atomic_defi_design/qml/Components/DexSweetComboBox.qml
@@ -3,53 +3,67 @@ import QtQuick.Layouts 1.15
import QtQuick.Controls 2.15
import QtQuick.Controls.impl 2.15
+import Qaterial 1.0 as Qaterial
+
import "../Constants"
+as Constants
+import App 1.0
ComboBox {
id: control
- 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]
property string currentTicker: "All"
- delegate: ItemDelegate {
- width: control.width+50
+ delegate: ItemDelegate
+ {
+ width: control.width + 50
highlighted: control.highlightedIndex === index
- contentItem: DefaultText {
+ contentItem: DefaultText
+ {
text_value: control.currentTicker
- color: Style.colorText
+ color: DexTheme.foregroundColor
}
}
- indicator: ColorImage {
- x: control.mirrored ? control.padding : control.width - width - control.padding
+ indicator: Qaterial.Icon {
+ x: control.mirrored ? control.padding : control.width - width - control.padding - 4
y: control.topPadding + (control.availableHeight - height) / 2
color: control.contentItem.color
- defaultColor: control.contentItem.color
- source: "qrc:/qt-project.org/imports/QtQuick/Controls.2/images/double-arrow.png"
+ icon: Qaterial.Icons.chevronDown
}
- contentItem: DefaultText {
+ contentItem: DexLabel
+ {
leftPadding: 10
- rightPadding: control.indicator.width + control.spacing
- color: Style.colorWhite1
- text: control.currentTicker//control.displayText
-
verticalAlignment: Text.AlignVCenter
+
+ width: _background.width - leftPadding
+ height: _background.height
+
+ color: DexTheme.foregroundColor
+ text: control.currentTicker
elide: Text.ElideRight
+ wrapMode: Text.NoWrap
}
- background: Rectangle {
- implicitWidth: 120
+ background: DexRectangle {
+ id: _background
+
+ //implicitWidth: 120
+
implicitHeight: 40
- color: !control.enabled ? Style.colorTheme5 : control.hovered ? Style.colorTheme7 : Style.colorTheme9
- radius: 4
+ colorAnimation: false
+ color: !control.enabled ? DexTheme.backgroundDarkColor0 : control.hovered ? DexTheme.backgroundDarkColor0 : DexTheme.surfaceColor
+ radius: 8
}
popup: Popup {
id: comboPopup
readonly property double max_height: 350
y: control.height - 1
- width: control.width+50
+ width: control.width + 50
height: Math.min(contentItem.implicitHeight, popup.max_height)
padding: 1
@@ -63,11 +77,13 @@ ComboBox {
background: Item {
Rectangle {
anchors.fill: parent
- anchors.rightMargin: 2
- border.color: "transparent"
- color: Style.colorInnerBackground
- }
+ anchors.topMargin: -5
+ anchors.rightMargin: -1
+ border.color: "transparent"
+ color: DexTheme.backgroundColor
+ }
}
+
onTextChanged: {
control.model.setFilterFixedString(text)
}
@@ -82,7 +98,10 @@ ComboBox {
input_coin_filter.reset()
input_coin_filter.forceActiveFocus()
}
- function onClosed() { input_coin_filter.reset() }
+
+ function onClosed() {
+ input_coin_filter.reset()
+ }
}
@@ -91,9 +110,9 @@ ComboBox {
Layout.fillWidth: true
Layout.leftMargin: 0
Layout.preferredHeight: 40
- Layout.rightMargin: 2//Layout.leftMargin
+ Layout.rightMargin: 2 //Layout.leftMargin
Layout.topMargin: Layout.leftMargin
- Keys.onDownPressed: {
+ Keys.onDownPressed: {
control.incrementCurrentIndex()
}
Keys.onUpPressed: {
@@ -101,9 +120,9 @@ ComboBox {
}
Keys.onPressed: {
- if(event.key === Qt.Key_Return) {
- if(control.count > 0) {
- control.currentIndex = 0//control.highlightedIndex
+ if (event.key === Qt.Key_Return) {
+ if (control.count > 0) {
+ control.currentIndex = 0 //control.highlightedIndex
control.currentTicker = control.currentText
}
popup.close()
@@ -115,26 +134,39 @@ ComboBox {
Layout.maximumHeight: popup.max_height - 100
Layout.fillWidth: true
implicitHeight: popup_list_view.contentHeight + 5
- DefaultListView {
+ DexListView {
id: popup_list_view
model: control.popup.visible ? control.model : null
currentIndex: control.highlightedIndex
anchors.fill: parent
+ anchors.bottomMargin: 10
anchors.rightMargin: 2
+ highlight: DexRectangle {
+ radius: 0
+ }
+ clip: true
delegate: ItemDelegate {
- width: control.width+50
+ width: control.width + 50
highlighted: control.highlightedIndex === index
+ //foregroundColor: DexTheme.foregroundColor
contentItem: DefaultText {
text_value: ticker
- color: Style.colorText
}
+
+ background: DexRectangle {
+ colorAnimation: false
+ radius: 0
+ color: popup_list_view.currentIndex === index ? DexTheme.buttonColorHovered : DexTheme.comboBoxBackgroundColor
+ border.color: 'transparent'
+ }
+
onClicked: {
control.currentTicker = ticker
popup.close()
}
}
- DefaultMouseArea {
+ DexMouseArea {
anchors.fill: parent
acceptedButtons: Qt.NoButton
}
@@ -143,17 +175,18 @@ ComboBox {
}
- background: Item {
- AnimatedRectangle {
- width: parent.width
- y: -5
- height: parent.height+10
- color: Style.colorTheme9
- }
+ background: DexRectangle {
+ y: -5
+ radius: 0
+ colorAnimation: false
+ width: parent.width
+ height: parent.height
+ color: DexTheme.comboBoxBackgroundColor
+ border.color: DexTheme.comboBoxBorderColor
}
}
DefaultMouseArea {
anchors.fill: parent
acceptedButtons: Qt.NoButton
}
-}
+}
\ No newline at end of file
diff --git a/atomic_defi_design/qml/Components/DexSwitch.qml b/atomic_defi_design/qml/Components/DexSwitch.qml
index 89769b81a9..781b8764c2 100644
--- a/atomic_defi_design/qml/Components/DexSwitch.qml
+++ b/atomic_defi_design/qml/Components/DexSwitch.qml
@@ -1,34 +1,69 @@
+//! Qt Imports.
import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Controls.Universal 2.15
+
+//! Projects Imports.
import "../Constants"
+import App 1.0
-Switch {
+Switch
+{
id: control
- Universal.theme: Style.dark_theme ? Universal.Dark : Universal.Light
- Universal.accent: theme.accent
- Universal.foreground: theme.foregroundColor
- Universal.background: Style.colorQtThemeBackground
-
- font.family:theme.textType.fontFamily
- indicator: Rectangle {
- implicitWidth: 52
- implicitHeight: 22
- //x: control.width - width - control.rightPadding
- y: parent.height / 2 - height / 2
+
+ property alias switchButtonWidth: indicator.width
+ property alias switchButtonHeight: indicator.height
+ property alias switchButtonRadius: indicator.radius
+
+ Universal.accent: DexTheme.accent
+ Universal.foreground: DexTheme.foregroundColor
+ Universal.background: DexTheme.backgroundColor
+
+ font.family: DexTypo.fontFamily
+ indicator: DexRectangle
+ {
+ id: indicator
+ anchors.verticalCenter: parent.verticalCenter
+ width: 52
+ height: 28
radius: 13
- color: control.checked ? theme.accentColor : 'transparent'
- border.color: theme.foregroundColor
-
- Rectangle {
- x: control.checked ? parent.width - width : 0
- width: 22
- height: 22
- radius: 11
- border.color: theme.foregroundColor
+
+ gradient: Gradient
+ {
+ orientation: Gradient.Horizontal
+ GradientStop { position: 0.0; color: DexTheme.buttonGradientEnabled1 }
+ GradientStop { position: 0.7; color: DexTheme.buttonGradientEnabled2 }
+ }
+
+ DexRectangle
+ {
+ visible: !control.checked
+ anchors.centerIn: parent
+ width: parent.width - 6
+ height: parent.height - 6
+ radius: parent.radius
+ color: DexTheme.backgroundColor
+ }
+
+ DexRectangle
+ {
+ x: control.checked ? parent.width - width - 4 : 4
+ anchors.verticalCenter: parent.verticalCenter
+ width: parent.width / 2 - 2
+ height: parent.height - 6
+ radius: parent.radius + 2
+
+ gradient: Gradient
+ {
+ orientation: Gradient.Horizontal
+ GradientStop { position: 0.0; color: control.checked ? DexTheme.backgroundColor : DexTheme.buttonGradientEnabled1 }
+ GradientStop { position: 0.7; color: control.checked ? DexTheme.backgroundColor : DexTheme.buttonGradientEnabled2 }
+ }
}
}
- DefaultMouseArea {
+
+ DefaultMouseArea
+ {
anchors.fill: parent
acceptedButtons: Qt.NoButton
}
diff --git a/atomic_defi_design/qml/Components/DexText.qml b/atomic_defi_design/qml/Components/DexText.qml
index 892d03a903..456b18b017 100644
--- a/atomic_defi_design/qml/Components/DexText.qml
+++ b/atomic_defi_design/qml/Components/DexText.qml
@@ -1,14 +1,19 @@
import QtQuick 2.15
import "../Constants"
+import App 1.0
Text {
property string text_value
property bool privacy: false
- Behavior on color { ColorAnimation { duration: Style.animationDuration } }
+ Behavior on color {
+ ColorAnimation {
+ duration: Style.animationDuration
+ }
+ }
- font: theme.textType.body1
- color: theme.foregroundColor
+ font: DexTypo.body1
+ color: DexTheme.foregroundColor
text: privacy && General.privacy_mode ? General.privacy_text : text_value
wrapMode: Text.WordWrap
@@ -20,4 +25,4 @@ Text {
cursorShape: parent.hoveredLink ? Qt.PointingHandCursor : Qt.ArrowCursor
acceptedButtons: Qt.NoButton
}
-}
+}
\ No newline at end of file
diff --git a/atomic_defi_design/qml/Components/DexTextArea.qml b/atomic_defi_design/qml/Components/DexTextArea.qml
index d612110e66..80cf2133b4 100644
--- a/atomic_defi_design/qml/Components/DexTextArea.qml
+++ b/atomic_defi_design/qml/Components/DexTextArea.qml
@@ -1,6 +1,7 @@
import QtQuick 2.15
import QtQuick.Controls 2.15
import "../Constants"
+import App 1.0
TextArea {
id: text_field
@@ -11,8 +12,16 @@ TextArea {
selectedTextColor: Style.colorSelectedText
selectionColor: Style.colorSelection
- Behavior on color { ColorAnimation { duration: Style.animationDuration } }
- Behavior on placeholderTextColor { ColorAnimation { duration: Style.animationDuration } }
+ Behavior on color {
+ ColorAnimation {
+ duration: Style.animationDuration
+ }
+ }
+ Behavior on placeholderTextColor {
+ ColorAnimation {
+ duration: Style.animationDuration
+ }
+ }
property bool remove_newline: true
wrapMode: TextEdit.Wrap
@@ -21,19 +30,19 @@ TextArea {
Keys.onTabPressed: nextItemInFocusChain().forceActiveFocus(Qt.TabFocusReason)
Keys.onPressed: {
- if(event.key === Qt.Key_Return) {
- if(onReturn !== undefined) {
+ if (event.key === Qt.Key_Return) {
+ if (onReturn !== undefined) {
onReturn()
}
// Ignore \n \r stuff
- if(remove_newline) event.accepted = true
+ if (remove_newline) event.accepted = true
}
}
onTextChanged: {
- if(remove_newline) {
- if(text.indexOf('\r') !== -1 || text.indexOf('\n') !== -1) {
+ if (remove_newline) {
+ if (text.indexOf('\r') !== -1 || text.indexOf('\n') !== -1) {
text = text.replace(/[\r\n]/, '')
}
}
@@ -43,7 +52,9 @@ TextArea {
selectByMouse: true
persistentSelection: true
- background: InnerBackground { auto_set_size: false }
+ background: InnerBackground {
+ auto_set_size: false
+ }
- RightClickMenu { }
-}
+ RightClickMenu {}
+}
\ No newline at end of file
diff --git a/atomic_defi_design/qml/Components/DexTextEdit.qml b/atomic_defi_design/qml/Components/DexTextEdit.qml
index c2433b4e01..1c034b5461 100644
--- a/atomic_defi_design/qml/Components/DexTextEdit.qml
+++ b/atomic_defi_design/qml/Components/DexTextEdit.qml
@@ -1,5 +1,6 @@
import QtQuick 2.15
import "../Constants"
+import App 1.0
TextEdit {
property string text_value
@@ -16,7 +17,11 @@ TextEdit {
selectedTextColor: Style.colorSelectedText
selectionColor: Style.colorSelection
- Behavior on color { ColorAnimation { duration: Style.animationDuration } }
+ Behavior on color {
+ ColorAnimation {
+ duration: Style.animationDuration
+ }
+ }
onLinkActivated: Qt.openUrlExternally(link)
@@ -25,4 +30,4 @@ TextEdit {
cursorShape: parent.hoveredLink ? Qt.PointingHandCursor : Qt.ArrowCursor
acceptedButtons: Qt.NoButton
}
-}
+}
\ No newline at end of file
diff --git a/atomic_defi_design/qml/Components/DexTextField.qml b/atomic_defi_design/qml/Components/DexTextField.qml
index fd61878b35..a8fb69dd97 100644
--- a/atomic_defi_design/qml/Components/DexTextField.qml
+++ b/atomic_defi_design/qml/Components/DexTextField.qml
@@ -1,6 +1,7 @@
import QtQuick 2.15
import QtQuick.Controls 2.15
import "../Constants"
+import App 1.0
TextField {
id: text_field
@@ -8,27 +9,39 @@ TextField {
property alias left_text: left_text.text_value
property alias right_text: right_text.text_value
- font: theme.textType.body2
- placeholderTextColor: theme.textPlaceHolderColor
- selectedTextColor: theme.textSelectedColor
- selectionColor: theme.textSelectionColor
- color: theme.foregroundColor
+ font: DexTypo.body2
+ placeholderTextColor: DexTheme.textPlaceHolderColor
+ selectedTextColor: DexTheme.textSelectedColor
+ selectionColor: DexTheme.textSelectionColor
+ color: DexTheme.foregroundColor
- Behavior on color { ColorAnimation { duration: Style.animationDuration } }
- Behavior on placeholderTextColor { ColorAnimation { duration: Style.animationDuration } }
+ Behavior on color {
+ ColorAnimation {
+ duration: Style.animationDuration
+ }
+ }
+ Behavior on placeholderTextColor {
+ ColorAnimation {
+ duration: Style.animationDuration
+ }
+ }
// Right click Context Menu
selectByMouse: true
persistentSelection: true
- background: InnerBackground { auto_set_size: false; radius: 10 }
+ background: DexRectangle {
+ color: DexTheme.backgroundDarkColor1
+ opacity: .4
+ radius: height/2
+ }
leftPadding: Math.max(0, left_text.width + 20)
rightPadding: Math.max(0, right_text.width + 20)
topPadding: 7
- RightClickMenu { }
+ RightClickMenu {}
DefaultText {
id: left_text
@@ -49,4 +62,4 @@ TextField {
font.pixelSize: text_field.font.pixelSize
}
-}
+}
\ No newline at end of file
diff --git a/atomic_defi_design/qml/Components/DexTooltip.qml b/atomic_defi_design/qml/Components/DexTooltip.qml
index 83e80b3b88..47d039466e 100644
--- a/atomic_defi_design/qml/Components/DexTooltip.qml
+++ b/atomic_defi_design/qml/Components/DexTooltip.qml
@@ -3,5 +3,7 @@ import QtQuick.Controls 2.15
ToolTip {
id: root
- background: FloatingBackground { auto_set_size: false }
-}
+ background: FloatingBackground {
+ auto_set_size: false
+ }
+}
\ No newline at end of file
diff --git a/atomic_defi_design/qml/Components/DexTradeBox.qml b/atomic_defi_design/qml/Components/DexTradeBox.qml
new file mode 100644
index 0000000000..4165a6fe33
--- /dev/null
+++ b/atomic_defi_design/qml/Components/DexTradeBox.qml
@@ -0,0 +1,351 @@
+import QtQuick 2.15
+import Qaterial 1.0 as Qaterial
+import QtQuick.Controls 2.15
+import QtQuick.Layouts 1.12
+import "../Exchange/Trade/"
+import App 1.0
+
+Rectangle {
+ id: _control
+ signal reload()
+
+ property bool hideHeader: false
+ property bool visibility: isVertical ? height >= 40 ? true : false : width >= 40 ? true : false
+ property bool hidden: false
+ property bool closed: false
+ property bool expandedVert: false
+ property bool expandedHort: false
+ property bool showed: true
+ property bool canBeFull: false
+ property bool duplicable: false
+ property bool closable: false
+ property bool expandable: true
+ property bool fullScreen: false
+ property string title: "Default Title"
+ property int minimumHeight: isVertical ? 40 : 250
+ property int minimumWidth: isVertical ? 40 : 250
+ property int maximumHeight: 9999999
+ property int maximumWidth: 9999999
+ property int defaultHeight: 250
+ property int defaultWidth: 250
+ property bool reloadable: false
+ property bool contentVisible: !hidden
+ property bool isVertical: _control.parent.parent.orientation === Qt.Vertical
+ radius: 3
+
+ function setHeight(height) {
+ SplitView.preferredHeight = height
+ }
+
+ function setWidth(width) {
+ SplitView.preferredWidth = width
+ }
+
+ onHiddenChanged: {
+ if (isVertical && hidden) {
+ SplitView.preferredHeight = 40
+ SplitView.minimumHeight = 40
+ SplitView.maximumHeight = 40
+ } else if (isVertical && !hidden) {
+ SplitView.preferredHeight = defaultHeight
+ SplitView.minimumHeight = minimumHeight
+ SplitView.maximumHeight = maximumHeight
+ SplitView.fillHeight = true
+ SplitView.view.update()
+ } else if (!isVertical && hidden) {
+ SplitView.preferredWidth = 40
+ SplitView.minimumWidth = 40
+ SplitView.maximumWidth = 40
+ } else if (!isVertical && !hidden) {
+ SplitView.preferredWidth = defaultWidth
+ SplitView.minimumWidth = minimumWidth
+ SplitView.maximumWidth = maximumWidth
+ SplitView.fillWidth = true
+
+ }
+ }
+
+ color: DexTheme.proviewItemBoxBackgroundColor
+ border.color: DexTheme.proviewItemBoxBorderColor
+ border.width: DexTheme.proviewItemBoxBorderWidth
+
+ property alias titleLabel: _texto
+
+ function setFalseHeight() {
+ SplitView.fillHeight = false
+ }
+
+ onExpandedVertChanged: {
+ let splitManager = SplitView.view
+ if (expandedVert) {
+ if (splitManager !== null) {
+ for (var i = 0; i < splitManager.itemLists.length; i++) {
+ let item = splitManager.itemLists[i]
+ if (item !== _control) {
+ try {
+ item.expandedVert = false
+ item.setFalseHeight()
+ } catch (e) {}
+ }
+ }
+ SplitView.fillHeight = true
+ }
+ } else {
+ var setted = false
+ if (splitManager !== null) {
+ for (var i = 0; i < splitManager.itemLists.length; i++) {
+ let item = splitManager.itemLists[i]
+ if (item !== _control && setted === false) {
+ try {
+ item.expandedVert = true
+ setted = true
+ } catch (e) {}
+ }
+ }
+ setFalseHeight()
+ }
+ }
+ }
+
+ function setFalseWidth() {
+ SplitView.fillWidth = false
+ }
+
+ /*onExpandedHortChanged: {
+ let splitManager = SplitView.view
+ if(expandedHort) {
+ if(splitManager==null){
+ for(var i=0; i API.app_name
+import "../Constants"
+import App 1.0 //> API.app_name
BasicModal {
id: root
@@ -28,12 +29,14 @@ BasicModal {
DefaultFlickable {
anchors.fill: parent
anchors.margins: 20
+ anchors.rightMargin: 0
- contentWidth: eula_text.width
+ contentWidth: eula_text.width - 10
contentHeight: eula_text.height
- DefaultText {
+ DexLabel {
id: eula_text
+ font: DexTypo.body1
text_value: getEula()
width: eula_rect.width - 40
@@ -42,42 +45,54 @@ BasicModal {
}
// Checkboxes
- DefaultCheckBox {
+ DexCheckBox {
id: accept_eula
visible: !close_only
text: qsTr("Accept EULA")
}
- DefaultCheckBox {
+ DexCheckBox {
id: accept_tac
visible: !close_only
text: qsTr("Accept Terms and Conditions")
}
// Buttons
- footer: [
- DefaultButton {
- text: close_only ? qsTr("Close") : qsTr("Cancel")
+ footer:
+ [
+ Row
+ {
+ width: root.width - 40
+ height: 50
+ spacing: 10
+ layoutDirection: Qt.RightToLeft
Layout.fillWidth: true
- onClicked: root.close()
- },
+ Layout.alignment: Qt.AlignRight
+ DexAppButton
+ {
+ text: close_only ? qsTr("Close") : qsTr("Cancel")
+ Layout.fillWidth: true
+ onClicked: root.close()
+ }
- PrimaryButton {
- visible: !close_only
- text: qsTr("Confirm")
- Layout.fillWidth: true
- enabled: accept_eula.checked && accept_tac.checked
- onClicked: {
- onConfirm()
- root.close()
+ DexAppOutlineButton
+ {
+ visible: !close_only
+ text: qsTr("Confirm")
+ Layout.fillWidth: true
+ enabled: accept_eula.checked && accept_tac.checked
+ onClicked:
+ {
+ onConfirm()
+ root.close()
+ }
}
}
]
}
function getEula() {
- return qsTr(
-"This End-User License Agreement ('EULA') is a legal agreement between you and Komodo Platform.
+ return "This End-User License Agreement ('EULA') is a legal agreement between you and Komodo Platform.
This EULA agreement governs your acquisition and use of our %1 software ('Software', 'Mobile Application', 'Application' or 'App') directly from Komodo Platform or indirectly through a Komodo Platform authorized entity, reseller or distributor (a 'Distributor').
Please read this EULA agreement carefully before completing the installation process and using the %1 software. It provides a license to use the %1 software and contains warranty information and liability disclaimers.
@@ -111,6 +126,6 @@ BasicModal {
This EULA agreement, and any dispute arising out of or in connection with this EULA agreement, shall be governed by and construed in accordance with the laws of Vietnam.
This document was last updated on January 31st, 2020
"
- ).arg(API.app_name)
+ .arg(API.app_name)
}
}
diff --git a/atomic_defi_design/qml/Components/FloatingBackground.qml b/atomic_defi_design/qml/Components/FloatingBackground.qml
index c323aff56f..46851ad588 100644
--- a/atomic_defi_design/qml/Components/FloatingBackground.qml
+++ b/atomic_defi_design/qml/Components/FloatingBackground.qml
@@ -1,6 +1,7 @@
import QtQuick 2.15
import QtGraphicalEffects 1.0
import "../Constants"
+import App 1.0
Item {
id: root
@@ -8,8 +9,8 @@ Item {
property alias color: rect.color
property double border_gradient_start_pos: 0.35
property double border_gradient_end_pos: 0.65
- property color border_color_start: theme.colorInnerShadowTop
- property color border_color_end: theme.colorInnerShadowBottom
+ property color border_color_start: DexTheme.theme === "light" ? DexTheme.contentColorTopBold : DexTheme.colorInnerShadowTop
+ property color border_color_end: DexTheme.theme === "light" ? DexTheme.contentColorTopBold : DexTheme.colorInnerShadowBottom
property alias radius: rect.radius
property alias border: rect.border
property alias inner_space: inner_space
@@ -21,6 +22,7 @@ Item {
property bool show_shadow: true
property alias light_gradient: _linear_gradient
property alias black_shadow: _black_shadow
+ property bool topShadowVisible: show_shadow
readonly property var visible_rect: opacity_mask_enabled ? mask_loader : rect
@@ -30,7 +32,7 @@ Item {
DefaultRectangle {
id: rect
anchors.fill: parent
- border.color: "transparent"
+ border.color: DexTheme.contentColorTop
Loader {
anchors.centerIn: parent
@@ -73,13 +75,13 @@ Item {
anchors.fill: visible_rect
source: visible_rect
cached: false
- visible: show_shadow
+ visible: topShadowVisible
horizontalOffset: verticalShadow ? 0 : -6
verticalOffset: verticalShadow ? -10 : -6
radius: verticalShadow ? 25 : 15
samples: 32
spread: 0
- color: verticalShadow ? theme.floatShadow2 : theme.floatShadow1
+ color: verticalShadow ? DexTheme.floatShadow2 : DexTheme.floatShadow1
smooth: true
z: -2
}
@@ -95,7 +97,7 @@ Item {
radius: verticalShadow ? 25 : 20
samples: 32
spread: 0
- color: theme.floatBoxShadowDark
+ color: DexTheme.floatBoxShadowDark
smooth: true
z: -2
}
diff --git a/atomic_defi_design/qml/Components/GradientRectangle.qml b/atomic_defi_design/qml/Components/GradientRectangle.qml
index 3fcda07744..f7f54b1e1e 100644
--- a/atomic_defi_design/qml/Components/GradientRectangle.qml
+++ b/atomic_defi_design/qml/Components/GradientRectangle.qml
@@ -1,5 +1,6 @@
import QtQuick 2.15
import "../Constants"
+import App 1.0
Rectangle {
property alias orientation: gradient.orientation
@@ -7,10 +8,10 @@ Rectangle {
property alias start_pos: g_start.position
property alias end_pos: g_end.position
- property color start_color: theme.sideBarGradient1
- property color end_color: theme.sideBarGradient2
- Behavior on start_color { ColorAnimation { duration: Style.animationDuration } }
- Behavior on end_color { ColorAnimation { duration: Style.animationDuration } }
+ property color start_color: DexTheme.sideBarGradient1
+ property color end_color: DexTheme.sideBarGradient2
+ //Behavior on start_color { ColorAnimation { duration: Style.animationDuration } }
+ //Behavior on end_color { ColorAnimation { duration: Style.animationDuration } }
gradient: Gradient {
id: gradient
diff --git a/atomic_defi_design/qml/Components/HelpModal.qml b/atomic_defi_design/qml/Components/HelpModal.qml
new file mode 100644
index 0000000000..1a0fad4bda
--- /dev/null
+++ b/atomic_defi_design/qml/Components/HelpModal.qml
@@ -0,0 +1,11 @@
+import QtQuick 2.12
+
+BasicModal
+{
+ property string helpSentence
+ property alias title: _content.title
+
+ width: 500
+
+ ModalContent { id: _content; DexLabel { text: helpSentence } }
+}
diff --git a/atomic_defi_design/qml/Components/HideFieldButton.qml b/atomic_defi_design/qml/Components/HideFieldButton.qml
index c68d558069..7ebf622afb 100644
--- a/atomic_defi_design/qml/Components/HideFieldButton.qml
+++ b/atomic_defi_design/qml/Components/HideFieldButton.qml
@@ -1,5 +1,6 @@
import QtQuick 2.15
import "../Constants"
+import App 1.0
DefaultImage {
property alias mouse_area: mouse_area
diff --git a/atomic_defi_design/qml/Components/HorizontalLine.qml b/atomic_defi_design/qml/Components/HorizontalLine.qml
index 20dcaeaa1a..3d5edaa8e6 100644
--- a/atomic_defi_design/qml/Components/HorizontalLine.qml
+++ b/atomic_defi_design/qml/Components/HorizontalLine.qml
@@ -1,5 +1,6 @@
import QtQuick 2.15
import "../Constants"
+import App 1.0
AnimatedRectangle {
height: 2
@@ -7,7 +8,7 @@ AnimatedRectangle {
gradient: Gradient {
orientation: Qt.Vertical
- GradientStop { position: 0.0; color: light ? theme.colorLineGradient3 : theme.colorLineGradient2 }
- GradientStop { position: 1.0; color: light ? theme.colorLineGradient4 : theme.colorLineGradient1 }
+ GradientStop { position: 0.0; color: light ? DexTheme.colorLineGradient3 : DexTheme.colorLineGradient2 }
+ GradientStop { position: 1.0; color: light ? DexTheme.colorLineGradient4 : DexTheme.colorLineGradient1 }
}
}
diff --git a/atomic_defi_design/qml/Components/InnerBackground.qml b/atomic_defi_design/qml/Components/InnerBackground.qml
index 03c5813082..9f26a4d64f 100644
--- a/atomic_defi_design/qml/Components/InnerBackground.qml
+++ b/atomic_defi_design/qml/Components/InnerBackground.qml
@@ -2,6 +2,7 @@ import QtQuick 2.15
import QtGraphicalEffects 1.12
import Qaterial 1.0 as Qaterial
import "../Constants"
+import App 1.0
Item {
id: control
@@ -13,18 +14,18 @@ Item {
property bool auto_set_size: true
implicitWidth: auto_set_size ? inner_space.width : 0
implicitHeight: auto_set_size ? inner_space.height : 0
- property color bottomBorderColor: theme.colorInnerShadowBottom
- property color topBorderColor: theme.colorInnerShadowTop
-
+ property color bottomBorderColor: DexTheme.theme === "light" ? DexTheme.contentColorTopBold : DexTheme.colorInnerShadowBottom
+ property color topBorderColor: DexTheme.theme === "light" ? DexTheme.contentColorTopBold : DexTheme.colorInnerShadowTop
+
Item {
id: rect_with_shadow
anchors.fill: parent
- DefaultRectangle {
+ DexRectangle {
id: rect
anchors.fill: parent
- border.color: "transparent"
- color: theme.backgroundColor
+ color: DexTheme.contentColorTop
+ border.color: color
Loader {
anchors.centerIn: parent
diff --git a/atomic_defi_design/qml/Components/LinkIcon.qml b/atomic_defi_design/qml/Components/LinkIcon.qml
index d144cd8b2e..7bf5fbc81f 100644
--- a/atomic_defi_design/qml/Components/LinkIcon.qml
+++ b/atomic_defi_design/qml/Components/LinkIcon.qml
@@ -1,6 +1,7 @@
import QtQuick 2.15
import QtQuick.Layouts 1.15
import "../Constants"
+import App 1.0
Circle {
property string link
diff --git a/atomic_defi_design/qml/Components/LinksRow.qml b/atomic_defi_design/qml/Components/LinksRow.qml
index 0048b29024..159a8a8664 100644
--- a/atomic_defi_design/qml/Components/LinksRow.qml
+++ b/atomic_defi_design/qml/Components/LinksRow.qml
@@ -3,7 +3,8 @@ import QtQuick 2.15
import QtQuick.Layouts 1.15
// Project Imports
-import "../Constants" //> API
+import "../Constants"
+import App 1.0 //> API
RowLayout {
spacing: 10
diff --git a/atomic_defi_design/qml/Components/MinTradeModal.qml b/atomic_defi_design/qml/Components/MinTradeModal.qml
index fc951ed5ce..865db370c3 100644
--- a/atomic_defi_design/qml/Components/MinTradeModal.qml
+++ b/atomic_defi_design/qml/Components/MinTradeModal.qml
@@ -4,6 +4,7 @@ import QtQuick.Layouts 1.15
// Project Imports
import "../Constants"
+import App 1.0
BasicModal {
id: root
diff --git a/atomic_defi_design/qml/Components/ModalContent.qml b/atomic_defi_design/qml/Components/ModalContent.qml
index f863eca63c..15ec0da77e 100644
--- a/atomic_defi_design/qml/Components/ModalContent.qml
+++ b/atomic_defi_design/qml/Components/ModalContent.qml
@@ -1,46 +1,57 @@
+//! Qt Imports
import QtQuick 2.15
import QtQuick.Layouts 1.15
-import "../Constants"
-// Inside modal
-ColumnLayout {
- id: modal_content
+//! Project Imports
+import "../Constants"
+import App 1.0
+// The content of a modal. Must be a child of a `BasicModal` component.
+ColumnLayout
+{
Layout.fillWidth: true
-
- property alias title: header.title
- default property alias content: inner_layout.data
- property alias footer: footer.data
-
- ModalHeader {
- id: header
+ property alias title: _header.title
+ default property alias content: _innerLayout.data
+ property alias footer: _footer.data
+ spacing: 10
+
+ ModalHeader {
+ id: _header
+ Layout.leftMargin: 30
}
- DefaultFlickable {
- id: flickable
+ DexFlickable
+ {
+ id: _flickable
+
+ readonly property int padding: 25
flickableDirection: Flickable.VerticalFlick
+ rightMargin: -1
+
Layout.preferredWidth: contentWidth
Layout.preferredHeight: contentHeight
Layout.maximumHeight: window.height - 200
- readonly property int padding: 25
- contentWidth: inner_layout.width + flickable.padding // Padding is for preventing shadows effect being cut
- contentHeight: inner_layout.height + flickable.padding
+ contentWidth: _innerLayout.width + padding // Padding is for preventing shadows effect being cut
+ contentHeight: _innerLayout.height + padding
- ColumnLayout {
- id: inner_layout
+ ColumnLayout
+ {
+ id: _innerLayout
spacing: Style.rowSpacing
anchors.centerIn: parent
- width: root.width - root.padding*2 - flickable.padding
+ width: _modalWidth - (_modalPadding * 2) - _flickable.padding
}
}
- // Buttons
- RowLayout {
- id: footer
- anchors.topMargin: Style.rowSpacing
+ RowLayout // Footer
+ {
+ id: _footer
+ Layout.topMargin: Style.rowSpacing
+ Layout.rightMargin: 40
+ Layout.leftMargin: 40
spacing: Style.buttonSpacing
}
}
diff --git a/atomic_defi_design/qml/Components/ModalHeader.qml b/atomic_defi_design/qml/Components/ModalHeader.qml
index 241560a9e4..73d178ca73 100644
--- a/atomic_defi_design/qml/Components/ModalHeader.qml
+++ b/atomic_defi_design/qml/Components/ModalHeader.qml
@@ -1,6 +1,7 @@
import QtQuick 2.15
import QtQuick.Layouts 1.15
import "../Constants"
+import App 1.0
ColumnLayout {
property alias title: title.text
@@ -8,10 +9,10 @@ ColumnLayout {
// Title
DefaultText {
id: title
- font.pixelSize: Style.textSize2
+ font: DexTypo.head6
}
- HorizontalLine {
+ Item {
Layout.fillWidth: true
}
}
diff --git a/atomic_defi_design/qml/Components/Pagination.qml b/atomic_defi_design/qml/Components/Pagination.qml
index b3cf888384..8d5daafee8 100644
--- a/atomic_defi_design/qml/Components/Pagination.qml
+++ b/atomic_defi_design/qml/Components/Pagination.qml
@@ -3,11 +3,53 @@ import QtQuick.Layouts 1.15
import QtQuick.Controls 2.15
import Qaterial 1.0 as Qaterial
import "../Constants"
+import App 1.0
RowLayout {
+ id: control
property int visible_page: API.app.orders_mdl.current_page
property int page_count: API.app.orders_mdl.nb_pages
+ property int current_page: 0
+ ListModel {
+ id: vPage
+ function push(i) {
+ append({"element": i})
+ }
+ }
+ function paginator() {
+ let totalcount = control.page_count;
+ let currentPage = control.current_page;
+
+ vPage.clear()
+
+ if (totalcount <= 5) {
+ for (let i = 1; i <= totalcount; i++) {
+ vPage.push(i);
+ }
+ }
+ else {
+ if(current_page>=3) {
+ for (let i = current_page-2; i <= totalcount; i++) {
+ vPage.push(i);
+ }
+ } else {
+ for (let i = 1; i <= totalcount; i++) {
+ vPage.push(i);
+ }
+ }
+
+ }
+
+ function addButton(number) {
+ return number
+ }
+ return vPage;
+
+ }
+ Component.onCompleted: paginator()
+ onCurrent_pageChanged: paginator()
+ onPage_countChanged: paginator()
DefaultComboBox {
readonly property int item_count: API.app.orders_mdl.limit_nb_elements
@@ -32,14 +74,14 @@ RowLayout {
}
PaginationButton {
- Layout.preferredWidth: 40
- Layout.preferredHeight: 40
+ Layout.preferredWidth: 30
+ Layout.preferredHeight: 30
radius: 20
opacity: enabled? 1 : .5
Qaterial.ColorIcon {
anchors.centerIn: parent
- color: theme.foregroundColor
+ color: DexTheme.foregroundColor
source: Qaterial.Icons.skipPreviousOutline
}
enabled: visible_page > 1
@@ -48,14 +90,15 @@ RowLayout {
spacing: 10
Repeater {
- model: paginate(visible_page, page_count)
+ model: vPage//paginate(visible_page, page_count)
delegate: PaginationButton {
- text: model.modelData
+ text: element
radius: 30
- Layout.preferredWidth: 40
- Layout.preferredHeight: 40
+ Layout.preferredWidth: 50
+ Layout.preferredHeight: 50
Layout.alignment: Qt.AlignVCenter
- button_type: model.modelData === visible_page ? "primary" : "default"
+ colorEnabled: element === visible_page ? 'transparent' : DexTheme.buttonColorEnabled
+ colorTextEnabled: element === visible_page ? DexTheme.accentColor : DexTheme.buttonColorTextEnabled
onClicked: {
if(visible_page !== model.modelData)
API.app.orders_mdl.current_page = model.modelData
@@ -63,14 +106,14 @@ RowLayout {
}
}
PaginationButton {
- Layout.preferredWidth: 40
- Layout.preferredHeight: 40
+ Layout.preferredWidth: 30
+ Layout.preferredHeight: 30
radius: 20
opacity: enabled? 1 : .5
Qaterial.ColorIcon {
anchors.centerIn: parent
- color: theme.foregroundColor
+ color: DexTheme.foregroundColor
source: Qaterial.Icons.skipNextOutline
}
enabled: page_count > 1 && visible_page < page_count
diff --git a/atomic_defi_design/qml/Components/PaginationButton.qml b/atomic_defi_design/qml/Components/PaginationButton.qml
index 8cf7cafd53..055e01f7a5 100644
--- a/atomic_defi_design/qml/Components/PaginationButton.qml
+++ b/atomic_defi_design/qml/Components/PaginationButton.qml
@@ -2,8 +2,9 @@ import QtQuick 2.15
import QtQuick.Layouts 1.15
import QtQuick.Controls 2.15
import "../Constants"
+import App 1.0
-DefaultButton {
- font.pixelSize: Style.textSizeSmall4
+DexButton {
+ font.pixelSize: 12
minWidth: 0
}
diff --git a/atomic_defi_design/qml/Components/PasswordField.qml b/atomic_defi_design/qml/Components/PasswordField.qml
index 9992ccf2f9..929972978b 100644
--- a/atomic_defi_design/qml/Components/PasswordField.qml
+++ b/atomic_defi_design/qml/Components/PasswordField.qml
@@ -2,6 +2,8 @@ import QtQuick 2.15
import QtQuick.Layouts 1.15
import "../Constants"
+import App 1.0
+
ColumnLayout {
property alias title: pw.title
property alias field: pw.field
@@ -43,7 +45,7 @@ ColumnLayout {
}
function hintColor(valid) {
- return valid ? Style.colorGreen : Style.colorRed
+ return valid ? DexTheme.greenColor : DexTheme.redColor
}
function hintPrefix(valid) {
diff --git a/atomic_defi_design/qml/Components/PasswordForm.qml b/atomic_defi_design/qml/Components/PasswordForm.qml
index 97841b2813..5230f3c6a6 100644
--- a/atomic_defi_design/qml/Components/PasswordForm.qml
+++ b/atomic_defi_design/qml/Components/PasswordForm.qml
@@ -1,6 +1,7 @@
import QtQuick 2.15
import QtQuick.Layouts 1.15
import "../Constants"
+import App 1.0
ColumnLayout {
id: form
diff --git a/atomic_defi_design/qml/Components/PlusButton.qml b/atomic_defi_design/qml/Components/PlusButton.qml
index abc3e0e154..c2c9a31a1a 100644
--- a/atomic_defi_design/qml/Components/PlusButton.qml
+++ b/atomic_defi_design/qml/Components/PlusButton.qml
@@ -1,5 +1,6 @@
import QtQuick 2.15
import "../Constants"
+import App 1.0
// Add button
DefaultButton {
diff --git a/atomic_defi_design/qml/Components/RestartModal.qml b/atomic_defi_design/qml/Components/RestartModal.qml
index c5606184bd..f36bce9284 100644
--- a/atomic_defi_design/qml/Components/RestartModal.qml
+++ b/atomic_defi_design/qml/Components/RestartModal.qml
@@ -1,61 +1,68 @@
+//! Qt Imports
import QtQuick 2.15
import QtQuick.Layouts 1.15
import QtQuick.Controls 2.15
+//! Project Imports
import "../Constants"
+import App 1.0
BasicModal
{
id: root
- closePolicy: Popup.NoAutoClose
+ property double durationBeforeRestart: 5 // Duration in seconds before the modal restarts the application.
+ property string reasonMsg: "" // A reason message to display to the user.
+ property var onTimerEnded: () => {} // A callback to call when the modal is about to restart the application.
- onOpened: restart_timer.restart()
+ property double _timeLeft: durationBeforeRestart // Stores the current time left. It is calculated by `_restartTimer` object.
- readonly property double total_time: 5
- property double time_left: total_time
- property bool restart_requested: false
- property var task_before_restart: () => {}
- property string reason: ""
- Timer
- {
- id: restart_timer
- interval: 100
- repeat: true
- onTriggered: time_left -= interval / 1000
- }
+ function restartNow() { _timeLeft = 0 } // Do not wait and restarts the application immediately.
+
+ closePolicy: Popup.NoAutoClose // Disallows modal closing.
- onTime_leftChanged:
+ onOpened: _restartTimer.restart()
+ on_TimeLeftChanged:
{
- if (time_left <= 0 && !restart_requested)
+ if (_timeLeft <= 0)
{
console.log("Restarting the application...")
- restart_timer.stop()
- restart_requested = true
- time_left = 0
- task_before_restart()
+ _restartTimer.stop()
+ onTimerEnded()
API.app.restart()
}
}
-
ModalContent
{
+ Layout.fillWidth: true
title: qsTr("Applying the changes...")
- DefaultText
+ Timer
+ {
+ id: _restartTimer
+
+ interval: 100
+ repeat: true
+
+ onTriggered: _timeLeft -= interval / 1000 // Calculates time left.
+ }
+
+ DexLabel
{
- text_value: reason !== "" ? qsTr("Restarting the applications. %1").arg(reason) : qsTr("Restarting the application...")
+ //! Positioning.
Layout.alignment: Qt.AlignHCenter
- Layout.fillWidth: true
+
+ text_value: reasonMsg !== "" ? qsTr("Restarting the application. %1").arg(reasonMsg) : qsTr("Restarting the application...")
}
- DefaultBusyIndicator { Layout.alignment: Qt.AlignHCenter }
+ DexBusyIndicator { Layout.alignment: Qt.AlignHCenter }
- DefaultText
+ DexLabel
{
- text_value: General.formatDouble(time_left, 1, true)
Layout.alignment: Qt.AlignHCenter
+ text_value: General.formatDouble(_timeLeft, 1, true)
+ font: atomic_fixed_font
}
}
}
diff --git a/atomic_defi_design/qml/Components/Separator.qml b/atomic_defi_design/qml/Components/Separator.qml
index 8cfda0e9dc..9b637866d9 100644
--- a/atomic_defi_design/qml/Components/Separator.qml
+++ b/atomic_defi_design/qml/Components/Separator.qml
@@ -1,5 +1,6 @@
import QtQuick 2.15
import "../Constants"
+import App 1.0
Rectangle {
height: 1
diff --git a/atomic_defi_design/qml/Components/SetupPage.qml b/atomic_defi_design/qml/Components/SetupPage.qml
index 08a77450c5..c4e5cfd632 100644
--- a/atomic_defi_design/qml/Components/SetupPage.qml
+++ b/atomic_defi_design/qml/Components/SetupPage.qml
@@ -2,15 +2,18 @@ import QtQuick 2.15
import QtQuick.Layouts 1.15
import QtQuick.Controls 2.15
import "../Constants"
+import App 1.0
Item {
+ id: _control
property alias image: image
property alias image_path: image.source
property alias image_scale: image.scale
property alias content: inner_space.sourceComponent
property alias bottom_content: bottom_content.sourceComponent
property double image_margin: 5
-
+ property string backgroundColor: DexTheme.dexBoxBackgroundColor
+ property string borderColor: DexTheme.rectangleBorderColor
ColumnLayout {
id: window_layout
@@ -35,14 +38,17 @@ Item {
rightPadding: leftPadding
topPadding: leftPadding * 0.5
bottomPadding: topPadding
-
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
- background: FloatingBackground {
- color: theme.backgroundColor
+ background: DexRectangle {
+ color: _control.backgroundColor
+ border {
+ color: DexTheme.portfolioPieGradient ? 'transparent' : _control.borderColor
+ }
+ gradient: DexTheme.portfolioPieGradient ? app.globalGradient : undefined
}
- Loader {
+ contentChildren: Loader {
id: inner_space
}
}
diff --git a/atomic_defi_design/qml/Components/SidebarPanel.qml b/atomic_defi_design/qml/Components/SidebarPanel.qml
index b7693a9717..8bb4727b37 100644
--- a/atomic_defi_design/qml/Components/SidebarPanel.qml
+++ b/atomic_defi_design/qml/Components/SidebarPanel.qml
@@ -1,11 +1,12 @@
import QtQuick 2.15
import "../Constants"
+import App 1.0
GradientRectangle {
id: rect
- radius: theme.rectangleRadius
- color: theme.backgroundColor
- border.color: theme.hightlightColor
+ radius: DexTheme.rectangleRadius
+ color: DexTheme.backgroundColor
+ border.color: DexTheme.leftSidebarBorderColor
border.width: 1
}
diff --git a/atomic_defi_design/qml/Components/SwapIcon.qml b/atomic_defi_design/qml/Components/SwapIcon.qml
index 54fc19959a..8a04906527 100644
--- a/atomic_defi_design/qml/Components/SwapIcon.qml
+++ b/atomic_defi_design/qml/Components/SwapIcon.qml
@@ -1,6 +1,7 @@
import QtQuick 2.15
import Qaterial 1.0 as Qaterial
import "../Constants"
+import App 1.0
Item {
diff --git a/atomic_defi_design/qml/Components/TextAreaWithTitle.qml b/atomic_defi_design/qml/Components/TextAreaWithTitle.qml
index ba4cd4c951..b9f151f896 100644
--- a/atomic_defi_design/qml/Components/TextAreaWithTitle.qml
+++ b/atomic_defi_design/qml/Components/TextAreaWithTitle.qml
@@ -1,8 +1,11 @@
import QtQuick 2.15
import QtQuick.Layouts 1.15
+import Qaterial 1.0 as Qaterial
import "../Constants"
+import App 1.0
ColumnLayout {
+ id: control
property alias title: title_text.text
property alias field: input_field
property alias save_button: save_button
@@ -18,6 +21,7 @@ ColumnLayout {
property bool saveable: false
signal saved()
+ signal copied()
// Local
function reset() {
@@ -28,12 +32,50 @@ ColumnLayout {
TitleText {
id: title_text
Layout.alignment: Qt.AlignVCenter
+ Qaterial.Icon {
+ visible: control.copyable
+ Layout.alignment: Qt.AlignVCenter
+ x: title_text.implicitWidth + 10
+ size: 16
+ icon: Qaterial.Icons.contentCopy
+ color: copyArea.containsMouse ? DexTheme.accentColor : DexTheme.foregroundColor
+ DexMouseArea {
+ id: copyArea
+ anchors.fill: parent
+ hoverEnabled: true
+ onClicked: {
+ Qaterial.Clipboard.text = input_field.text
+ control.copied()
+ }
+ }
+ }
}
+ }
- DefaultButton {
+ Item {
+ Layout.fillWidth: true
+ Layout.preferredHeight: input_field.height + 5
+ DefaultTextArea {
+ id: input_field
+ enabled: !saveable
+ width: parent.width - 6
+ rightPadding: 10
+ anchors.centerIn: parent
+ background: DexRectangle {
+ color: DexTheme.dexBoxBackgroundColor
+ opacity: .4
+ radius: 8
+ }
+ HideFieldButton {
+ id: hide_button
+ }
+ }
+ DexAppButton {
+ anchors.verticalCenter: parent.verticalCenter
id: save_button
button_type: input_field.enabled ? "danger" : "primary"
- Layout.alignment: Qt.AlignVCenter
+ anchors.right: parent.right
+ anchors.rightMargin: 8
text: input_field.enabled ? qsTr("Save") : qsTr("Edit")
visible: saveable
onClicked: {
@@ -42,23 +84,11 @@ ColumnLayout {
}
font.pixelSize: Style.textSizeSmall
minWidth: 0
- implicitHeight: text_obj.height * 1.25
+ height: 20
}
}
- DefaultTextArea {
- id: input_field
- enabled: !saveable
- Layout.fillWidth: true
-
- HideFieldButton {
- id: hide_button
- }
-
- CopyFieldButton {
-
- }
- }
+
}
diff --git a/atomic_defi_design/qml/Components/TextEditWithTitle.qml b/atomic_defi_design/qml/Components/TextEditWithTitle.qml
index bb0379ad4c..6e6c454e57 100644
--- a/atomic_defi_design/qml/Components/TextEditWithTitle.qml
+++ b/atomic_defi_design/qml/Components/TextEditWithTitle.qml
@@ -1,24 +1,60 @@
import QtQuick 2.15
import QtQuick.Layouts 1.15
-import "../Constants"
+import Qaterial 1.0 as Qaterial
+import "../Constants" as Constants
+import App 1.0
ComponentWithTitle {
+ id: control
+
property alias text: text.text_value
property alias value_color: text.color
property alias privacy: text.privacy
- DexLabel {
- id: text
+ property bool copy: false
+ property string onCopyNotificationTitle: qsTr("Swap ID")
+ property string onCopyNotificationMsg: qsTr("copied to clipboard")
- clip: true
+ RowLayout {
Layout.fillWidth: true
- color: Style.modalValueColor
- textFormat: TextEdit.AutoText
- Layout.preferredHeight: show_content ? contentHeight : 0
- Behavior on Layout.preferredHeight { SmoothedAnimation { id: expand_animation; duration: Style.animationDuration * 2; velocity: -1 } }
+ DexLabel {
+ id: text
+
+ clip: true
+ textFormat: TextEdit.AutoText
+ Layout.alignment: Qt.AlignVCenter
+ Layout.preferredHeight: show_content ? contentHeight : 0
+ Behavior on Layout.preferredHeight { SmoothedAnimation { id: expand_animation; duration: Constants.Style.animationDuration * 2; velocity: -1 } }
+ color: DexTheme.foregroundColor
+
+
+
+ opacity: show_content ? 1 : 0
+ Behavior on opacity { SmoothedAnimation { duration: expand_animation.duration; velocity: -1 } }
+
+ }
+
+ Qaterial.Icon {
+ visible: control.copy
+ Layout.alignment: Qt.AlignVCenter
+ x: text.implicitWidth + 10
+ size: 16
+ icon: Qaterial.Icons.contentCopy
+ color: copyArea.containsMouse ? DexTheme.accentColor : DexTheme.foregroundColor
+ DexMouseArea {
+ id: copyArea
+ anchors.fill: parent
+ hoverEnabled: true
+ onClicked: {
+ Qaterial.Clipboard.text = control.text
+ app.notifyCopy(onCopyNotificationTitle, onCopyNotificationMsg)
+ }
+ }
+ }
- opacity: show_content ? 1 : 0
- Behavior on opacity { SmoothedAnimation { duration: expand_animation.duration; velocity: -1 } }
+ Item {
+ Layout.fillWidth: true
+ }
}
}
diff --git a/atomic_defi_design/qml/Components/TextFieldWithTitle.qml b/atomic_defi_design/qml/Components/TextFieldWithTitle.qml
index f65b2a50be..d333b2d03a 100644
--- a/atomic_defi_design/qml/Components/TextFieldWithTitle.qml
+++ b/atomic_defi_design/qml/Components/TextFieldWithTitle.qml
@@ -1,8 +1,10 @@
import QtQuick 2.15
import QtQuick.Layouts 1.15
import "../Constants"
+import App 1.0
ColumnLayout {
+ id: control
property alias title: title_text.text
property alias field: input_field
property alias hide_button: hide_button
@@ -22,6 +24,7 @@ ColumnLayout {
spacing: Style.rowSpacingSmall
RowLayout {
+ visible: control.title !== ""
TitleText {
id: title_text
visible: text !== ''
@@ -41,6 +44,7 @@ ColumnLayout {
echoMode: hidable && hiding ? TextInput.Password : TextInput.Normal
Layout.fillWidth: true
+ Layout.fillHeight: true
HideFieldButton {
id: hide_button
diff --git a/atomic_defi_design/qml/Components/TextWithTitle.qml b/atomic_defi_design/qml/Components/TextWithTitle.qml
index d015e24ca8..36ceaa778a 100644
--- a/atomic_defi_design/qml/Components/TextWithTitle.qml
+++ b/atomic_defi_design/qml/Components/TextWithTitle.qml
@@ -1,6 +1,7 @@
import QtQuick 2.15
import QtQuick.Layouts 1.15
import "../Constants"
+import App 1.0
ComponentWithTitle {
property alias text: text.text_value
@@ -12,7 +13,6 @@ ComponentWithTitle {
clip: true
Layout.fillWidth: true
- color: Style.modalValueColor
Layout.preferredHeight: show_content ? contentHeight : 0
Behavior on Layout.preferredHeight { SmoothedAnimation { id: expand_animation; duration: Style.animationDuration * 2; velocity: -1 } }
diff --git a/atomic_defi_design/qml/Components/TitleText.qml b/atomic_defi_design/qml/Components/TitleText.qml
index 0c135806f6..a621363a2d 100644
--- a/atomic_defi_design/qml/Components/TitleText.qml
+++ b/atomic_defi_design/qml/Components/TitleText.qml
@@ -1,5 +1,6 @@
import QtQuick 2.15
import "../Constants"
+import App 1.0
DexLabel {
diff --git a/atomic_defi_design/qml/Components/Toast.qml b/atomic_defi_design/qml/Components/Toast.qml
index 0616b1af7b..3351d60831 100644
--- a/atomic_defi_design/qml/Components/Toast.qml
+++ b/atomic_defi_design/qml/Components/Toast.qml
@@ -3,6 +3,7 @@
import QtQuick 2.15
import "../Constants"
+import App 1.0
AnimatedRectangle {
function show(text, duration, info, is_error) {
@@ -35,9 +36,10 @@ AnimatedRectangle {
radius: margin / 3
opacity: 0
- color: isError ? Style.colorRed : Style.colorTheme1
+ color: isError ? DexTheme.redColor : Style.colorTheme1
+ z: 1000
- DefaultText {
+ DexLabel {
id: message
color: "white"
wrapMode: Text.Wrap
diff --git a/atomic_defi_design/qml/Components/VerticalLine.qml b/atomic_defi_design/qml/Components/VerticalLine.qml
index fbf0ca9b0b..95c9c05168 100644
--- a/atomic_defi_design/qml/Components/VerticalLine.qml
+++ b/atomic_defi_design/qml/Components/VerticalLine.qml
@@ -1,5 +1,6 @@
import QtQuick 2.15
import "../Constants"
+import App 1.0
AnimatedRectangle {
width: 2
diff --git a/atomic_defi_design/qml/Components/VerticalLineBasic.qml b/atomic_defi_design/qml/Components/VerticalLineBasic.qml
index 2f02cc6241..d70b0c0614 100644
--- a/atomic_defi_design/qml/Components/VerticalLineBasic.qml
+++ b/atomic_defi_design/qml/Components/VerticalLineBasic.qml
@@ -1,5 +1,6 @@
import QtQuick 2.15
import "../Constants"
+import App 1.0
AnimatedRectangle {
width: 1
diff --git a/atomic_defi_design/qml/Constants/DexTheme.qml b/atomic_defi_design/qml/Constants/DexTheme.qml
new file mode 100644
index 0000000000..9f24443aa3
--- /dev/null
+++ b/atomic_defi_design/qml/Constants/DexTheme.qml
@@ -0,0 +1,576 @@
+pragma Singleton
+
+import QtQuick 2.15
+
+QtObject {
+
+ // Main Color
+
+ property string theme: "dark"
+
+ property color accentColor: Style.colorTheme4
+ property color backgroundColor: Style.colorTheme7
+ property color foregroundColor: Style.colorText
+ property color primaryColor: accentColor
+
+
+ property color backgroundLightColor0: backgroundColor
+ property color backgroundLightColor1: Qt.darker(backgroundColor, 0.9)
+ property color backgroundLightColor2: Qt.darker(backgroundColor, 0.8)
+ property color backgroundLightColor3: Qt.darker(backgroundColor, 0.7)
+ property color backgroundLightColor4: Qt.darker(backgroundColor, 0.6)
+ property color backgroundLightColor5: Qt.darker(backgroundColor, 0.5)
+
+ property color backgroundDarkColor0: backgroundColor
+ property color backgroundDarkColor1: Qt.lighter(backgroundColor, 0.9)
+ property color backgroundDarkColor2: Qt.lighter(backgroundColor, 0.8)
+ property color backgroundDarkColor3: Qt.lighter(backgroundColor, 0.7)
+ property color backgroundDarkColor4: Qt.lighter(backgroundColor, 0.6)
+ property color backgroundDarkColor5: Qt.lighter(backgroundColor, 0.5)
+ property color backgroundDarkColor6: Qt.lighter(backgroundColor, 0.4)
+ property color backgroundDarkColor7: Qt.lighter(backgroundColor, 0.3)
+ property color backgroundDarkColor8: Qt.lighter(backgroundColor, 0.2)
+ property color backgroundDarkColor9: Qt.lighter(backgroundColor, 0.1)
+
+ property color accentLightColor0: accentColor
+ property color accentLightColor1: Qt.darker(accentColor, 0.9)
+ property color accentLightColor2: Qt.darker(accentColor, 0.8)
+ property color accentLightColor3: Qt.darker(accentColor, 0.7)
+ property color accentLightColor4: Qt.darker(accentColor, 0.6)
+ property color accentLightColor5: Qt.darker(accentColor, 0.5)
+
+ property color accentDarkColor0: accentColor
+ property color accentDarkColor1: Qt.lighter(accentColor, 0.9)
+ property color accentDarkColor2: Qt.lighter(accentColor, 0.8)
+ property color accentDarkColor3: Qt.lighter(accentColor, 0.7)
+ property color accentDarkColor4: Qt.lighter(accentColor, 0.6)
+ property color accentDarkColor5: Qt.lighter(accentColor, 0.5)
+ property color accentDarkColor6: Qt.lighter(accentColor, 0.4)
+ property color accentDarkColor7: Qt.lighter(accentColor, 0.3)
+ property color accentDarkColor8: Qt.lighter(accentColor, 0.2)
+ property color accentDarkColor9: Qt.lighter(accentColor, 0.1)
+
+ property color primaryColorLightColor0: primaryColor
+ property color primaryColorLightColor1: Qt.darker(primaryColor, 0.9)
+ property color primaryColorLightColor2: Qt.darker(primaryColor, 0.8)
+ property color primaryColorLightColor3: Qt.darker(primaryColor, 0.7)
+ property color primaryColorLightColor4: Qt.darker(primaryColor, 0.6)
+ property color primaryColorLightColor5: Qt.darker(primaryColor, 0.5)
+
+ property color primaryColorDarkColor0: primaryColor
+ property color primaryColorDarkColor1: Qt.lighter(primaryColor, 0.9)
+ property color primaryColorDarkColor2: Qt.lighter(primaryColor, 0.8)
+ property color primaryColorDarkColor3: Qt.lighter(primaryColor, 0.7)
+ property color primaryColorDarkColor4: Qt.lighter(primaryColor, 0.6)
+ property color primaryColorDarkColor5: Qt.lighter(primaryColor, 0.5)
+ property color primaryColorDarkColor6: Qt.lighter(primaryColor, 0.4)
+ property color primaryColorDarkColor7: Qt.lighter(primaryColor, 0.3)
+ property color primaryColorDarkColor8: Qt.lighter(primaryColor, 0.2)
+ property color primaryColorDarkColor9: Qt.lighter(primaryColor, 0.1)
+
+ property color foregroundColorLightColor0: foregroundColor
+ property color foregroundColorLightColor1: Qt.darker(foregroundColor, 0.9)
+ property color foregroundColorLightColor2: Qt.darker(foregroundColor, 0.8)
+ property color foregroundColorLightColor3: Qt.darker(foregroundColor, 0.7)
+ property color foregroundColorLightColor4: Qt.darker(foregroundColor, 0.6)
+ property color foregroundColorLightColor5: Qt.darker(foregroundColor, 0.5)
+
+ property color foregroundColorDarkColor0: foregroundColor
+ property color foregroundColorDarkColor1: Qt.lighter(foregroundColor, 0.9)
+ property color foregroundColorDarkColor2: Qt.lighter(foregroundColor, 0.8)
+ property color foregroundColorDarkColor3: Qt.lighter(foregroundColor, 0.7)
+ property color foregroundColorDarkColor4: Qt.lighter(foregroundColor, 0.6)
+ property color foregroundColorDarkColor5: Qt.lighter(foregroundColor, 0.5)
+ property color foregroundColorDarkColor6: Qt.lighter(foregroundColor, 0.4)
+ property color foregroundColorDarkColor7: Qt.lighter(foregroundColor, 0.3)
+ property color foregroundColorDarkColor8: Qt.lighter(foregroundColor, 0.2)
+ property color foregroundColorDarkColor9: Qt.lighter(foregroundColor, 0.1)
+
+ property color headTextColor: accentColor
+
+ property color proviewItemBoxBackgroundColor: dexBoxBackgroundColor
+ property color proviewItemBoxBorderColor: 'transparent'
+ property color proviewItemBoxTitleColor: headTextColor
+ property color proviewItemBoxIconColor: accentColor
+ property int proviewItemBoxBorderWidth: 0
+
+ property color comboBoxBorderColor: rectangleBorderColor
+ property color comboBoxBackgroundColor: dexBoxBackgroundColor
+
+
+ property bool walletSidebarShadowVisibility: true
+ property color walletSidebarLeftBorderColor: backgroundColorDeep
+
+
+ property color leftSidebarBorderColor: rectangleBorderColor
+ property color sideBarRightBorderColor: rectangleBorderColor
+ property int sidebarHightLightHeight: 44
+
+
+ property color contentColorTop: backgroundColor
+ property color contentColorTopBold: backgroundColor
+ property color tabBarBackgroudColor: accentColor
+ property color tradeFieldBoxBackgroundColor: backgroundColor
+ property color iconButtonColor: buttonColorEnabled
+ property color iconButtonForegroundColor: buttonColorTextEnabled
+
+ property bool portfolioPieGradient: false
+
+ property color arrowUpColor: redColor
+ property color arrowDownColor: greenColor
+
+
+
+ // Old Theme
+ property string chartTheme: Style.dark_theme ? "dark" : "light"
+
+ property color surfaceColor: backgroundDarkColor2
+ property color backgroundColorDeep: backgroundDarkColor2
+ property color dexBoxBackgroundColor: backgroundDarkColor6//Style.colorTheme9
+
+ property color hightlightColor: accentDarkColor3
+ property color hoverColor: buttonColorHovered
+ property color modalStepColor: accentColor
+ property color modelStepBorderColor: hightlightColor
+
+ property int sidebarShadowRadius: 32
+
+ property color sideBarGradient1: DexTheme.primaryColorDarkColor8
+ property color sideBarGradient2: DexTheme.primaryColorDarkColor4
+ property real sideBarAnimationDuration: Style.animationDuration
+
+ property color navigationSideBarButtonGradient1: DexTheme.accentLightColor2
+ property color navigationSideBarButtonGradient2: DexTheme.accentLightColor1
+ property color navigationSideBarButtonGradient3: DexTheme.accentDarkColor2
+ property color navigationSideBarButtonGradient4: Style.colorSidebarHighlightGradient4
+
+ property color chartTradingLineColor: Style.colorTrendingLine
+ property color chartTradingLineBackgroundColor: Style.colorTrendingUnderLine
+ property color lineChartColor: accentColor
+ property color chartGridLineColor: Qt.rgba(255,255,255,0.4)
+
+
+ // Button
+ property color buttonColorDisabled: DexTheme.accentDarkColor5
+ property color buttonColorHovered: DexTheme.accentLightColor4
+ property color buttonColorPressed: DexTheme.accentDarkColor4
+ property color buttonColorEnabled: DexTheme.accentLightColor2
+ property color buttonColorTextDisabled: DexTheme.backgroundDarkColor7
+ property color buttonColorTextHovered: DexTheme.backgroundDarkColor8
+ property color buttonColorTextEnabled: DexTheme.backgroundDarkColor9
+ property color buttonColorTextPressed: DexTheme.backgroundDarkColor0
+
+ property color buttonGradientEnabled1: DexTheme.buttonColorEnabled
+ property color buttonGradientEnabled2: DexTheme.buttonColorEnabled
+ property color buttonGradientTextEnabled: DexTheme.foregroundColor
+
+
+
+
+ property color colorInnerShadowBottom: Style.colorRectangleBorderGradient1
+ property color colorInnerShadowTop: Style.colorRectangleBorderGradient2
+
+ property color colorSidebarDropShadow: Style.colorSidebarDropShadow
+
+ property color barColor: Style.colorTheme5
+
+ property color colorLineGradient1: Style.colorLineGradient1
+ property color colorLineGradient2: Style.colorLineGradient2
+ property color colorLineGradient3: Style.colorLineGradient3
+ property color colorLineGradient4: Style.colorLineGradient4
+
+ property color floatShadow1: Style.colorDropShadowLight
+ property color floatShadow2: Style.colorDropShadowLight2
+ property color floatBoxShadowDark: Style.colorDropShadowDark
+
+ property color textSelectionColor: Style.colorSelection
+ property color textPlaceHolderColor: Style.colorPlaceholderText
+ property color textSelectedColor: Style.colorSelectedText
+ property color innerShadowColor: Style.colorInnerShadow
+
+ property color whiteblack: Style.colorWhite1
+ property color colorThemeDarkLight: Style.colorThemeDarkLight
+
+ property color rectangleBorderColor: DexTheme.backgroundDarkColor2
+
+ property color colorScrollbarGradient1: Style.colorScrollbarGradient1
+ property color colorScrollbarGradient2: Style.colorScrollbarGradient2
+
+ property color greenColor: Style.colorGreen
+ property color redColor: Style.colorRed
+
+ // Widget settings
+
+ property int rectangleRadius: Style.rectangleCornerRadius
+
+ // Other Data
+
+ property string bigSidebarLogo: "dex-logo-sidebar.png"
+ property string smallSidebarLogo: "dex-logo.png"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ // Old
+
+ function setQaterialStyle() {
+ Qaterial.Style.accentColorLight = Style.colorTheme4
+ Qaterial.Style.accentColorDark = Style.colorTheme4
+ }
+
+ onDark_themeChanged: setQaterialStyle()
+
+
+ readonly property string listItemPrefix: " ⚬ "
+ readonly property string successCharacter: "✓"
+ readonly property string failureCharacter: "✘"
+ readonly property string warningCharacter: "⚠"
+
+ 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
+ readonly property int textSizeSmall3: 13
+ readonly property int textSizeSmall4: 14
+ readonly property int textSizeSmall5: 15
+ readonly property int textSize: 16
+ readonly property int textSizeMid: 17
+ readonly property int textSizeMid1: 18
+ readonly property int textSizeMid2: 19
+ readonly property int textSize1: 20
+ readonly property int textSize2: 24
+ readonly property int textSize3: 36
+ readonly property int textSize4: 48
+ readonly property int textSize5: 60
+ readonly property int textSize6: 72
+ readonly property int textSize7: 84
+ readonly property int textSize8: 96
+ readonly property int textSize9: 108
+ readonly property int textSize10: 120
+ readonly property int textSize11: 132
+ readonly property int textSize12: 144
+
+ readonly property int rectangleCornerRadius: 7
+ readonly property int itemPadding: 12
+ readonly property int buttonSpacing: 12
+ readonly property int rowSpacing: 12
+ readonly property int rowSpacingSmall: 6
+ readonly property int iconTextMargin: 5
+ readonly property int sidebarLineHeight: 44
+ readonly property double hoverLightMultiplier: 1.5
+ readonly property double hoverOpacity: 0.6
+
+ property bool dark_theme: true
+
+
+ function applyOpacity(hex, opacity="00") {
+ return "#" + opacity + hex.substr(hex.length - 6)
+ }
+
+ function colorOnlyIf(condition, color) {
+ return applyOpacity(color, condition ? "FF" : "00")
+ }
+
+ readonly property string colorQtThemeAccent: colorGreen
+ readonly property string colorQtThemeForeground: colorWhite1
+ readonly property string colorQtThemeBackground: colorTheme9
+
+ readonly property string sidebar_atomicdex_logo: dark_theme ? "dex-logo-sidebar.png" : "dex-logo-sidebar-dark.png"
+ readonly property string colorRed: dark_theme ? "#D13990" : "#9a1165" // Light is 15% darker than Red2, same with the green set
+ readonly property string colorRed2: dark_theme ? "#b61477" : "#b61477"
+ readonly property string colorRed3: dark_theme ? "#6d0c47" : "#D13990"
+ readonly property string colorYellow: dark_theme ? "#FFC305" : "#FFC305"
+ readonly property string colorOrange: dark_theme ? "#F7931A" : "#F7931A"
+ readonly property string colorBlue: dark_theme ? "#3B78D1" : "#3B78D1"
+ readonly property string colorGreen: dark_theme ? "#74FBEE" : "#109f8d"
+ readonly property string colorGreen2: dark_theme ? "#14bca6" : "#14bca6"
+ readonly property string colorGreen3: dark_theme ? "#07433b" : "#74FBEE"
+
+ readonly property string colorWhite1: dark_theme ? "#FFFFFF" : "#000000"
+ readonly property string colorWhite2: dark_theme ? "#F9F9F9" : "#111111"
+ readonly property string colorWhite3: dark_theme ? "#F0F0F0" : "#222222"
+ readonly property string colorWhite4: dark_theme ? "#C9C9C9" : "#333333"
+ readonly property string colorWhite5: dark_theme ? "#8E9293" : "#444444"
+ readonly property string colorWhite6: dark_theme ? "#777777" : "#555555"
+ readonly property string colorWhite7: dark_theme ? "#666666" : "#666666"
+ readonly property string colorWhite8: dark_theme ? "#555555" : "#777777"
+ readonly property string colorWhite9: dark_theme ? "#444444" : "#8E9293"
+ readonly property string colorWhite10: dark_theme ? "#333333" : "#C9C9C9"
+ readonly property string colorWhite11: dark_theme ? "#222222" : "#F0F0F0"
+ readonly property string colorWhite12: dark_theme ? "#111111" : "#F9F9F9"
+ readonly property string colorWhite13: dark_theme ? "#000000" : "#FFFFFF"
+
+ readonly property string colorTheme1: dark_theme ? "#3CC9BF" : "#3CC9BF"
+ readonly property string colorTheme2: dark_theme ? "#36A8AA" : "#36A8AA"
+ readonly property string colorTheme3: dark_theme ? "#318795" : "#318795"
+ readonly property string colorTheme4: dark_theme ? "#2B6680" : "#2B6680"
+ readonly property string colorTheme5: dark_theme ? "#23273C" : "#ececf2"
+ readonly property string colorTheme6: dark_theme ? "#22263A" : "#efeff5"
+ readonly property string colorTheme7: dark_theme ? "#15182A" : "#f2f2f7"
+ readonly property string colorTheme8: dark_theme ? "#171A2C" : "#f6f6f9"
+ readonly property string colorTheme9: dark_theme ? "#0E1021" : "#F9F9FB"
+ readonly property string colorTheme99: dark_theme ? "#2A2C3B" : "#F9F9FB"
+
+ readonly property string colorTheme10: dark_theme ? "#2579E0" : "#2579E0"
+ readonly property string colorTheme11: dark_theme ? "#00A3FF" : "#00A3FF"
+ readonly property string colorThemeLine: dark_theme ? "#1D1F23" : "#1D1F23"
+ readonly property string colorThemePassive: dark_theme ? "#777F8C" : "#777F8C"
+ readonly property string colorThemePassiveLight: dark_theme ? "#CCCDD0" : "#CCCDD0"
+ readonly property string colorThemeDark: dark_theme ? "#26282C" : "#26282C"
+ readonly property string colorThemeDark2: dark_theme ? "#3C4150" : "#E6E8ED"
+ readonly property string colorThemeDark3: dark_theme ? "#78808D" : "#78808D"
+ //readonly property string colorThemeDarkLight: dark_theme ? "#78808D" : "#456078"
+
+ 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 colorLineGradient1: dark_theme ? "#2c2f3c" : "#EEF1F7"
+ //readonly property string colorLineGradient2: dark_theme ? "#06070c" : "#DCE1E8"
+ //readonly property string colorLineGradient3: dark_theme ? "#090910" : "#EEF1F7"
+ //readonly property string colorLineGradient4: dark_theme ? "#24283b" : "#DCE1E8"
+ readonly property string colorDropShadowLight: dark_theme ? "#216975a4" : "#21FFFFFF"
+ readonly property string colorDropShadowLight2: dark_theme ? "#606975a4" : "#60FFFFFF"
+ readonly property string colorDropShadowDark: dark_theme ? "#FF050615" : "#BECDE2"
+ readonly property string colorBorder: dark_theme ? "#23273B" : "#DAE1EC"
+ readonly property string colorBorder2: dark_theme ? "#1C1F32" : "#DAE1EC"
+
+ readonly property string colorInnerShadow: dark_theme ? "#A0000000" : "#BECDE2"
+
+ readonly property string colorGradientLine1: dark_theme ? "#00FFFFFF" : "#00CFD4DB"
+ readonly property string colorGradientLine2: dark_theme ? "#0FFFFFFF" : "#FFCFD4DB"
+
+ readonly property string colorWalletsHighlightGradient: dark_theme ? "#1B5E7D" : "#1B5E7D"
+ readonly property string colorWalletsSidebarDropShadow: dark_theme ? "#B0000000" : "#BECDE2"
+
+ readonly property string colorScrollbar: dark_theme ? "#202339" : "#C4CCDA"
+ readonly property string colorScrollbarBackground: dark_theme ? "#10121F" : "#EFF1F6"
+
+ readonly property string colorSidebarIconHighlighted: dark_theme ? "#2BBEF2" : "#FFFFFF"
+ readonly property string colorSidebarHighlightGradient1: dark_theme ? "#FF1B5E7D" : "#8b95ed"
+ readonly property string colorSidebarHighlightGradient2: dark_theme ? "#BA1B5E7D" : "#AD7faaf0"
+ readonly property string colorSidebarHighlightGradient3: dark_theme ? "#5F1B5E7D" : "#A06dc9f3"
+ readonly property string colorSidebarHighlightGradient4: dark_theme ? "#001B5E7D" : "#006bcef4"
+ //readonly property string colorSidebarDropShadow: dark_theme ? "#90000000" : "#BECDE2"
+ readonly property string colorSidebarSelectedText: dark_theme ? "#FFFFFF" : "#FFFFFF"
+
+ readonly property string colorCoinListHighlightGradient: dark_theme ? "#2C2E40" : "#E0E6F0"
+
+ 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
+
+ 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)
+ return v > 0 ? greenColor : redColor
+
+ return Style.colorWhite4
+ }
+
+ function getCoinTypeColor(type) {
+ return getCoinColor(type === "ERC-20" ? "ETH" :
+ type === "QRC-20" ? "QTUM" :
+ type === "Smart Chain" ? "KMD" :
+ "BTC")
+ }
+
+ function getCoinColor(ticker) {
+ const c = colorCoin[ticker]
+ return c || Style.colorTheme2
+ }
+
+ readonly property var colorCoin: ({
+ "ARPA": "#CCD9E2",
+ "BCH": "#8DC351",
+ "BTC": "#F7931A",
+ "CLC": "#0970DC",
+ "FTC": "#FFFFFF",
+ "GLEEC": "#8C41FF",
+ "GRS": "#377E96",
+ "DOGE": "#C3A634",
+ "ETH": "#627EEA",
+ "KMD": "#2B6680",
+ "MORTY": "#A4764D",
+ "RICK": "#A5CBDD",
+ "EMC2": "#00CCFF",
+ "DASH": "#008CE7",
+ "RVN": "#384182",
+ "DGB": "#006AD2",
+ "FIRO": "#BB2100",
+ "LTC": "#BFBBBB",
+ "ZEC": "#ECB244",
+ "ZER": "#FFFFFF",
+ "NAV": "#7D59B5",
+ "DP": "#E41D25",
+ "ECA": "#A915DC",
+ "QTUM": "#2E9AD0",
+ "CHIPS": "#598182",
+ "AXE": "#C63877",
+ "PANGEA": "#D88245",
+ "JUMBLR": "#2B4649",
+ "DEX": "#43B7B6",
+ "COQUI": "#79A541",
+ "CRYPTO": "#F58736",
+ "LABS": "#C1F6E1",
+ "MGW": "#854F2F",
+ "MONA": "#DEC799",
+ "NMC": "#186C9D",
+ "RFOX": "#D83331",
+ "BOTS": "#F69B57",
+ "MCL": "#EA0000",
+ "CCL": "#FFE400",
+ "BET": "#F69B57",
+ "SUPERNET": "#F69B57",
+ "OOT": "#25AAE1",
+ "REVS": "#F69B57",
+ "ILN": "#523170",
+ "VRSC": "#3164D3",
+ "THC": "#819F6F",
+ "1INCH": "#95A7C5",
+ "BAT": "#FF5000",
+ "BUSD": "#EDB70B",
+ "DAI": "#B68900",
+ "USDC": "#317BCB",
+ "PAX": "#EDE70A",
+ "SUSHI": "#E25DA8",
+ "TUSD": "#2E3181",
+ "AWC": "#31A5F6",
+ "VRA": "#D70A41",
+ "SPACE": "#E44C65",
+ "QC": "#00D7B3",
+ "PBC": "#64A3CB",
+ "AAVE": "#9C64A6",
+ "ANT": "#33DAE6",
+ "AGI": "#6815FF",
+ "BAND": "#526BFF",
+ "BLK": "#191919",
+ "BNT": "#000D2B",
+ "BTCZ": "#F5B036",
+ "CEL": "#4055A6",
+ "CENNZ": "#2E87F1",
+ "COMP": "#00DBA3",
+ "CRO": "#243565",
+ "CVC": "#3AB03E",
+ "CVT": "#4B0082",
+ "DODO": "#FFF706",
+ "ELF": "#2B5EBB",
+ "ENJ": "#6752C3",
+ "EURS": "#2F77ED",
+ "FUN": "#EF1C70",
+ "GNO": "#00B0CC",
+ "HOT": "#983EFF",
+ "IOTX": "#00CDCE",
+ "KNC": "#117980",
+ "LEO": "#F79B2C",
+ "LINK": "#356CE4",
+ "LRC": "#32C2F8",
+ "MANA": "#FF3C6C",
+ "MATIC": "#1E61ED",
+ "MED": "#00B5FF",
+ "MKR": "#1BAF9F",
+ "NPXS": "#F3CB00",
+ "POWR": "#05BCAA",
+ "QI": "#FFFFFF",
+ "QIAIR": "#FEFEFE",
+ "QKC": "#2175B4",
+ "QNT": "#46DDC8",
+ "REP": "#0E0E21",
+ "REV": "#78034D",
+ "RLC": "#FFE100",
+ "SFUSD": "#9881B8",
+ "SNT": "#596BED",
+ "SNX": "#00D1FF",
+ "SOULJA": "#8F734A",
+ "STORJ": "#2683FF",
+ "TSL": "#64B082",
+ "VRM": "#586A7A",
+ "WSB": "#FEBB84",
+ "WBTC": "#CCCCCC",
+ "YFI": "#006BE6",
+ "ZRX": "#302C2C",
+ "UNI": "#FF007A"
+ })
+}
\ No newline at end of file
diff --git a/atomic_defi_design/qml/Constants/DexThemeManager.qml b/atomic_defi_design/qml/Constants/DexThemeManager.qml
new file mode 100644
index 0000000000..3ad05e7cc3
--- /dev/null
+++ b/atomic_defi_design/qml/Constants/DexThemeManager.qml
@@ -0,0 +1,96 @@
+import QtQuick 2.15
+import Qaterial 1.0 as Qaterial
+import App 1.0
+
+QtObject {
+ function apply(name) {
+ let data = API.qt_utilities.load_theme(name)
+
+ checkThemeType(data)
+
+ for (let i in data) {
+ console.log("[THEME] set(%1 ) to %2 ".arg(data[i]).arg(i))
+ if (typeof(data[i]) === "boolean") {
+ eval("DexTheme." + i.toString() + " = " + data[i].toString())
+ }
+ else if(typeof(data[i]) === "number") {
+ eval("DexTheme." + i.toString() + " = " + data[i])
+ } else {
+ if(data[i].toString().startsWith('rgba')){
+ let color = data[i].toString().replace("rgba(","").replace(")","").split(",")
+ color = Qt.rgba(rgba255to1(color[0]),
+ rgba255to1(color[1]),
+ rgba255to1(color[2]),
+ parseFloat(color[3]))
+ eval("DexTheme." + i.toString() + " = color")
+ } else {
+ eval("DexTheme." + i.toString() + " = '" + data[i] + "'")
+ }
+
+ }
+ }
+
+ checkExtraProperty(data)
+
+
+ Qaterial.Style.accentColor = DexTheme.accentColor
+
+ console.log("[THEME] %1 Applied successfully".arg(name))
+ }
+
+ function checkThemeType(data) {
+ if(!("theme" in data)) {
+ console.log('[THEME] theme type not defined')
+ DexTheme.theme = "undefined"
+ } else {
+ console.log("[THEME] theme type defined")
+ }
+ }
+
+ function checkExtraProperty(data) {
+
+ if(!("portfolioPieGradient" in data)) {
+ console.log('[THEME] portfolioPieGradient type not defined')
+ DexTheme.portfolioPieGradient = false
+ }
+
+ if(!("sideBarRightBorderColor" in data)) {
+ console.log('[THEME] portfolioPieGradient type not defined')
+ DexTheme.sideBarRightBorderColor = "transparent"
+ }
+
+ if(!("proviewItemBoxBorderColor" in data)) {
+ console.log('[THEME] proviewItemBoxBorderColor type not defined')
+ DexTheme.proviewItemBoxBorderColor = "transparent"
+ }
+
+ propertyChecker("tabBarBackgroudColor","buttonColorEnabled", data)
+ propertyChecker("contentColorTop", "backgroundColor", data)
+ propertyChecker("contentColorTopBold", "backgroundColor", data)
+ propertyChecker("modalStepColor", "accentColor", data)
+ propertyChecker("modelStepBorderColor", "hightlightColor", data)
+ propertyChecker("hoverColor", "buttonColorHovered", data)
+ propertyChecker("buttonGradientEnabled1", "buttonColorEnabled", data)
+ propertyChecker("buttonGradientEnabled2", "buttonColorEnabled", data)
+ propertyChecker("arrowUpColor", "greenColor", data)
+ propertyChecker("arrowDownColor", "redColor", data)
+ propertyChecker("tradeFieldBoxBackgroundColor", "backgroundColor", data)
+ propertyChecker("iconButtonColor","buttonColorEnabled", data)
+ propertyChecker("iconButtonForegroundColor","buttonColorTextEnabled", data)
+ propertyChecker("proviewItemBoxBackgroundColor","dexBoxBackgroundColor", data)
+ propertyChecker("comboBoxBorderColor","rectangleBorderColor",data)
+ propertyChecker("comboBoxBackgroundColor","dexBoxBackgroundColor",data)
+ }
+
+ function propertyChecker(name, value, data) {
+ if(!(name in data)) {
+ console.log('[THEME] %1 type not defined'.arg(name))
+ eval('DexTheme.'+name+' = DexTheme.'+value)
+ }
+ }
+
+ function rgba255to1(n) {
+ return (parseInt(n)*1) / 255
+ }
+
+}
\ No newline at end of file
diff --git a/atomic_defi_design/qml/Constants/DexTypo.qml b/atomic_defi_design/qml/Constants/DexTypo.qml
new file mode 100644
index 0000000000..735a0da250
--- /dev/null
+++ b/atomic_defi_design/qml/Constants/DexTypo.qml
@@ -0,0 +1,111 @@
+pragma Singleton
+
+import QtQuick 2.15
+import QtQuick.Layouts 1.15
+import QtQuick.Controls 2.15
+
+import App 1.0 as App
+
+QtObject {
+ id: _font
+ property real fontDensity: 1.0
+ property real languageDensity: {
+ switch (App.API.app.settings_pg.lang) {
+ case "en":
+ return 0.99999
+ break
+ case "fr":
+ return 0.99999
+ break
+ case "tr":
+ return 0.99999
+ break
+ case "ru":
+ return 0.99999
+ break
+ default:
+ return 0.99999
+ }
+ }
+ property string fontFamily: "Ubuntu"
+ property font head1: Qt.font({
+ pixelSize: 96 * fontDensity,
+ letterSpacing: -1.5,
+ family: fontFamily,
+ weight: Font.Light
+ })
+ property font head2: Qt.font({
+ pixelSize: 60 * fontDensity,
+ letterSpacing: -0.5,
+ family: fontFamily,
+ weight: Font.Light
+ })
+ property font head3: Qt.font({
+ pixelSize: 48 * fontDensity,
+ letterSpacing: 0,
+ family: fontFamily,
+ weight: Font.Normal
+ })
+ property font head4: Qt.font({
+ pixelSize: 34 * fontDensity,
+ letterSpacing: 0.25,
+ family: fontFamily,
+ weight: Font.Normal
+ })
+ property font head5: Qt.font({
+ pixelSize: 24 * fontDensity,
+ letterSpacing: 0,
+ family: fontFamily,
+ weight: Font.Normal
+ })
+ property font head6: Qt.font({
+ pixelSize: 20 * fontDensity,
+ letterSpacing: 0.15,
+ family: fontFamily,
+ weight: Font.Medium
+ })
+ property font subtitle1: Qt.font({
+ pixelSize: 16 * fontDensity,
+ letterSpacing: 0.15,
+ family: fontFamily,
+ weight: Font.Normal
+ })
+ property font subtitle2: Qt.font({
+ pixelSize: 14 * fontDensity,
+ letterSpacing: 0.1,
+ family: fontFamily,
+ weight: Font.Medium
+ })
+ property font body1: Qt.font({
+ pixelSize: 16 * fontDensity,
+ letterSpacing: 0.5,
+ family: fontFamily,
+ weight: Font.Normal
+ })
+ property font body2: Qt.font({
+ pixelSize: 14 * fontDensity,
+ letterSpacing: 0.25,
+ family: fontFamily,
+ weight: Font.Normal
+ })
+ property font button: Qt.font({
+ pixelSize: 14 * fontDensity,
+ letterSpacing: 1.25,
+ capitalization: Font.AllUppercase,
+ family: fontFamily,
+ weight: Font.Medium
+ })
+ property font caption: Qt.font({
+ pixelSize: 12 * fontDensity,
+ letterSpacing: 0.4,
+ family: fontFamily,
+ weight: Font.Normal
+ })
+ property font overLine: Qt.font({
+ pixelSize: 10 * fontDensity,
+ letterSpacing: 1.25,
+ capitalization: Font.AllUppercase,
+ family: fontFamily,
+ weight: Font.Normal
+ })
+}
\ No newline at end of file
diff --git a/atomic_defi_design/qml/Constants/General.qml b/atomic_defi_design/qml/Constants/General.qml
index 5e5a44784b..277045a255 100644
--- a/atomic_defi_design/qml/Constants/General.qml
+++ b/atomic_defi_design/qml/Constants/General.qml
@@ -25,6 +25,15 @@ QtObject {
}
}
+ function coinName(ticker) {
+ if(ticker === "" || ticker === "All" || ticker===undefined) {
+ return ""
+ }else {
+ const name = API.app.portfolio_pg.global_cfg_mdl.get_coin_info(ticker).name
+ return name
+ }
+ }
+
// Returns the icon full path of a coin type.
// If the given coin type has spaces, it will be replaced by '-' characters.
// If the given coin type is empty, returns an empty string.
@@ -48,13 +57,13 @@ QtObject {
property bool privacy_mode: false
- readonly property var reg_pass_input: /[A-Za-z0-9@#$€%{}[\]()\/\\'"`~,;:.<>+\-_=!^&*|?]+/
+ readonly property var reg_pass_input: /[A-Za-z0-9@#$€£%{}[\]()\/\\'"`~,;:.<>+\-_=!^&*|?]+/
readonly property var reg_pass_valid_low_security: /^(?=.{1,}).*$/
- readonly property var reg_pass_valid: /^(?=.{16,})(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[@#$%€${}[\]()\/\\'"`~,;:.<>+\-_=!^&*|?]).*$/
+ readonly property var reg_pass_valid: /^(?=.{16,})(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[@#$%€£{}[\]()\/\\'"`~,;:.<>+\-_=!^&*|?]).*$/
readonly property var reg_pass_uppercase: /(?=.*[A-Z])/
readonly property var reg_pass_lowercase: /(?=.*[a-z])/
readonly property var reg_pass_numeric: /(?=.*[0-9])/
- readonly property var reg_pass_special: /(?=.*[@#$%{}[\]()\/\\'"`~,€$;:.<>+\-_=!^&*|?])/
+ readonly property var reg_pass_special: /(?=.*[@#$%{}[\]()\/\\'"`~,€$£;:.<>+\-_=!^&*|?])/
readonly property var reg_pass_count_low_security: /(?=.{1,})/
readonly property var reg_pass_count: /(?=.{16,})/
@@ -242,6 +251,7 @@ QtObject {
function formatCrypto(received, amount, ticker, fiat_amount, fiat) {
return diffPrefix(received) + atomic_qt_utilities.retrieve_main_ticker(ticker) + " " + formatDouble(amount) + (fiat_amount ? " (" + formatFiat("", fiat_amount, fiat) + ")" : "")
}
+
function fullCoinName(name, ticker) {
return name + " (" + ticker + ")"
@@ -260,9 +270,9 @@ QtObject {
}
function getMinTradeAmount() {
- if (API.app.trading_pg.market_mode == MarketMode.Buy) {
+ /*if (API.app.trading_pg.market_mode == MarketMode.Buy) {
return API.app.trading_pg.orderbook.rel_min_taker_vol
- }
+ }*/
return API.app.trading_pg.min_trade_vol
}
@@ -445,17 +455,17 @@ QtObject {
case TradingError.VolumeFieldNotFilled:
return qsTr("Please fill the volume field")
case TradingError.VolumeIsLowerThanTheMinimum:
- return qsTr("%1 volume is lower than minimum trade amount").arg(base_ticker) + " : " + General.getMinTradeAmount()
+ return qsTr("%1 volume is lower than minimum trade amount").arg(API.app.trading_pg.market_pairs_mdl.left_selected_coin) + " : " + General.getMinTradeAmount()
case TradingError.ReceiveVolumeIsLowerThanTheMinimum:
return qsTr("%1 volume is lower than minimum trade amount").arg(rel_ticker) + " : " + General.getReversedMinTradeAmount()
case TradingError.LeftParentChainNotEnabled:
- return qsTr("%1 parent chain is not enabled").arg(left_ticker)
+ return qsTr("%1 needs to be enabled in order to use %2").arg(API.app.portfolio_pg.global_cfg_mdl.get_parent_coin(left_ticker)).arg(left_ticker)
case TradingError.LeftParentChainNotEnoughBalance:
- return qsTr("%1 parent chain balance is 0, a non-zero balance is required to pay the gas").arg(left_ticker)
+ return qsTr("%1 balance needs to be funded, a non-zero balance is required to pay the gas of %2 transactions").arg(API.app.portfolio_pg.global_cfg_mdl.get_parent_coin(left_ticker)).arg(left_ticker)
case TradingError.RightParentChainNotEnabled:
- return qsTr("%1 parent chain is not enabled").arg(right_ticker)
+ return qsTr("%1 needs to be enabled in order to use %2").arg(API.app.portfolio_pg.global_cfg_mdl.get_parent_coin(right_ticker)).arg(right_ticker)
case TradingError.RightParentChainNotEnoughBalance:
- return qsTr("%1 parent chain balance is 0, a non-zero balance is required to pay the gas").arg(right_ticker)
+ return qsTr("%1 balance needs to be funded, a non-zero balance is required to pay the gas of %2 transactions").arg(API.app.portfolio_pg.global_cfg_mdl.get_parent_coin(right_ticker)).arg(right_ticker)
default:
return qsTr("Unknown Error") + ": " + error
}
@@ -480,8 +490,20 @@ QtObject {
"ADA/HUSD": "BINANCE:ADAUSD",
"ADA/DAI": "BINANCE:ADAUSD",
"ADA/PAX": "BINANCE:ADAUSD",
+ "ADA/EURS": "BINANCE:ADAEUR",
+ "ADA/TRYB": "BINANCE:ADATRY",
+ "ADA/BIDR": "BINANCE:ADABIDR",
"ADA/BNB": "BINANCE:ADABNB",
"ADA/BCH": "HITBTC:ADABCH",
+ "ADX/BTC": "BINANCE:ADXBTC",
+ "ADX/ETH": "BINANCE:ADXETH",
+ "ADX/USDT": "BINANCE:ADXUSD",
+ "ADX/BUSD": "BINANCE:ADXUSD",
+ "ADX/USDC": "BINANCE:ADXUSD",
+ "ADX/TUSD": "BINANCE:ADXUSD",
+ "ADX/HUSD": "BINANCE:ADXUSD",
+ "ADX/DAI": "BINANCE:ADXUSD",
+ "ADX/PAX": "BINANCE:ADXUSD",
"AAVE/BTC": "BINANCE:AAVEBTC",
"AAVE/ETH": "BINANCE:AAVEETH",
"AAVE/BNB": "BINANCE:AAVEBNB",
@@ -547,6 +569,16 @@ QtObject {
"ATOM/BNB": "BINANCE:ATOMBNB",
"ATOM/EURS": "KRAKEN:ATOMEUR",
"ATOM/BCH": "HITBTC:ATOMBCH",
+ "AVA/BTC": "BINANCE:AVABTC",
+ "AVA/ETH": "KUCOIN:AVAETH",
+ "AVA/USDT": "BINANCE:AVAUSD",
+ "AVA/BUSD": "BINANCE:AVAUSD",
+ "AVA/USDC": "BINANCE:AVAUSD",
+ "AVA/TUSD": "BINANCE:AVAUSD",
+ "AVA/HUSD": "BINANCE:AVAUSD",
+ "AVA/DAI": "BINANCE:AVAUSD",
+ "AVA/PAX": "BINANCE:AVAUSD",
+ "AVA/BNB": "BINANCE:AVABNB",
"AVAX/BTC": "BINANCE:AVAXBTC",
"AVAX/ETH": "OKEX:AVAXETH",
"AVAX/USDT": "BINANCE:AVAXUSD",
@@ -611,6 +643,13 @@ QtObject {
"BCH/BNB": "BINANCE:BCHBNB",
"BCH/EURS": "HITBTC:BCHEURS",
"BCH/HT": "HUOBI:BCHHT",
+ "BIDR/USDT": "BINANCE:USDTBIDR",
+ "BIDR/BUSD": "BINANCE:USDTBIDR",
+ "BIDR/USDC": "BINANCE:USDTBIDR",
+ "BIDR/TUSD": "BINANCE:USDTBIDR",
+ "BIDR/HUSD": "BINANCE:USDTBIDR",
+ "BIDR/DAI": "BINANCE:USDTBIDR",
+ "BIDR/PAX": "BINANCE:USDTBIDR",
"BLK/BTC": "BITTREX:BLKBTC",
"BLK/USDT": "BITTREX:BLKUSD",
"BLK/BUSD": "BITTREX:BLKUSD",
@@ -629,6 +668,8 @@ QtObject {
"BNB/DAI": "BINANCE:BNBUSD",
"BNB/PAX": "BINANCE:BNBUSD",
"BNB/EURS": "BINANCE:BNBEUR",
+ "BNB/TRYB": "BINANCE:BNBTRY",
+ "BNB/BIDR": "BINANCE:BNBBIDR",
"BNT/BTC": "BINANCE:BNTBTC",
"BNT/ETH": "BINANCE:BNTETH",
"BNT/USDT": "BINANCE:BNTUSD",
@@ -647,6 +688,8 @@ QtObject {
"BTC/DAI": "COINBASE:BTCUSD",
"BTC/PAX": "COINBASE:BTCUSD",
"BTC/EURS": "COINBASE:BTCEUR",
+ "BTC/TRYB": "BINANCE:BTCTRY",
+ "BTC/BIDR": "BITFINEX:BTCIDR",
"BTT/BTC": "BITFINEX:BTTBTC",
"BTT/ETH": "KUCOIN:BTTETH",
"BTT/USDT": "BITFINEX:BTTUSD",
@@ -658,6 +701,7 @@ QtObject {
"BTT/PAX": "BITFINEX:BTTUSD",
"BTT/BNB": "BINANCE:BTTBNB",
"BTT/EURS": "BINANCE:BTTEUR",
+ "BTT/TRYB": "BINANCE:BTTTRY",
"BTU/BTC": "BITTREX:BTUBTC",
"BTU/USDT": "BITTREX:BTUUSD",
"BTU/BUSD": "BITTREX:BTUUSD",
@@ -786,6 +830,8 @@ QtObject {
"DOGE/DAI": "BINANCE:DOGEUSD",
"DOGE/PAX": "BINANCE:DOGEUSD",
"DOGE/EURS": "BINANCE:DOGEEUR",
+ "DOGE/TRYB": "BINANCE:DOGETRY",
+ "DOGE/BIDR": "BINANCE:DOGEBIDR",
"DGB/BTC": "BINANCE:DGBBTC",
"DGB/ETH": "BITTREX:DGBETH",
"DGB/USDT": "BITTREX:DGBUSD",
@@ -824,6 +870,9 @@ QtObject {
"DOT/HUSD": "BINANCE:DOTUSD",
"DOT/DAI": "BINANCE:DOTUSD",
"DOT/PAX": "BINANCE:DOTUSD",
+ "DOT/EURS": "BINANCE:DOTEUR",
+ "DOT/TRYB": "BINANCE:DOTTRY",
+ "DOT/BIDR": "BINANCE:DOTBIDR",
"DOT/BNB": "BINANCE:DOTBNB",
"DX/BTC": "KUCOIN:DXBTC",
"DX/ETH": "KUCOIN:DXETH",
@@ -877,6 +926,8 @@ QtObject {
"EOS/BNB": "BINANCE:EOSBNB",
"EOS/BCH": "HITBTC:EOSBCH",
"EOS/EURS": "HITBTC:EOSEURS",
+ "EOS/TRYB": "BINANCE:EOSTRY",
+ "EOS/BIDR": "BITFINEX:EOSIDR",
"ETC/BTC": "BINANCE:ETCBTC",
"ETC/ETH": "BINANCE:ETCETH",
"ETC/USDT": "BINANCE:ETCUSD",
@@ -890,20 +941,24 @@ QtObject {
"ETC/EURS": "KRAKEN:ETCEUR",
"ETC/BCH": "HITBTC:ETCBCH",
"ETH/BTC": "BINANCE:ETHBTC",
- "ETH/USDT": "BINANCE:ETHUSDT",
- "ETH/BUSD": "BINANCE:ETHBUSD",
- "ETH/DAI": "BINANCE:ETHDAI",
- "ETH/EURS": "HITBTC:ETHEURS",
- "ETH/HUSD": "HUOBI:ETHHUSD",
- "ETH/PAX": "BINANCE:ETHPAX",
- "ETH/TUSD": "BINANCE:ETHTUSD",
- "ETH/USDC": "BINANCE:ETHUSDC",
- "EURS/USDT": "HITBTC:EURSUSDT",
- "EURS/DAI": "HITBTC:EURSDAI",
- "EURS/TUSD": "HITBTC:EURSTUSD",
- "FET/BTC": "BINANCE:FETBTC",
- "FET/ETH": "KUCOIN:FETETH",
- "FET/USDT": "BINANCE:FETUSDT",
+ "ETH/USDT": "BITSTAMP:ETHUSD",
+ "ETH/BUSD": "BITSTAMP:ETHUSD",
+ "ETH/USDC": "BITSTAMP:ETHUSD",
+ "ETH/TUSD": "BITSTAMP:ETHUSD",
+ "ETH/HUSD": "BITSTAMP:ETHUSD",
+ "ETH/DAI": "BITSTAMP:ETHUSD",
+ "ETH/PAX": "BITSTAMP:ETHUSD",
+ "ETH/EURS": "KRAKEN:ETHEUR",
+ "ETH/TRYB": "BINANCE:ETHTRY",
+ "ETH/BIDR": "BITFINEX:ETHIDR",
+ "EURS/USDT": "FX:EURUSD",
+ "EURS/BUSD": "FX:EURUSD",
+ "EURS/USDC": "FX:EURUSD",
+ "EURS/TUSD": "FX:EURUSD",
+ "EURS/HUSD": "FX:EURUSD",
+ "EURS/DAI": "FX:EURUSD",
+ "EURS/PAX": "FX:EURUSD",
+ "EURS/BIDR": "FX_IDC:EURIDR",
"FIL/BTC": "BINANCE:FILBTC",
"FIL/ETH": "HUOBI:FILETH",
"FIL/USDT": "BINANCE:FILUSD",
@@ -995,6 +1050,16 @@ QtObject {
"HT/ETH": "HUOBI:HTETH",
"HT/USDT": "HUOBI:HTUSDT",
"HT/HUSD": "HUOBI:HTHUSD",
+ "INJ/BTC": "BINANCE:INJBTC",
+ "INJ/ETH": "HUOBI:INJETH",
+ "INJ/USDT": "BINANCE:INJUSD",
+ "INJ/BUSD": "BINANCE:INJUSD",
+ "INJ/USDC": "BINANCE:INJUSD",
+ "INJ/TUSD": "BINANCE:INJUSD",
+ "INJ/HUSD": "BINANCE:INJUSD",
+ "INJ/DAI": "BINANCE:INJUSD",
+ "INJ/PAX": "BINANCE:INJUSD",
+ "INJ/BNB": "BINANCE:INJBNB",
"INK/BTC": "HITBTC:INKBTC",
"INK/ETH": "HITBTC:INKETH",
"INK/USDT": "HITBTC:INKUSDT",
@@ -1027,6 +1092,8 @@ QtObject {
"KMD/HUSD": "BINANCE:KMDUSD",
"KMD/DAI": "BINANCE:KMDUSD",
"KMD/PAX": "BINANCE:KMDUSD",
+ "KMD/TRYB": "BITTREX:KMDTRY",
+ "KMD/BIDR": "BITTREX:KMDIDR",
"KNC/BTC": "BINANCE:KNCBTC",
"KNC/ETH": "BINANCE:KNCETH",
"KNC/USDT": "COINBASE:KNCUSD",
@@ -1037,6 +1104,15 @@ QtObject {
"KNC/DAI": "COINBASE:KNCUSD",
"KNC/PAX": "COINBASE:KNCUSD",
"KNC/EURS": "KRAKEN:KNCEUR",
+ "LBC/BTC": "BITTREX:LBCBTC",
+ "LBC/ETH": "BITTREX:LBCETH",
+ "LBC/USDT": "BITTREX:LBCUSD",
+ "LBC/BUSD": "BITTREX:LBCUSD",
+ "LBC/USDC": "BITTREX:LBCUSD",
+ "LBC/TUSD": "BITTREX:LBCUSD",
+ "LBC/HUSD": "BITTREX:LBCUSD",
+ "LBC/DAI": "BITTREX:LBCUSD",
+ "LBC/PAX": "BITTREX:LBCUSD",
"LCC/BTC": "HITBTC:LCCBTC",
"LCC/USDT": "HITBTC:LCCUSD",
"LCC/BUSD": "HITBTC:LCCUSD",
@@ -1065,6 +1141,7 @@ QtObject {
"LINK/DAI": "BINANCE:LINKUSD",
"LINK/PAX": "BINANCE:LINKUSD",
"LINK/EURS": "KRAKEN:LINKEUR",
+ "LINK/TRYB": "BINANCE:LINKTRY",
"LRC/BTC": "BINANCE:LRCBTC",
"LRC/ETH": "BINANCE:LRCETH",
"LRC/USDT": "BINANCE:LRCUSD",
@@ -1085,6 +1162,8 @@ QtObject {
"LTC/PAX": "COINBASE:LTCUSD",
"LTC/BNB": "BINANCE:LTCBNB",
"LTC/EURS": "COINBASE:LTCEUR",
+ "LTC/TRYB": "BITFINEX:LTCTRY",
+ "LTC/BIDR": "BITFINEX:LTCIDR",
"LTC/BCH": "HITBTC:LTCBCH",
"LTC/HT": "HUOBI:LTCHT",
"MANA/BTC": "BINANCE:MANABTC",
@@ -1108,7 +1187,8 @@ QtObject {
"MATIC/PAX": "BINANCE:MATICUSD",
"MATIC/BNB": "BINANCE:MATICBNB",
"MATIC/EURS": "COINBASE:MATICEUR",
- "MED/BTC": "BITTREX:MEDBTC",
+ "MATIC/TRYB": "BINANCE:MATICTRY",
+ "MATIC/BIDR": "BINANCE:MATICBIDR",
"MKR/BTC": "BINANCE:MKRBTC",
"MKR/ETH": "BITFINEX:MKRETH",
"MKR/BNB": "BINANCE:MKRBNB",
@@ -1170,6 +1250,7 @@ QtObject {
"ONT/HUSD": "BINANCE:ONTUSD",
"ONT/DAI": "BINANCE:ONTUSD",
"ONT/PAX": "BINANCE:ONTUSD",
+ "ONT/TRYB": "BINANCE:ONTTRY",
"ONT/BNB": "BINANCE:ONTBNB",
"ONT/BCH": "HITBTC:ONTBCH",
"PAXG/BTC": "BINANCE:PAXGBTC",
@@ -1188,6 +1269,16 @@ QtObject {
"PNK/USDT": "OKEX:PNKUSDT",
"POWR/BTC": "BINANCE:POWRBTC",
"POWR/ETH": "BINANCE:POWRETH",
+ "QC/USDT": "FX_IDC:CNYUSD",
+ "QC/BUSD": "FX_IDC:CNYUSD",
+ "QC/USDC": "FX_IDC:CNYUSD",
+ "QC/TUSD": "FX_IDC:CNYUSD",
+ "QC/HUSD": "FX_IDC:CNYUSD",
+ "QC/DAI": "FX_IDC:CNYUSD",
+ "QC/PAX": "FX_IDC:CNYUSD",
+ "QC/EURS": "FX_IDC:CNYEUR",
+ "QC/TRYB": "FX_IDC:CNYTRY",
+ "QC/BIDR": "FX_IDC:CNYIDR",
"QKC/BTC": "BINANCE:QKCBTC",
"QKC/ETH": "BINANCE:QKCETH",
"QKC/USDT": "BINANCE:QKCUSD",
@@ -1245,7 +1336,13 @@ QtObject {
"REV/PAX": "BITTREX:REVUSD",
"RLC/BTC": "BINANCE:RLCBTC",
"RLC/ETH": "BINANCE:RLCETH",
- "RLC/USDT": "BINANCE:RLCUSDT",
+ "RLC/USDT": "BINANCE:RLCUSD",
+ "RLC/BUSD": "BINANCE:RLCUSD",
+ "RLC/USDC": "BINANCE:RLCUSD",
+ "RLC/TUSD": "BINANCE:RLCUSD",
+ "RLC/HUSD": "BINANCE:RLCUSD",
+ "RLC/DAI": "BINANCE:RLCUSD",
+ "RLC/PAX": "BINANCE:RLCUSD",
"RSR/BTC": "BINANCE:RSRBTC",
"RSR/ETH": "OKEX:RSRETH",
"RSR/USDT": "BINANCE:RSRUSD",
@@ -1265,17 +1362,30 @@ QtObject {
"RVN/HUSD": "BINANCE:RVNUSD",
"RVN/DAI": "BINANCE:RVNUSD",
"RVN/PAX": "BINANCE:RVNUSD",
+ "RVN/TRYB": "BINANCE:RVNTRY",
"RVN/BNB": "BINANCE:RVNBNB",
"RVN/HT": "HUOBI:RVNHT",
"SHR/BTC": "KUCOIN:SHRBTC",
"SHR/USDT": "KUCOIN:SHRUSDT",
"SKL/BTC": "BINANCE:SKLBTC",
"SKL/ETH": "HUOBI:SKLETH",
- "SKL/USDT": "BINANCE:SKLUSDT",
- "SKL/BUSD": "BINANCE:SKLBUSD",
+ "SKL/USDT": "COINBASE:SKLUSD",
+ "SKL/BUSD": "COINBASE:SKLUSD",
+ "SKL/USDC": "COINBASE:SKLUSD",
+ "SKL/TUSD": "COINBASE:SKLUSD",
+ "SKL/HUSD": "COINBASE:SKLUSD",
+ "SKL/DAI": "COINBASE:SKLUSD",
+ "SKL/PAX": "COINBASE:SKLUSD",
+ "SKL/EURS": "COINBASE:SKLEUR",
"SNT/BTC": "BINANCE:SNTBTC",
"SNT/ETH": "BINANCE:SNTETH",
- "SNT/USDT": "HUOBI:SNTUSDT",
+ "SNT/USDT": "BINANCE:SNTUSD",
+ "SNT/BUSD": "BINANCE:SNTUSD",
+ "SNT/USDC": "BINANCE:SNTUSD",
+ "SNT/TUSD": "BINANCE:SNTUSD",
+ "SNT/HUSD": "BINANCE:SNTUSD",
+ "SNT/DAI": "BINANCE:SNTUSD",
+ "SNT/PAX": "BINANCE:SNTUSD",
"SNX/BTC": "BINANCE:SNXBTC",
"SNX/ETH": "KRAKEN:SNXETH",
"SNX/BNB": "BINANCE:SNXBNB",
@@ -1325,6 +1435,8 @@ QtObject {
"SXP/DAI": "BINANCE:SXPUSD",
"SXP/PAX": "BINANCE:SXPUSD",
"SXP/EURS": "BINANCE:SXPEUR",
+ "SXP/TRYB": "BINANCE:SXPTRY",
+ "SXP/BIDR": "BINANCE:SXPBIDR",
"SYS/BTC": "BINANCE:SYSBTC",
"SYS/USDT": "BINANCE:SYSUSD",
"SYS/BUSD": "BINANCE:SYSUSD",
@@ -1355,7 +1467,16 @@ QtObject {
"TRX/PAX": "KRAKEN:TRXUSD",
"TRX/BNB": "BINANCE:TRXBNB",
"TRX/EURS": "KRAKEN:TRXEUR",
+ "TRX/TRYB": "BINANCE:TRXTRY",
"TRX/BCH": "HITBTC:TRXBCH",
+ "TRYB/USDT": "FX_IDC:TRYUSD",
+ "TRYB/BUSD": "FX_IDC:TRYUSD",
+ "TRYB/USDC": "FX_IDC:TRYUSD",
+ "TRYB/TUSD": "FX_IDC:TRYUSD",
+ "TRYB/HUSD": "FX_IDC:TRYUSD",
+ "TRYB/DAI": "FX_IDC:TRYUSD",
+ "TRYB/PAX": "FX_IDC:TRYUSD",
+ "TRYB/EURS": "FX_IDC:TRYEUR",
"THC/BTC": "BITTREX:THCBTC",
"THC/USDT": "BITTREX:THCUSD",
"THC/BUSD": "BITTREX:THCUSD",
@@ -1405,11 +1526,22 @@ QtObject {
"UOS/PAX": "BITFINEX:UOSUSD",
"UQC/BTC": "BITTREX:UQCBTC",
"UQC/ETH": "KUCOIN:UQCETH",
- "UQC/USDT": "BITTREX:UQCUSDT",
- "USDC/EURS": "UNISWAP:USDCEURS",
+ "UQC/USDT": "BITTREX:UQCUSD",
+ "UQC/BUSD": "BITTREX:UQCUSD",
+ "UQC/USDC": "BITTREX:UQCUSD",
+ "UQC/TUSD": "BITTREX:UQCUSD",
+ "UQC/HUSD": "BITTREX:UQCUSD",
+ "UQC/DAI": "BITTREX:UQCUSD",
+ "UQC/PAX": "BITTREX:UQCUSD",
"UTK/BTC": "BINANCE:UTKBTC",
- "UTK/ETH": "KUCOIN:UTKETH",
- "UTK/USDT": "BINANCE:UTKUSDT",
+ "UTK/ETH": "HUOBI:UTKETH",
+ "UTK/USDT": "BINANCE:UTKUSD",
+ "UTK/BUSD": "BINANCE:UTKUSD",
+ "UTK/USDC": "BINANCE:UTKUSD",
+ "UTK/TUSD": "BINANCE:UTKUSD",
+ "UTK/HUSD": "BINANCE:UTKUSD",
+ "UTK/DAI": "BINANCE:UTKUSD",
+ "UTK/PAX": "BINANCE:UTKUSD",
"VAL/BTC": "BITTREX:VALBTC",
"VAL/USDT": "BITTREX:VALUSD",
"VAL/BUSD": "BITTREX:VALUSD",
@@ -1418,13 +1550,31 @@ QtObject {
"VAL/HUSD": "BITTREX:VALUSD",
"VAL/DAI": "BITTREX:VALUSD",
"VAL/PAX": "BITTREX:VALUSD",
+ "VITE/BTC": "BINANCE:VITEBTC",
+ "VITE/USDT": "BINANCE:VITEUSD",
+ "VITE/BUSD": "BINANCE:VITEUSD",
+ "VITE/USDC": "BINANCE:VITEUSD",
+ "VITE/TUSD": "BINANCE:VITEUSD",
+ "VITE/HUSD": "BINANCE:VITEUSD",
+ "VITE/DAI": "BINANCE:VITEUSD",
+ "VITE/PAX": "BINANCE:VITEUSD",
"VRA/BTC": "KUCOIN:VRABTC",
- "VRA/ETH": "HITBTC:VRAETH",
- "VRA/USDT": "KUCOIN:VRAUSDT",
+ "VRA/USDT": "BITTREX:VRAUSD",
+ "VRA/BUSD": "BITTREX:VRAUSD",
+ "VRA/USDC": "BITTREX:VRAUSD",
+ "VRA/TUSD": "BITTREX:VRAUSD",
+ "VRA/HUSD": "BITTREX:VRAUSD",
+ "VRA/DAI": "BITTREX:VRAUSD",
+ "VRA/PAX": "BITTREX:VRAUSD",
"WBTC/BTC": "BINANCE:WBTCBTC",
"WBTC/ETH": "BINANCE:WBTCETH",
- "WBTC/USDT": "BITTREX:WBTCUSDT",
- "WBTC/USDC": "UNISWAP:WBTCUSDC",
+ "WBTC/USDT": "COINBASE:WBTCUSD",
+ "WBTC/BUSD": "COINBASE:WBTCUSD",
+ "WBTC/USDC": "COINBASE:WBTCUSD",
+ "WBTC/TUSD": "COINBASE:WBTCUSD",
+ "WBTC/HUSD": "COINBASE:WBTCUSD",
+ "WBTC/DAI": "COINBASE:WBTCUSD",
+ "WBTC/PAX": "COINBASE:WBTCUSD",
"XLM/BTC": "BINANCE:XLMBTC",
"XLM/ETH": "BINANCE:XLMETH",
"XLM/USDT": "COINBASE:XLMUSD",
@@ -1436,7 +1586,16 @@ QtObject {
"XLM/PAX": "COINBASE:XLMUSD",
"XLM/BNB": "BINANCE:XLMBNB",
"XLM/EURS": "KRAKEN:XLMEUR",
+ "XLM/TRYB": "BINANCE:XLMTRY",
"XLM/BCH": "HITBTC:XLMBCH",
+ "XMY/BTC": "BITTREX:XMYBTC",
+ "XMY/USDT": "BITTREX:XMYUSD",
+ "XMY/BUSD": "BITTREX:XMYUSD",
+ "XMY/USDC": "BITTREX:XMYUSD",
+ "XMY/TUSD": "BITTREX:XMYUSD",
+ "XMY/HUSD": "BITTREX:XMYUSD",
+ "XMY/DAI": "BITTREX:XMYUSD",
+ "XMY/PAX": "BITTREX:XMYUSD",
"XRP/BTC": "BINANCE:XRPBTC",
"XRP/ETH": "BINANCE:XRPETH",
"XRP/USDT": "BITSTAMP:XRPUSD",
@@ -1448,6 +1607,7 @@ QtObject {
"XRP/PAX": "BITSTAMP:XRPUSD",
"XRP/BNB": "BINANCE:XRPBNB",
"XRP/EURS": "HITBTC:XRPEURS",
+ "XRP/TRYB": "BINANCE:XRPTRY",
"XRP/BCH": "HITBTC:XRPBCH",
"XRP/HT": "HUOBI:XRPHT",
"XTZ/BTC": "BINANCE:XTZBTC",
@@ -1513,6 +1673,7 @@ QtObject {
"ZIL/HUSD": "BINANCE:ZILUSD",
"ZIL/DAI": "BINANCE:ZILUSD",
"ZIL/PAX": "BINANCE:ZILUSD",
+ "ZIL/BIDR": "BINANCE:ZILBIDR",
"ZIL/BNB": "BINANCE:ZILBNB",
"ZRX/BTC": "BINANCE:ZRXBTC",
"ZRX/ETH": "BINANCE:ZRXETH",
diff --git a/atomic_defi_design/qml/Constants/Style.qml b/atomic_defi_design/qml/Constants/Style.qml
index 26540d1fa0..e1ec399b31 100644
--- a/atomic_defi_design/qml/Constants/Style.qml
+++ b/atomic_defi_design/qml/Constants/Style.qml
@@ -239,22 +239,18 @@ QtObject {
return Style.colorWhite4
}
- function getCoinTypeColor(type) {
- switch (type) {
- case 'ERC-20':
- return getCoinColor("ETH")
- case 'QRC-20':
- return getCoinColor("QTUM")
- case 'Smart Chain':
- return getCoinColor("KMD")
- case 'UTXO':
- return getCoinColor("BTC")
- case 'BEP-20':
- return getCoinColor("BNB")
- case 'SLP':
- return getCoinColor("BCH")
- default:
- return getCoinColor("BTC")
+ function getCoinTypeColor(type)
+ {
+ switch (type)
+ {
+ case 'ERC-20': return getCoinColor("ETH")
+ case 'QRC-20': return getCoinColor("QTUM")
+ case 'Smart Chain': return getCoinColor("KMD")
+ case 'UTXO': return getCoinColor("BTC")
+ case 'BEP-20': return getCoinColor("BNB")
+ case 'SLP': return getCoinColor("BCH")
+ case 'IDO': return getCoinColor("TKL")
+ default: return getCoinColor("BTC")
}
}
@@ -266,17 +262,21 @@ QtObject {
readonly property var colorCoin: ({
"ABY": "#8B0D10",
"ADA": "#214D78",
+ "ADX": "#1B75BC",
"ANKR": "#2075E8",
"ARPA": "#CCD9E2",
"ATOM": "#474B6C",
"AUR": "#0A6C5E",
+ "AVA": "#5B567F",
"AVAX": "#E84142",
"BAL": "#4D4D4D",
"BNB": "#F3BA2F",
"BCH": "#8DC351",
+ "BIDR": "#F0B90B",
"BSTY": "#78570D",
"BTC": "#F7931A",
"BTT": "#666666",
+ "BTE": "#FFE201",
"CAKE": "#D1884F",
"CDN": "#90191C",
"CLC": "#0970DC",
@@ -288,20 +288,26 @@ QtObject {
"GLEEC": "#8C41FF",
"GRS": "#377E96",
"IOTA": "#404040",
+ "JSTR": "#627EEA",
"DOGE": "#C3A634",
"ETC": "#328432",
"ETH": "#627EEA",
+ "ETHR": "#627EEA",
"KMD": "#2B6680",
"MORTY": "#A4764D",
"RICK": "#A5CBDD",
"EMC2": "#00CCFF",
+ "INJ": "#17EAE9",
"DASH": "#008CE7",
"RVN": "#384182",
"DGB": "#006AD2",
"DOT": "#E80082",
"FIRO": "#BB2100",
+ "LBC": "#00775C",
"LTC": "#BFBBBB",
"LYNX": "#0071BA",
+ "XPM": "#A67522",
+ "XVC": "#B50126",
"ZEC": "#ECB244",
"ZER": "#FFFFFF",
"NAV": "#7D59B5",
@@ -309,6 +315,7 @@ QtObject {
"ECA": "#A915DC",
"QTUM": "#2E9AD0",
"CHIPS": "#598182",
+ "CIPHS": "#ECD900",
"AXE": "#C63877",
"PANGEA": "#D88245",
"JUMBLR": "#2B4649",
@@ -317,12 +324,14 @@ QtObject {
"CRYPTO": "#F58736",
"LABS": "#C1F6E1",
"LCC": "#068210",
+ "MESH": "#0098DA",
"MGW": "#854F2F",
"MONA": "#DEC799",
"NMC": "#186C9D",
"RFOX": "#D83331",
"BOTS": "#F69B57",
"MCL": "#EA0000",
+ "MM": "#F5B700",
"CCL": "#FFE400",
"BET": "#F69B57",
"JRT": "#5EFC84",
@@ -331,17 +340,20 @@ QtObject {
"REVS": "#F69B57",
"ILN": "#523170",
"VRSC": "#3164D3",
+ "WCN": "#E49F00",
"THC": "#819F6F",
"1INCH": "#95A7C5",
+ "BABYDOGE": "#F3AA47",
"BAT": "#FF5000",
"BUSD": "#EDB70B",
"DAI": "#B68900",
"USDC": "#317BCB",
"USDT": "#26A17B",
- "PAX": "#EDE70A",
- "PAXG": "#E5CB22",
+ "PAX": "#408C69",
+ "PAXG": "#DABE37",
"SMTF": "#F75836",
"SUSHI": "#E25DA8",
+ "TRYB": "#0929AA",
"TUSD": "#2E3181",
"AWC": "#31A5F6",
"VRA": "#D70A41",
@@ -353,6 +365,7 @@ QtObject {
"AGI": "#6815FF",
"BAND": "#526BFF",
"BLK": "#595959",
+ "IL8P": "#696969",
"BNT": "#0000FF",
"BTCZ": "#F5B036",
"CEL": "#4055A6",
@@ -361,6 +374,7 @@ QtObject {
"CRO": "#243565",
"CVC": "#3AB03E",
"CVT": "#4B0082",
+ "PIC": "#04D9FF",
"DODO": "#FFF706",
"EFL": "#FF940B",
"EGLD": "#1D4CB5",
@@ -378,10 +392,11 @@ QtObject {
"LINK": "#356CE4",
"LRC": "#32C2F8",
"MANA": "#FF3C6C",
- "MATIC": "#1E61ED",
- "MED": "#00B5FF",
+ "MATIC": "#804EE1",
"MKR": "#1BAF9F",
"NEAR": "#595959",
+ "NVC": "#FCF96D",
+ "OCEAN": "#595959",
"ONT": "#2692AF",
"POWR": "#05BCAA",
"QI": "#FFFFFF",
@@ -399,15 +414,19 @@ QtObject {
"STORJ": "#2683FF",
"SXP": "#FD5F3B",
"SYS": "#0084C7",
+ "TKL": "#1E2835",
"TRC": "#096432",
"TRX": "#F30031",
"TSL": "#64B082",
"UIS": "#008DCD",
+ "UNO": "#2F87BB",
"VAL": "#1EEC84",
+ "VITE": "#007AFF",
"VRM": "#586A7A",
"WSB": "#FEBB84",
"WBTC": "#CCCCCC",
"XLM": "#737373",
+ "XMY": "#F01385",
"XRP": "#2E353D",
"XTZ": "#A8E000",
"XVS": "#F4BC54",
diff --git a/atomic_defi_design/qml/Dashboard/FatalErrorModal.qml b/atomic_defi_design/qml/Dashboard/FatalErrorModal.qml
index ed802b4d11..6ed4cb0b52 100644
--- a/atomic_defi_design/qml/Dashboard/FatalErrorModal.qml
+++ b/atomic_defi_design/qml/Dashboard/FatalErrorModal.qml
@@ -3,6 +3,7 @@ import QtQuick.Layouts 1.15
import QtQuick.Controls 2.15
import "../Constants"
+import App 1.0
import "../Components"
BasicModal {
diff --git a/atomic_defi_design/qml/Dashboard/NewUpdateModal.qml b/atomic_defi_design/qml/Dashboard/NewUpdateModal.qml
index 100bdd39a7..2c9ca2d0b6 100644
--- a/atomic_defi_design/qml/Dashboard/NewUpdateModal.qml
+++ b/atomic_defi_design/qml/Dashboard/NewUpdateModal.qml
@@ -5,7 +5,8 @@ import QtQuick.Controls 2.15 //> ProgressBar
// Project imports
import "../Components" //> BasicModal
-import "../Constants" //> API.app.self_update_service
+import "../Constants"
+import App 1.0 //> API.app.self_update_service
BasicModal
{
diff --git a/atomic_defi_design/qml/Dashboard/NotificationsModal.qml b/atomic_defi_design/qml/Dashboard/NotificationsModal.qml
index 4e0f7cf56b..a00f0ad1a5 100644
--- a/atomic_defi_design/qml/Dashboard/NotificationsModal.qml
+++ b/atomic_defi_design/qml/Dashboard/NotificationsModal.qml
@@ -5,32 +5,40 @@ import Qt.labs.platform 1.0
import Qaterial 1.0 as Qaterial
import "../Constants"
+import App 1.0
import "../Components"
-Popup {
+DexPopup {
id: root
width: 400
height: 440
- x: !sidebar.expanded? 100 : 230
- y: 30
- dim: false
- modal: false
- property var notification_map: [{icon: Qaterial.Icons.arrowUpCircleOutline,color: theme.redColor}, {icon: Qaterial.Icons.arrowDownCircleOutline,color: theme.greenColor}, {icon: Qaterial.Icons.emailOutline,color: theme.foregroundColor}]
- background: FloatingBackground {}
+
+ property
+ var notification_map: [{
+ icon: Qaterial.Icons.arrowUpCircleOutline,
+ color: DexTheme.redColor
+ }, {
+ icon: Qaterial.Icons.arrowDownCircleOutline,
+ color: DexTheme.greenColor
+ }, {
+ icon: Qaterial.Icons.emailOutline,
+ color: DexTheme.foregroundColor
+ }]
+ backgroundColor: Qt.darker(DexTheme.dexBoxBackgroundColor, 0.9)
function reset() {
notifications_list = []
root.close()
}
- enum NotificationKind
- {
- Send,
- Receive,
- Others
- }
+ enum NotificationKind {
+ Send,
+ Receive,
+ Others
+ }
+
function showApp() {
- switch(window.real_visibility) {
+ switch (window.real_visibility) {
case 4:
window.showMaximized()
break
@@ -48,44 +56,75 @@ Popup {
function performNotificationAction(notification) {
root.close()
- switch(notification.click_action) {
- case "open_notifications":
- root.open()
- break
- case "open_wallet_page":
- api_wallet_page.ticker = notification.params.ticker
- dashboard.current_page = idx_dashboard_wallet
- break
- case "open_swaps_page":
- dashboard.current_page = idx_dashboard_exchange
-
- dashboard.loader.onLoadComplete = () => {
- dashboard.current_component.current_page = dashboard.isSwapDone(notification.params.new_swap_status) ? idx_exchange_history : idx_exchange_orders
- }
- break
- case "open_log_modal":
- showError(notification.title, notification.long_message)
- break
- default:
- console.log("Unknown notification click action", notification.click_action)
- break
+ switch (notification.click_action) {
+ case "open_notifications":
+ root.open()
+ break
+ case "open_wallet_page":
+ api_wallet_page.ticker = notification.params.ticker
+ dashboard.current_page = idx_dashboard_wallet
+ break
+ case "open_swaps_page":
+ dashboard.current_page = idx_dashboard_exchange
+
+ dashboard.loader.onLoadComplete = () => {
+ dashboard.current_component.current_page = dashboard.isSwapDone(notification.params.new_swap_status) ? idx_exchange_history : idx_exchange_orders
+ }
+ break
+ case "open_log_modal":
+ showError(notification.title, notification.long_message)
+ break
+ default:
+ console.log("Unknown notification click action", notification.click_action)
+ break
}
}
+
function newNotification(event_name, params, id, title, message, human_date, click_action = "open_notifications", long_message = "") {
-
+
let obj;
- if (title.indexOf("You received")!==-1 ) {
- obj = { event_name, params, id, title, message, human_date, click_action, long_message, kind:NotificationsModal.NotificationKind.Receive }
- } else if(title.indexOf("You sent")!==-1) {
- obj = { event_name, params, id, title, message, human_date, click_action, long_message, kind:NotificationsModal.NotificationKind.Send }
+ if (title.indexOf("You received") !== -1) {
+ obj = {
+ event_name,
+ params,
+ id,
+ title,
+ message,
+ human_date,
+ click_action,
+ long_message,
+ kind: NotificationsModal.NotificationKind.Receive
+ }
+ } else if (title.indexOf("You sent") !== -1) {
+ obj = {
+ event_name,
+ params,
+ id,
+ title,
+ message,
+ human_date,
+ click_action,
+ long_message,
+ kind: NotificationsModal.NotificationKind.Send
+ }
} else {
- obj = { event_name, params, id, title, message, human_date, click_action, long_message, kind:NotificationsModal.NotificationKind.Others }
+ obj = {
+ event_name,
+ params,
+ id,
+ title,
+ message,
+ human_date,
+ click_action,
+ long_message,
+ kind: NotificationsModal.NotificationKind.Others
+ }
}
-
+
// Update if it already exists
let updated_existing_one = false
- for(let i = 0; i < notifications_list.length; ++i) {
- if(notifications_list[i].id === obj.id) {
+ for (let i = 0; i < notifications_list.length; ++i) {
+ if (notifications_list[i].id === obj.id) {
notifications_list[i] = General.clone(obj)
updated_existing_one = true
break
@@ -93,7 +132,7 @@ Popup {
}
// Add new line
- if(!updated_existing_one) {
+ if (!updated_existing_one) {
notifications_list = [obj].concat(notifications_list)
}
@@ -101,37 +140,50 @@ Popup {
displayMessage(obj.title, obj.message)
// Refresh the list if updated an existing one
- if(updated_existing_one)
+ if (updated_existing_one)
notifications_list = notifications_list
}
// Events
function onUpdateSwapStatus(old_swap_status, new_swap_status, swap_uuid, base_coin, rel_coin, human_date) {
- newNotification("onUpdateSwapStatus",
- { old_swap_status, new_swap_status, swap_uuid, base_coin, rel_coin, human_date },
- swap_uuid,
- base_coin + "/" + rel_coin + " - " + qsTr("Swap status updated"),
- getStatusText(old_swap_status) + " " + General.right_arrow_icon + " " + getStatusText(new_swap_status),
- human_date,
- "open_swaps_page")
+ newNotification("onUpdateSwapStatus", {
+ old_swap_status,
+ new_swap_status,
+ swap_uuid,
+ base_coin,
+ rel_coin,
+ human_date
+ },
+ swap_uuid,
+ base_coin + "/" + rel_coin + " - " + qsTr("Swap status updated"),
+ getStatusText(old_swap_status) + " " + General.right_arrow_icon + " " + getStatusText(new_swap_status),
+ human_date,
+ "open_swaps_page")
}
function onBalanceUpdateStatus(am_i_sender, amount, ticker, human_date, timestamp) {
const change = General.formatCrypto("", amount, ticker)
- newNotification("onBalanceUpdateStatus",
- { am_i_sender, amount, ticker, human_date, timestamp },
- timestamp,
- am_i_sender ? qsTr("You sent %1").arg(change) : qsTr("You received %1").arg(change),
- qsTr("Your wallet balance changed"),
- human_date,
- "open_wallet_page")
+ if(!app.segwit_on) {
+ newNotification("onBalanceUpdateStatus", {
+ am_i_sender,
+ amount,
+ ticker,
+ human_date,
+ timestamp
+ },
+ timestamp,
+ am_i_sender ? qsTr("You sent %1").arg(change) : qsTr("You received %1").arg(change),
+ qsTr("Your wallet balance changed"),
+ human_date,
+ "open_wallet_page")
+ } else { app.segwit_on = false }
}
readonly property string check_internet_connection_text: qsTr("Please check your internet connection (e.g. VPN service or firewall might block it).")
function onEnablingCoinFailedStatus(coin, error, human_date, timestamp) {
// Check if there is mismatch error, ignore this one
- for(let n of notifications_list) {
- if(n.event_name === "onMismatchCustomCoinConfiguration" && n.params.asset === coin) {
+ for (let n of notifications_list) {
+ if (n.event_name === "onMismatchCustomCoinConfiguration" && n.params.asset === coin) {
console.log("Ignoring onEnablingCoinFailedStatus event because onMismatchCustomCoinConfiguration exists for", coin)
return
}
@@ -142,14 +194,18 @@ Popup {
error = check_internet_connection_text + "\n\n" + error
- newNotification("onEnablingCoinFailedStatus",
- { coin, error, human_date, timestamp },
- timestamp,
- title,
- check_internet_connection_text,
- human_date,
- "open_log_modal",
- error)
+ newNotification("onEnablingCoinFailedStatus", {
+ coin,
+ error,
+ human_date,
+ timestamp
+ },
+ timestamp,
+ title,
+ check_internet_connection_text,
+ human_date,
+ "open_log_modal",
+ error)
toast.show(title, General.time_toast_important_error, error)
}
@@ -159,14 +215,17 @@ Popup {
const error = qsTr("Could not reach to endpoint") + ". " + check_internet_connection_text + "\n\n" + base_uri
- newNotification("onEndpointNonReacheableStatus",
- { base_uri, human_date, timestamp },
- timestamp,
- title,
- base_uri,
- human_date,
- "open_log_modal",
- error)
+ newNotification("onEndpointNonReacheableStatus", {
+ base_uri,
+ human_date,
+ timestamp
+ },
+ timestamp,
+ title,
+ base_uri,
+ human_date,
+ "open_log_modal",
+ error)
toast.show(title, General.time_toast_important_error, error)
}
@@ -174,28 +233,33 @@ Popup {
function onMismatchCustomCoinConfiguration(asset, human_date, timestamp) {
const title = qsTr("Mismatch at %1 custom asset configuration", "TICKER").arg(asset)
- newNotification("onMismatchCustomCoinConfiguration",
- { asset, human_date, timestamp },
- timestamp,
- title,
- qsTr("Application needs to be restarted for %1 custom asset.", "TICKER").arg(asset),
- human_date)
+ newNotification("onMismatchCustomCoinConfiguration", {
+ asset,
+ human_date,
+ timestamp
+ },
+ timestamp,
+ title,
+ qsTr("Application needs to be restarted for %1 custom asset.", "TICKER").arg(asset),
+ human_date)
toast.show(title, General.time_toast_important_error, "", true, true)
}
function onBatchFailed(reason, from, human_date, timestamp) {
- const title = qsTr("Batch %1 failed. Reason: %2").arg(from).arg(reason)
+ const title = qsTr("Batch %1 failed. Reason: %2").arg(from).arg(reason)
- newNotification("onBatchFailed",
- { human_date, timestamp },
+ newNotification("onBatchFailed", {
+ human_date,
+ timestamp
+ },
timestamp,
title,
reason,
human_date)
- toast.show(title, General.time_toast_important_error, reason)
- }
+ toast.show(title, General.time_toast_important_error, reason)
+ }
// System
Component.onCompleted: {
@@ -216,7 +280,7 @@ Popup {
}
function displayMessage(title, message) {
- if(API.app.settings_pg.notification_enabled)
+ if (API.app.settings_pg.notification_enabled)
tray.showMessage(title, message)
}
SystemTrayIcon {
@@ -226,10 +290,10 @@ Popup {
tooltip: API.app_name
onMessageClicked: {
- if(notifications_list.length > 0)
- performNotificationAction(notifications_list[0])
- showApp()
- }
+ if (notifications_list.length > 0)
+ performNotificationAction(notifications_list[0])
+ showApp()
+ }
menu: Menu {
MenuItem {
text: qsTr("Show")
@@ -259,21 +323,22 @@ Popup {
Layout.alignment: Qt.AlignVCenter
Layout.fillWidth: true
leftPadding: 15
- font: theme.textType.head6
+ font: DexTypo.head6
text: "Notifications"
}
Qaterial.AppBarButton {
- enabled: list.count>0
+ enabled: list.count > 0
Layout.alignment: Qt.AlignVCenter
+ foregroundColor: DexTheme.foregroundColor
icon.source: Qaterial.Icons.checkAll
onClicked: notifications_list = []
}
}
Rectangle {
height: 2
- color: theme.foregroundColor
+ color: DexTheme.foregroundColor
opacity: .05
- width: parent.width-20
+ width: parent.width - 20
anchors.horizontalCenter: parent.horizontalCenter
anchors.bottom: parent.bottom
}
@@ -296,26 +361,26 @@ Popup {
anchors.fill: parent
model: notifications_list
delegate: Rectangle {
- color: mouseArea.containsMouse? theme.dexBoxBackgroundColor : 'transparent'
+ color: mouseArea.containsMouse ? DexTheme.dexBoxBackgroundColor : 'transparent'
function removeNotification() {
notifications_list.splice(index, 1)
notifications_list = notifications_list
}
- height: _column.height+10
- width: list.width
+ height: _column.height + 10
+ width: list.width - 10
MouseArea {
- id: mouseArea
- hoverEnabled: true
- anchors.fill: parent
- onClicked: {
- performNotificationAction(notifications_list[index])
- removeNotification()
- }
+ id: mouseArea
+ hoverEnabled: true
+ anchors.fill: parent
+ onClicked: {
+ performNotificationAction(notifications_list[index])
+ removeNotification()
+ }
}
RowLayout {
anchors.fill: parent
Item {
- Layout.fillHeight: true
+ Layout.fillHeight: true
Layout.preferredWidth: 60
Qaterial.ColorIcon {
anchors.verticalCenter: parent.verticalCenter
@@ -342,82 +407,83 @@ Popup {
spacing: 5
DexLabel {
text: modelData.title
- font: theme.textType.body1
+ font: DexTypo.body1
width: parent.width
wrapMode: Label.Wrap
}
DexLabel {
text: modelData.message
- font: theme.textType.subtitle2
+ font: DexTypo.subtitle2
width: parent.width
wrapMode: Label.Wrap
- color: theme.accentColor
+ color: DexTheme.accentColor
}
DexLabel {
text: modelData.human_date
- font: theme.textType.caption
+ font: DexTypo.caption
}
-
+
}
Qaterial.AppBarButton {
- id: action_button
- scale: .6
- anchors.bottom: parent.bottom
- anchors.right: parent.right
- anchors.bottomMargin: -4
- icon.source: {
- let name
- switch(modelData.event_name) {
- case "onEnablingCoinFailedStatus":
- name = "repeat"
- break
- case "onMismatchCustomCoinConfiguration":
- name = "restart-alert"
- break
- default:
- name = "check"
- break
- }
-
- return General.qaterialIcon(name)
- }
-
- function removeNotification() {
- notifications_list.splice(index, 1)
- notifications_list = notifications_list
- }
-
- onClicked: {
- // Action might create another event so we save it and then remove the current one, then take the action
- const event_before_removal = General.clone(modelData)
-
- // Action
- switch(event_before_removal.event_name) {
- case "onEnablingCoinFailedStatus":
- removeNotification()
- 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
- }
- }
- }
+ id: action_button
+ scale: .6
+ anchors.bottom: parent.bottom
+ anchors.right: parent.right
+ anchors.bottomMargin: -4
+ foregroundColor: DexTheme.foregroundColor
+ icon.source: {
+ let name
+ switch (modelData.event_name) {
+ case "onEnablingCoinFailedStatus":
+ name = "repeat"
+ break
+ case "onMismatchCustomCoinConfiguration":
+ name = "restart-alert"
+ break
+ default:
+ name = "check"
+ break
+ }
+
+ return General.qaterialIcon(name)
+ }
+
+ function removeNotification() {
+ notifications_list.splice(index, 1)
+ notifications_list = notifications_list
+ }
+
+ onClicked: {
+ // Action might create another event so we save it and then remove the current one, then take the action
+ const event_before_removal = General.clone(modelData)
+
+ // Action
+ switch (event_before_removal.event_name) {
+ case "onEnablingCoinFailedStatus":
+ removeNotification()
+ 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
+ }
+ }
+ }
}
}
-
+
Rectangle {
height: 2
- color: theme.foregroundColor
+ color: DexTheme.foregroundColor
opacity: .05
- visible: !(list.count==index+1)
- width: parent.width-20
+ visible: !(list.count == index + 1)
+ width: parent.width - 20
anchors.horizontalCenter: parent.horizontalCenter
anchors.bottom: parent.bottom
}
@@ -425,4 +491,4 @@ Popup {
}
}
}
-}
+}
\ No newline at end of file
diff --git a/atomic_defi_design/qml/Exchange/Exchange.qml b/atomic_defi_design/qml/Exchange/Exchange.qml
index 027eccd562..8a46cf1bbe 100644
--- a/atomic_defi_design/qml/Exchange/Exchange.qml
+++ b/atomic_defi_design/qml/Exchange/Exchange.qml
@@ -3,12 +3,13 @@ import QtQuick.Layouts 1.15
import QtQuick.Controls 2.15
import "../Components"
-import "../Constants"
+
import "./Trade"
-import "./Orders"
-import "./History"
+
+import App 1.0
Item {
+
id: exchange
readonly property int layout_margin: 15
diff --git a/atomic_defi_design/qml/Exchange/Trade/BestOrder/Header.qml b/atomic_defi_design/qml/Exchange/Trade/BestOrder/Header.qml
index 280bffbca2..26d12b2943 100644
--- a/atomic_defi_design/qml/Exchange/Trade/BestOrder/Header.qml
+++ b/atomic_defi_design/qml/Exchange/Trade/BestOrder/Header.qml
@@ -4,8 +4,9 @@ import QtQuick.Controls 2.15
import Qaterial 1.0 as Qaterial
+import App 1.0
+
import "../../../Components"
-import "../../../Constants"
Item {
property bool is_horizontal: false
@@ -14,7 +15,7 @@ Item {
z: 2
Rectangle {
anchors.fill: parent
- color: theme.dexBoxBackgroundColor
+ color: DexTheme.portfolioPieGradient ? "transparent" : DexTheme.dexBoxBackgroundColor
}
RowLayout {
@@ -23,7 +24,7 @@ Item {
anchors.horizontalCenter: parent.horizontalCenter
DefaultText {
Layout.alignment: Qt.AlignVCenter
- Layout.preferredWidth: 140
+ Layout.preferredWidth: 130
text: sell_mode? qsTr("You get") : qsTr("You send")
font.family: Style.font_family
font.pixelSize: 10
@@ -42,10 +43,6 @@ Item {
horizontalAlignment: Label.AlignRight
}
- Item {
- Layout.fillWidth: true
- Layout.fillHeight: true
- }
DefaultText {
Layout.alignment: Qt.AlignVCenter
//Layout.preferredWidth: 120
diff --git a/atomic_defi_design/qml/Exchange/Trade/BestOrder/List.qml b/atomic_defi_design/qml/Exchange/Trade/BestOrder/List.qml
index ee5401f0c0..db66934273 100644
--- a/atomic_defi_design/qml/Exchange/Trade/BestOrder/List.qml
+++ b/atomic_defi_design/qml/Exchange/Trade/BestOrder/List.qml
@@ -3,7 +3,8 @@ import QtQuick.Layouts 1.15
import QtQuick.Controls 2.15
import Qaterial 1.0 as Qaterial
-import "../../../Constants/"
+
+import App 1.0
Item {
diff --git a/atomic_defi_design/qml/Exchange/Trade/BestOrder/ListDelegate.qml b/atomic_defi_design/qml/Exchange/Trade/BestOrder/ListDelegate.qml
index d91f372d11..2970ce0aa3 100644
--- a/atomic_defi_design/qml/Exchange/Trade/BestOrder/ListDelegate.qml
+++ b/atomic_defi_design/qml/Exchange/Trade/BestOrder/ListDelegate.qml
@@ -6,11 +6,13 @@ import QtQuick.Controls 2.15
import Qaterial 1.0 as Qaterial
import "../../../Components"
-import "../../../Constants"
+import "../../../Constants" as Constants
+
+import App 1.0 as App
Item {
id: _control
- property bool coinEnable: API.app.portfolio_pg.global_cfg_mdl.get_coin_info(coin).is_enabled
+ property bool coinEnable: Constants.API.app.portfolio_pg.global_cfg_mdl.get_coin_info(coin).is_enabled
property var isAsk: {
if(parseInt(cex_rates)>0){
false
@@ -28,7 +30,7 @@ Item {
visible: mouse_are.containsMouse
width: parent.width
height: parent.height
- color: theme.foregroundColor
+ color: App.DexTheme.foregroundColor
opacity: 0.1
}
@@ -40,11 +42,11 @@ Item {
spacing: 10
Row {
Layout.alignment: Qt.AlignVCenter
- Layout.preferredWidth: 140
+ Layout.preferredWidth: 130
leftPadding: -10
spacing: 5
Image {
- source: General.coinIcon(coin)
+ source: Constants.General.coinIcon(coin)
width: 20
height: 20
smooth: true
@@ -56,7 +58,8 @@ Item {
anchors.verticalCenter: parent.verticalCenter
leftPadding: 2
text: send + " " + atomic_qt_utilities.retrieve_main_ticker(coin)
- font.pixelSize: Style.textSizeSmall1
+ font.family: App.DexTypo.fontFamily
+ font.pixelSize: 10
}
}
@@ -75,7 +78,7 @@ Item {
if(link==="#no") {
_tooltip.close()
}else {
- if (API.app.enable_coins([coin]) === true) {
+ if (Constants.API.app.enable_coins([coin]) === true) {
_control.coinEnable = true
_tooltip.close()
}
@@ -97,23 +100,19 @@ Item {
DexLabel {
Layout.alignment: Qt.AlignVCenter
Layout.preferredWidth: 70
- text: price_fiat+API.app.settings_pg.current_fiat_sign
- font: theme.textType.caption
+ text: price_fiat + Constants.API.app.settings_pg.current_fiat_sign
+ font.family: App.DexTypo.fontFamily
+ font.pixelSize: 10
horizontalAlignment: Label.AlignRight
opacity: 1
}
- Item {
- Layout.fillWidth: true
- Layout.fillHeight: true
-
-
- }
- DefaultText {
+ DexLabel {
Layout.alignment: Qt.AlignVCenter
text: cex_rates==="0"? "N/A" : parseFloat(cex_rates)>0? "+"+parseFloat(cex_rates).toFixed(2)+"%" : parseFloat(cex_rates).toFixed(2)+"%"
-
+ font.family: App.DexTypo.fontFamily
+ font.pixelSize: 10
Behavior on rightPadding {
NumberAnimation {
@@ -121,9 +120,8 @@ Item {
}
}
- color:cex_rates==="0"? Qt.darker(theme.foregroundColor) : parseFloat(cex_rates)<0? Style.colorGreen : Style.colorRed
+ color:cex_rates==="0"? Qt.darker(App.DexTheme.foregroundColor) : parseFloat(cex_rates)<0? App.DexTheme.greenColor : App.DexTheme.redColor
horizontalAlignment: Label.AlignRight
- font.pixelSize: Style.textSizeSmall1
opacity: 1
}
@@ -135,11 +133,11 @@ Item {
anchors.fill: parent
hoverEnabled: true
onClicked: {
- if(!API.app.portfolio_pg.global_cfg_mdl.get_coin_info(coin).is_enabled){
+ if(!Constants.API.app.portfolio_pg.global_cfg_mdl.get_coin_info(coin).is_enabled){
_tooltip.open()
}else {
app.pairChanged(base_ticker, coin)
- API.app.trading_pg.orderbook.select_best_order(uuid)
+ Constants.API.app.trading_pg.orderbook.select_best_order(uuid)
}
//if(is_mine) return
@@ -148,6 +146,7 @@ Item {
}
HorizontalLine {
width: parent.width
+ opacity: .4
}
}
diff --git a/atomic_defi_design/qml/Exchange/Trade/CandleStickChart.qml b/atomic_defi_design/qml/Exchange/Trade/CandleStickChart.qml
index 877e0759c5..f9e7e54ea7 100644
--- a/atomic_defi_design/qml/Exchange/Trade/CandleStickChart.qml
+++ b/atomic_defi_design/qml/Exchange/Trade/CandleStickChart.qml
@@ -6,17 +6,18 @@ import QtCharts 2.3
import QtWebEngine 1.8
import "../../Components"
-import "../../Constants"
+
+import App 1.0
// List
-InnerBackground {
+DexBox {
id: graph_bg
-
anchors.left: parent.left
anchors.right: parent.right
anchors.top: parent.top
+
content: Item {
id: root
@@ -44,6 +45,9 @@ InnerBackground {
DefaultText {
visible: !pair_supported
+ onVisibleChanged: if(visible) {
+ dex_chart.visible = false
+ }
text_value: qsTr("There is no chart data for this pair yet")
anchors.centerIn: parent
}
@@ -57,7 +61,7 @@ InnerBackground {
}
}
- readonly property string theme: app.globalTheme.chartTheme
+ readonly property string theme: DexTheme.chartTheme
onThemeChanged: try{loadChart(left_ticker?? atomic_app_primary_coin, right_ticker?? atomic_app_secondary_coin, true)}catch(e){}
property string chart_base
diff --git a/atomic_defi_design/qml/Exchange/Trade/ConfirmTradeModal.qml b/atomic_defi_design/qml/Exchange/Trade/ConfirmTradeModal.qml
index c2bb908438..7f9ae145b8 100644
--- a/atomic_defi_design/qml/Exchange/Trade/ConfirmTradeModal.qml
+++ b/atomic_defi_design/qml/Exchange/Trade/ConfirmTradeModal.qml
@@ -9,40 +9,14 @@ import ".."
import "Orders/"
+import App 1.0
+
BasicModal {
id: root
- width: 1100
-
- onOpened: reset()
-
- function reset() {
- API.app.trading_pg.determine_fees()
- }
- function isEmpty(data){
- console.log(JSON.stringify(data))
- if(data.length<0) {
- return true
- }else {
- return false
- }
- }
- function isVisible(n){
-
- return isEmpty(fees_data)? false : parseFloat(n)===0? false: true
- }
-
- Connections {
- target: API.app.trading_pg
- function onFeesChanged() {
- fees_data = API.app.trading_pg.fees
- API.app.trading_pg.determine_error_cases()
- }
- }
+ width: 650
- onClosed: {
- API.app.trading_pg.reset_fees()
- }
+ readonly property var fees: API.app.trading_pg.fees
ModalContent {
title: qsTr("Confirm Exchange Details")
@@ -67,9 +41,14 @@ BasicModal {
in_modal: true
}
- PriceLine {
+ Column {
Layout.alignment: Qt.AlignHCenter
+ Layout.preferredWidth: 500
+ PriceLineSimplified {
+ width: 500
+ }
}
+
HorizontalLine {
Layout.topMargin: 10
@@ -77,27 +56,23 @@ BasicModal {
Layout.fillWidth: true
}
- FloatingBackground {
+ Column {
+ Layout.preferredWidth: 500
Layout.alignment: Qt.AlignHCenter
Layout.bottomMargin: 10
- color: Style.colorTheme5
-
- width: warning_texts.width + 20
- height: warning_texts.height + 20
-
ColumnLayout {
id: warning_texts
- anchors.centerIn: parent
+ width: 500
- DefaultText {
- Layout.alignment: Qt.AlignHCenter
+ DexLabel {
+ Layout.alignment: Qt.AlignLeft
text_value: qsTr("This swap request can not be undone and is a final event!")
}
- DefaultText {
- Layout.alignment: Qt.AlignHCenter
+ DexLabel {
+ Layout.alignment: Qt.AlignLeft
text_value: qsTr("This transaction can take up to 60 mins - DO NOT close this application!")
font.pixelSize: Style.textSizeSmall4
@@ -105,37 +80,31 @@ BasicModal {
}
}
- HorizontalLine {
- Layout.bottomMargin: 10
- Layout.fillWidth: true
- visible: !isEmpty(fees_data)
- }
-
Item {
- Layout.fillWidth: true
- Layout.preferredHeight: 120
- visible: !isEmpty(fees_data)
+ Layout.preferredWidth: 500
+ Layout.alignment: Qt.AlignHCenter
+ Layout.preferredHeight: feesColumn.height + 10
+ opacity: .7
Column {
- anchors.centerIn: parent
+ id: feesColumn
+ anchors.verticalCenter: parent.verticalCenter
- DefaultListView {
- enabled: isVisible(fees_data.total_fees)
- model: fees_data.total_fees
+ Repeater {
+ model: fees.total_fees
delegate: DefaultText {
- visible: isVisible(modelData.amount)
+ visible: true
text: qsTr("Total %1 fees: %2 (%3)").arg(modelData.coin).arg(parseFloat(modelData.required_balance).toFixed(8) / 1).arg(General.getFiatText(modelData.required_balance, modelData.coin, false))
}
anchors.horizontalCenter: parent.horizontalCenter
}
-
Item {width: 1; height: 10}
DefaultText {
id: errors
anchors.horizontalCenter: parent.horizontalCenter
width: parent.width
horizontalAlignment: DefaultText.AlignHCenter
- font.pixelSize: Style.textSizeSmall4
- color: Style.colorRed
+ font: DexTypo.caption
+ color: DexTheme.redColor
text_value: General.getTradingError(
last_trading_error,
@@ -143,14 +112,9 @@ BasicModal {
base_ticker,
rel_ticker, left_ticker, right_ticker)
}
- Item {width: 1; height: 10}
}
}
- HorizontalLine {
- Layout.bottomMargin: 10
- Layout.fillWidth: true
- }
ColumnLayout {
id: config_section
@@ -187,7 +151,7 @@ BasicModal {
}
// Enable custom config
- DefaultCheckBox {
+ DexCheckBox {
Layout.alignment: Qt.AlignHCenter
id: enable_custom_config
@@ -231,12 +195,14 @@ BasicModal {
}
DefaultText {
+ Layout.preferredHeight: 10
Layout.alignment: Qt.AlignHCenter
text_value: qsTr("Required Confirmations") + ": " + required_confirmation_count.value
- color: parent.enabled ? Style.colorText : Style.colorTextDisabled
+ color: DexTheme.foregroundColor
+ opacity: parent.enabled ? 1 : .6
}
- DefaultSlider {
+ DexSlider {
id: required_confirmation_count
readonly property int default_confirmation_count: 3
Layout.alignment: Qt.AlignHCenter
@@ -277,21 +243,35 @@ BasicModal {
Layout.alignment: Qt.AlignCenter
}
}
-
+ HorizontalLine {
+ Layout.fillWidth: true
+ }
// Buttons
footer: [
- DefaultButton {
- text: qsTr("Cancel")
+ Item {
Layout.fillWidth: true
+ },
+ DexAppButton {
+ text: qsTr("Cancel")
+ padding: 17
+ leftPadding: 45
+ rightPadding: 45
+ radius: 18
onClicked: {
- fees_data = []
+ //fees = []
root.close()
}
},
-
- PrimaryButton {
- text: qsTr("Confirm")
+ Item {
Layout.fillWidth: true
+ },
+ DexGradientAppButton {
+ text: qsTr("Confirm")
+ padding: 17
+ leftPadding: 45
+ rightPadding: 45
+
+ radius: 18
enabled: !buy_sell_rpc_busy && last_trading_error === TradingError.None
onClicked: {
trade({
@@ -301,6 +281,9 @@ BasicModal {
required_confirmation_count: required_confirmation_count.value,
}, config_section.default_config)
}
+ },
+ Item {
+ Layout.fillWidth: true
}
]
}
diff --git a/atomic_defi_design/qml/Exchange/Trade/DefaultSweetModal.qml b/atomic_defi_design/qml/Exchange/Trade/DefaultSweetModal.qml
index c46fc1e86e..e0af2164c5 100644
--- a/atomic_defi_design/qml/Exchange/Trade/DefaultSweetModal.qml
+++ b/atomic_defi_design/qml/Exchange/Trade/DefaultSweetModal.qml
@@ -31,6 +31,4 @@ DefaultModal {
console.log(API.app.trading_pg.preimage_rpc_busy)
}
}
-
-
}
diff --git a/atomic_defi_design/qml/Exchange/Trade/DexComboBoxLine.qml b/atomic_defi_design/qml/Exchange/Trade/DexComboBoxLine.qml
index 883736c049..ebdf866a06 100644
--- a/atomic_defi_design/qml/Exchange/Trade/DexComboBoxLine.qml
+++ b/atomic_defi_design/qml/Exchange/Trade/DexComboBoxLine.qml
@@ -5,7 +5,7 @@ import QtGraphicalEffects 1.0
import QtQuick.Controls.Universal 2.15
import "../../Components"
-import "../../Constants"
+import App 1.0
RowLayout {
id: root
@@ -30,19 +30,28 @@ RowLayout {
anchors.left: parent.right
anchors.leftMargin: 12
anchors.verticalCenter: parent.verticalCenter
+ width: root.width-40
DefaultText {
text_value: !details ? "" :
- `${details.ticker} ${details.name} `
+ `${details.ticker} ${details.name} `
color: Style.colorText
font.pixelSize: Style.textSizeSmall3
}
DexLabel {
id: bottom_line
- text_value: !details ? "" :
- details.balance + " (" + General.formatFiat("", details.main_currency_balance, API.app.settings_pg.current_currency) + ")"
- color: theme.foregroundColor
- font: theme.textType.body2
+ property string real_value: !details ? "" :
+ details.balance + " (" + General.formatFiat("", details.main_currency_balance, API.app.settings_pg.current_fiat_sign) + ")"
+ text: real_value
+ Layout.fillWidth: true
+ elide: Text.ElideRight
+ color: DexTheme.foregroundColor
+ font: DexTypo.body2
+ wrapMode: Label.NoWrap
+ ToolTip.text: real_value
+ Component.onCompleted: {
+ font.pixelSize = 11.5
+ }
}
}
}
diff --git a/atomic_defi_design/qml/Exchange/Trade/OrderBook/Header.qml b/atomic_defi_design/qml/Exchange/Trade/OrderBook/Header.qml
index d964fa1bd3..8cf4d5608e 100644
--- a/atomic_defi_design/qml/Exchange/Trade/OrderBook/Header.qml
+++ b/atomic_defi_design/qml/Exchange/Trade/OrderBook/Header.qml
@@ -4,8 +4,9 @@ import QtQuick.Controls 2.15
import Qaterial 1.0 as Qaterial
+import App 1.0
+
import "../../../Components"
-import "../../../Constants"
Item {
property bool is_ask: false
@@ -15,7 +16,7 @@ Item {
z: 2
Rectangle {
anchors.fill: parent
- color: theme.dexBoxBackgroundColor
+ color: DexTheme.portfolioPieGradient ? "transparent" : DexTheme.dexBoxBackgroundColor
}
RowLayout {
@@ -24,37 +25,33 @@ Item {
anchors.horizontalCenter: parent.horizontalCenter
DefaultText {
Layout.alignment: Qt.AlignVCenter
- Layout.preferredWidth: 80
+ Layout.preferredWidth: 60
text: is_ask? qsTr("Price") + " ("+atomic_qt_utilities.retrieve_main_ticker(right_ticker)+")" : qsTr("Price") + " ("+atomic_qt_utilities.retrieve_main_ticker(right_ticker)+")"
- font.family: Style.font_family
- font.pixelSize: 10
+ font.family: DexTypo.fontFamily
+ font.pixelSize: 9
font.bold: true
- color: is_ask? theme.redColor : theme.greenColor
font.weight: Font.Black
+ color: is_ask? DexTheme.redColor : DexTheme.greenColor
}
DefaultText {
Layout.alignment: Qt.AlignVCenter
- Layout.preferredWidth: 90
+ Layout.preferredWidth: 100
text: qsTr("Quantity") + " ("+ atomic_qt_utilities.retrieve_main_ticker(left_ticker) +")"
- font.family: Style.font_family
- font.pixelSize: 10
+ font.family: DexTypo.fontFamily
+ font.pixelSize: 9
font.bold: true
font.weight: Font.Black
horizontalAlignment: Label.AlignRight
}
- Item {
- Layout.fillWidth: true
- Layout.fillHeight: true
- }
DefaultText {
Layout.alignment: Qt.AlignVCenter
- Layout.preferredWidth: 120
+ Layout.fillWidth: true
text: qsTr("Total") + "("+ atomic_qt_utilities.retrieve_main_ticker(right_ticker) +")"
horizontalAlignment: Label.AlignRight
- font.family: Style.font_family
- font.pixelSize: 10
+ font.family: DexTypo.fontFamily
+ font.pixelSize: 9
font.bold: true
font.weight: Font.Black
}
diff --git a/atomic_defi_design/qml/Exchange/Trade/OrderBook/Horizontal.qml b/atomic_defi_design/qml/Exchange/Trade/OrderBook/Horizontal.qml
index c8cbe8009c..4d0417fe49 100644
--- a/atomic_defi_design/qml/Exchange/Trade/OrderBook/Horizontal.qml
+++ b/atomic_defi_design/qml/Exchange/Trade/OrderBook/Horizontal.qml
@@ -4,8 +4,9 @@ import QtQuick.Controls 2.15
import Qaterial 1.0 as Qaterial
+import App 1.0
+
import "../../../Components"
-import "../../../Constants"
Item {
id: orderBook
diff --git a/atomic_defi_design/qml/Exchange/Trade/OrderBook/List.qml b/atomic_defi_design/qml/Exchange/Trade/OrderBook/List.qml
index a4ffc1f6a7..54af833a8d 100644
--- a/atomic_defi_design/qml/Exchange/Trade/OrderBook/List.qml
+++ b/atomic_defi_design/qml/Exchange/Trade/OrderBook/List.qml
@@ -3,20 +3,23 @@ import QtQuick.Layouts 1.15
import QtQuick.Controls 2.15
import Qaterial 1.0 as Qaterial
-import "../../../Constants/"
+
+import App 1.0
Item {
id: _control
+ property bool hide_header: false
property bool isAsk
property bool isVertical: false
Header {
+ visible: !hide_header
is_ask: isAsk
}
ListView {
id: orderList
- anchors.topMargin: 40
+ anchors.topMargin: hide_header? 0 : 40
anchors.fill: parent
model: isAsk? API.app.trading_pg.orderbook.asks.proxy_mdl : API.app.trading_pg.orderbook.bids.proxy_mdl
clip: true
@@ -25,10 +28,11 @@ Item {
Timer {
id: _tm
interval: 2000
- onTriggered: orderList.positionViewAtEnd()
+ onTriggered: {
+ orderList.positionViewAtEnd()
+ }
}
-
- onCountChanged : {
+ onContentHeightChanged : {
if(isVertical) {
_tm.start()
}
diff --git a/atomic_defi_design/qml/Exchange/Trade/OrderBook/ListDelegate.qml b/atomic_defi_design/qml/Exchange/Trade/OrderBook/ListDelegate.qml
index c4a7835856..b33b8c63a2 100644
--- a/atomic_defi_design/qml/Exchange/Trade/OrderBook/ListDelegate.qml
+++ b/atomic_defi_design/qml/Exchange/Trade/OrderBook/ListDelegate.qml
@@ -5,7 +5,8 @@ import QtQuick.Controls 2.15
import Qaterial 1.0 as Qaterial
import "../../../Components"
-import "../../../Constants"
+
+import App 1.0
Item {
property bool isAsk
@@ -16,7 +17,7 @@ Item {
visible: mouse_are.containsMouse
width: parent.width
height: parent.height
- color: theme.foregroundColor
+ color: DexTheme.foregroundColor
opacity: 0.1
}
@@ -27,14 +28,35 @@ Item {
radius: width/2
x: 3
visible: is_mine
- color: isAsk? Style.colorRed : Style.colorGreen
+ color: isAsk? DexTheme.redColor : DexTheme.greenColor
+ }
+ HorizontalLine {
+ width: parent.width
+ opacity: .4
+ }
+ Rectangle {
+ id: progress
+ height: 2
+ anchors.bottom: parent.bottom
+ radius: 3
+ x: 10
+ color: isAsk? DexTheme.redColor : DexTheme.greenColor
+ width: 0
+ Component.onCompleted: width =((depth * 100) * (parent.width + 40)) / 100
+ opacity: 0.8
+ Behavior on width {
+ NumberAnimation {
+ duration: 1000
+ }
+ }
+ //anchors.verticalCenter: parent.verticalCenter
}
-
RowLayout {
id: row
- width: parent.width - 30
+ width: mouse_are.containsMouse? parent.width - 15 : parent.width - 30
height: parent.height
anchors.horizontalCenter: parent.horizontalCenter
+ onWidthChanged: progress.width = ((depth * 100) * (width + 40)) / 100
spacing: 10
Qaterial.ColorIcon {
visible: mouse_are.containsMouse && !enough_funds_to_pay_min_volume //(min_volume > 0 && API.app.trading_pg.orderbook.base_max_taker_vol.decimal < min_volume) && min_volume !== API.app.trading_pg.mm2_min_volume
@@ -53,48 +75,29 @@ Item {
}
delay: 200
}
- DefaultText {
+ DexLabel {
Layout.alignment: Qt.AlignVCenter
- Layout.preferredWidth: 90
+ Layout.preferredWidth: 60
text: parseFloat(General.formatDouble(
price, General.amountPrecision, true)).toFixed(8)
- font.pixelSize: Style.textSizeSmall1
- color: isAsk? Style.colorRed : Style.colorGreen
+ font.family: DexTypo.fontFamily
+ font.pixelSize: 11
+ color: isAsk? DexTheme.redColor : DexTheme.greenColor
}
- DefaultText {
+ DexLabel {
Layout.alignment: Qt.AlignVCenter
- Layout.preferredWidth: 75
+ Layout.preferredWidth: 100
text: parseFloat(quantity).toFixed(6)
- font.pixelSize: Style.textSizeSmall1
+ font.family: DexTypo.fontFamily
+ font.pixelSize: 11
horizontalAlignment: Label.AlignRight
opacity: 1
}
- Item {
- Layout.fillWidth: true
- Layout.fillHeight: true
- onWidthChanged: progress.width = ((depth * 100) * (width + 40)) / 100
- Rectangle {
- id: progress
- height: 10
- radius: 101
- color: isAsk? Style.colorRed : Style.colorGreen
- width: 0
- Component.onCompleted: width =((depth * 100) * (parent.width + 40)) / 100
- opacity: !isVertical? 1.1-(index * 0.1) : 1-(1.1-(index * 0.1))
- Behavior on width {
- NumberAnimation {
- duration: 1000
- }
- }
- anchors.verticalCenter: parent.verticalCenter
- }
-
- }
- DefaultText {
+ DexLabel {
Layout.alignment: Qt.AlignVCenter
- Layout.preferredWidth: 120
+ Layout.fillWidth: true
text: parseFloat(total).toFixed(8)
Behavior on rightPadding {
NumberAnimation {
@@ -103,7 +106,8 @@ Item {
}
rightPadding: (is_mine) && (mouse_are.containsMouse || cancel_button.containsMouse) ? 30 : 0
horizontalAlignment: Label.AlignRight
- font.pixelSize: Style.textSizeSmall1
+ font.family: DexTypo.fontFamily
+ font.pixelSize: 11
opacity: 1
}
@@ -121,7 +125,13 @@ Item {
}
else {
- isAsk? selectOrder(true, coin, price, quantity, price_denom, price_numer, quantity_denom, quantity_numer, min_volume, base_min_volume) : selectOrder(false, coin, price, quantity, price_denom, price_numer, quantity_denom, quantity_numer, min_volume, base_min_volume)
+ exchange_trade.orderSelected = true
+ orderList.currentIndex = index
+ if(isAsk) {
+ selectOrder(true, 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)
+ }else {
+ selectOrder(false, 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)
+ }
}
@@ -146,7 +156,7 @@ Item {
iconSize: mouse_are.containsMouse || cancel_button.containsMouse? 16 : 0
- color: cancel_button.containsMouse ? Qaterial.Colors.red : mouse_are.containsMouse? Style.colorText2 : Qaterial.Colors.red
+ color: cancel_button.containsMouse ? Qaterial.Colors.red : mouse_are.containsMouse? DexTheme.foregroundColor: Qaterial.Colors.red
DefaultMouseArea {
id: cancel_button
@@ -164,12 +174,10 @@ Item {
}
AnimatedRectangle {
visible: !enough_funds_to_pay_min_volume && mouse_are.containsMouse
- color: Style.colorTheme9
+ color: DexTheme.dexBoxBackgroundColor
anchors.fill: parent
opacity: .3
}
- HorizontalLine {
- width: parent.width
- }
+
}
diff --git a/atomic_defi_design/qml/Exchange/Trade/OrderBook/Vertical.qml b/atomic_defi_design/qml/Exchange/Trade/OrderBook/Vertical.qml
index c4fb3fc33f..4f824e404c 100644
--- a/atomic_defi_design/qml/Exchange/Trade/OrderBook/Vertical.qml
+++ b/atomic_defi_design/qml/Exchange/Trade/OrderBook/Vertical.qml
@@ -5,6 +5,7 @@ import QtQuick.Controls 2.15
import Qaterial 1.0 as Qaterial
import "../../../Components"
+import App 1.0
Item {
id: orderBook
@@ -21,15 +22,26 @@ Item {
color: 'transparent'
ColumnLayout {
anchors.fill: parent
- spacing: 5
+ spacing: 2
List {
isAsk: true
isVertical: true
Layout.fillHeight: true
Layout.fillWidth: true
}
+ Item {
+ Layout.preferredHeight: 4
+ Layout.fillWidth: true
+ Rectangle {
+ width: parent.width
+ height: parent.height
+ anchors.horizontalCenter: parent.horizontalCenter
+ color: DexTheme.surfaceColor
+ }
+ }
List {
isAsk: false
+ hide_header: true
Layout.fillHeight: true
Layout.fillWidth: true
}
diff --git a/atomic_defi_design/qml/Exchange/Trade/Orders/OrderContent.qml b/atomic_defi_design/qml/Exchange/Trade/Orders/OrderContent.qml
index 4dab5e26ea..5f4471a78a 100644
--- a/atomic_defi_design/qml/Exchange/Trade/Orders/OrderContent.qml
+++ b/atomic_defi_design/qml/Exchange/Trade/Orders/OrderContent.qml
@@ -3,123 +3,92 @@ import QtQuick.Layouts 1.15
import QtQuick.Controls 2.15
import QtGraphicalEffects 1.0
+
+import App 1.0
+
+import Qaterial 1.0 as Qaterial
+
import "../../../Components"
-import "../../../Constants"
// Content
Item {
- property var details
+ property
+ var details
property bool in_modal: false
readonly property bool is_placed_order: !details ? false :
- details.order_id !== ''
-
- // Base Icon
- DefaultImage {
- id: base_icon
- source: General.coinIcon(!details ? atomic_app_primary_coin :
- details.base_coin)
- width: in_modal ? Style.textSize5 : Style.textSize3
-
- anchors.left: parent.left
- anchors.leftMargin: parent.width * 0.2
- }
-
- // Rel Icon
- DefaultImage {
- id: rel_icon
- source: General.coinIcon(!details ? atomic_app_primary_coin :
- details.rel_coin)
- width: base_icon.width
- anchors.right: parent.right
- anchors.rightMargin: base_icon.anchors.leftMargin
- }
-
- // Base Amount
- DefaultText {
- id: base_amount
- text_value: !details ? "" :
- "~ " + General.formatCrypto("", details.base_amount, details.base_coin)
- font.pixelSize: in_modal ? Style.textSize2 : Style.textSize
-
- anchors.horizontalCenter: base_icon.horizontalCenter
- anchors.top: base_icon.bottom
- anchors.topMargin: 10
- privacy: is_placed_order
- }
-
- // Swap icon
- SwapIcon {
- anchors.verticalCenter: base_icon.bottom
- anchors.horizontalCenter: parent.horizontalCenter
- top_arrow_ticker: !details ? atomic_app_primary_coin :
- details.base_coin
- bottom_arrow_ticker: !details ? atomic_app_primary_coin :
- details.rel_coin
- }
-
- // Rel Amount
- DefaultText {
- id: rel_amount
- text_value: !details ? "" :
- "~ " + General.formatCrypto("", details.rel_amount, details.rel_coin)
- font.pixelSize: base_amount.font.pixelSize
-
- anchors.horizontalCenter: rel_icon.horizontalCenter
- anchors.top: base_amount.top
- privacy: is_placed_order
- }
-
- // Order ID
- DefaultText {
- id: order_id
- visible: !in_modal && is_placed_order
- text_value: !details ? "" :
- qsTr("ID") + ": " + details.order_id
- color: Style.colorTheme2
- anchors.top: base_amount.bottom
- anchors.topMargin: base_amount.anchors.topMargin
- privacy: is_placed_order
- }
-
- // Status Text
- DefaultText {
- visible: !details ? false : !in_modal && (details.is_swap || !details.is_maker)
- color: !details ? "white" : visible ? getStatusColor(details.order_status) : ''
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.top: base_icon.top
- text_value: !details ? "" :
- visible ? getStatusTextWithPrefix(details.order_status) : ''
- }
-
- // Date
- DefaultText {
- id: date
- visible: !details ? false : !in_modal && details.date !== ''
- text_value: !details ? "" :
- details.date
- color: Style.colorTheme2
- anchors.top: order_id.bottom
- anchors.topMargin: base_amount.anchors.topMargin
- }
-
- // Maker/Taker
- DefaultText {
- visible: !in_modal && is_placed_order
- text_value: !details ? "" :
- details.is_maker ? qsTr("Maker Order"): qsTr("Taker Order")
- color: Style.colorThemeDarkLight
- anchors.verticalCenter: date.verticalCenter
- anchors.horizontalCenter: parent.horizontalCenter
- }
-
- // Cancel button
- DangerButton {
- visible: !details ? false :
- !in_modal && details.cancellable
- anchors.right: parent.right
- anchors.bottom: date.bottom
- text: qsTr("Cancel")
- onClicked: cancelOrder(details.order_id)
+ details.order_id !== ''
+
+ RowLayout {
+ width: 500
+ height: 66
+ anchors.centerIn: parent
+ spacing: 23
+ DexRectangle {
+ Layout.fillWidth: true
+ Layout.fillHeight: true
+ color: DexTheme.contentColorTop
+ RowLayout {
+ width: parent.width - 40
+ height: 50
+ anchors.centerIn: parent
+ spacing: 23
+ DefaultImage {
+ id: base_icon
+ source: General.coinIcon(!details ? atomic_app_primary_coin :
+ details.base_coin)
+ Layout.preferredWidth: 35
+ Layout.preferredHeight: 35
+ Layout.alignment: Qt.AlignVCenter
+ }
+ DexLabel {
+ id: base_amount
+ text_value: !details ? "" :
+ "" + details.base_coin + " " + " %1".arg(General.coinName(details.base_coin))+ " " + General.formatCrypto("", details.base_amount, details.base_coin).split(" ")[1]
+ font: DexTypo.body2
+
+ Layout.fillWidth: true
+ Layout.alignment: Qt.AlignVCenter
+ privacy: is_placed_order
+ opacity: .9
+ }
+ }
+ }
+
+ Qaterial.Icon {
+ color: DexTheme.foregroundColor
+ icon: Qaterial.Icons.swapHorizontal
+ Layout.alignment: Qt.AlignVCenter
+ }
+
+ DexRectangle {
+ Layout.fillWidth: true
+ Layout.fillHeight: true
+ color: DexTheme.contentColorTop
+ RowLayout {
+ width: parent.width - 40
+ height: 50
+ anchors.centerIn: parent
+ spacing: 23
+ DefaultImage {
+ id: rel_icon
+ source: General.coinIcon(!details ? atomic_app_primary_coin :
+ details.rel_coin)
+ Layout.preferredWidth: 35
+ Layout.preferredHeight: 35
+ Layout.alignment: Qt.AlignVCenter
+ }
+ DexLabel {
+ id: rel_amount
+ text_value: !details ? "" : "" + details.rel_coin + " %1 ".arg(General.coinName(details.rel_coin)) + General.formatCrypto("", details.rel_amount, details.rel_coin).split(" ")[1]
+ font: DexTypo.body2
+
+ Layout.fillWidth: true
+ Layout.alignment: Qt.AlignVCenter
+ privacy: is_placed_order
+ opacity: .9
+ }
+ }
+ }
}
}
diff --git a/atomic_defi_design/qml/Exchange/Trade/Orders/OrderLine.qml b/atomic_defi_design/qml/Exchange/Trade/Orders/OrderLine.qml
index f722d6318e..3cc9a99784 100644
--- a/atomic_defi_design/qml/Exchange/Trade/Orders/OrderLine.qml
+++ b/atomic_defi_design/qml/Exchange/Trade/Orders/OrderLine.qml
@@ -4,20 +4,22 @@ import QtQuick.Controls 2.15
import Qaterial 1.0 as Qaterial
import QtGraphicalEffects 1.0
+
+import App 1.0
+
import "../../../Components"
-import "../../../Constants"
Rectangle {
- property var details
+ property
+ var details
property alias clickable: mouse_area.enabled
readonly property bool is_placed_order: !details ? false :
- details.order_id !== ''
+ details.order_id !== ''
- width: list.model.count>6? list.width-15 : list.width-8
+ width: list.model.count > 6 ? list.width - 15 : list.width - 8
height: 40
- color: mouse_area.containsMouse? theme.hightlightColor : "transparent"
-
+ color: mouse_area.containsMouse? DexTheme.hightlightColor : "transparent"
DefaultMouseArea {
id: mouse_area
anchors.fill: parent
@@ -34,33 +36,25 @@ Rectangle {
RowLayout {
id: status_text
Layout.fillHeight: true
- Layout.preferredWidth: 45
+ Layout.preferredWidth: 15
spacing: 5
- visible: clickable? !details ? false :
- (details.is_swap || !details.is_maker) : false
+ visible: clickable ? !details ? false :
+ (details.is_swap || !details.is_maker) : false
DefaultText {
Layout.alignment: Qt.AlignVCenter
font.pixelSize: base_amount.font.pixelSize
color: !details ? "white" : getStatusColor(details.order_status)
text_value: !details ? "" :
- visible ? getStatusStep(details.order_status) : ''
- }
-
- DefaultBusyIndicator {
- Layout.alignment: Qt.AlignVCenter
- //visible: true //!isSwapDone(details.order_status)
- running: !isSwapDone(details.order_status) && Qt.platform.os != "osx"
- Layout.preferredWidth: 20
- Layout.preferredHeight: Layout.preferredWidth
+ visible ? getStatusStep(details.order_status) : ''
}
}
Item {
Layout.fillHeight: true
- Layout.preferredWidth: 45
+ Layout.preferredWidth: 20
- visible: !status_text.visible? clickable? true : false : false
+ visible: !status_text.visible ? clickable ? true : false : false
Qaterial.ColorIcon {
anchors.centerIn: parent
@@ -73,30 +67,28 @@ Rectangle {
DefaultText {
visible: clickable
font.pixelSize: base_amount.font.pixelSize
- text_value: !details ? "" :
- details.date?? ""
+ text_value: !details ? "" : details.date ?? ""
Layout.fillHeight: true
verticalAlignment: Label.AlignVCenter
- Layout.preferredWidth: 140
+ Layout.preferredWidth: 120
}
DefaultImage {
id: base_icon
source: General.coinIcon(!details ? atomic_app_primary_coin :
- details.base_coin?? atomic_app_primary_coin)
+ details.base_coin ?? atomic_app_primary_coin)
Layout.preferredWidth: Style.textSize1
Layout.preferredHeight: Style.textSize1
Layout.alignment: Qt.AlignVCenter
}
DefaultText {
id: base_amount
- text_value: !details ? "" :
- General.formatCrypto("", details.base_amount, details.base_coin, details.base_amount_current_currency, API.app.settings_pg.current_currency)
- font.pixelSize: Style.textSizeSmall2
+ text_value: !details ? "" : General.formatCrypto("", details.base_amount, details.base_coin, details.base_amount_current_currency, API.app.settings_pg.current_currency)
+ font.pixelSize: 11
Layout.fillHeight: true
- Layout.preferredWidth: 180
+ Layout.preferredWidth: 160
verticalAlignment: Label.AlignVCenter
privacy: is_placed_order
}
@@ -109,21 +101,18 @@ Rectangle {
height: 50
anchors.verticalCenter: parent.verticalCenter
anchors.horizontalCenter: parent.horizontalCenter
- top_arrow_ticker: !details ? atomic_app_primary_coin :
- details.base_coin?? ""
- bottom_arrow_ticker: !details ? atomic_app_primary_coin :
- details.rel_coin?? ""
+ top_arrow_ticker: !details ? atomic_app_primary_coin : details.base_coin ?? ""
+ bottom_arrow_ticker: !details ? atomic_app_primary_coin : details.rel_coin ?? ""
}
}
DefaultText {
id: rel_amount
- text_value: !details ? "" :
- General.formatCrypto("", details.rel_amount, details.rel_coin, details.rel_amount_current_currency, API.app.settings_pg.current_currency)
+ text_value: !details ? "" : General.formatCrypto("", details.rel_amount, details.rel_coin, details.rel_amount_current_currency, API.app.settings_pg.current_currency)
font.pixelSize: base_amount.font.pixelSize
Layout.fillHeight: true
- Layout.preferredWidth: 180
+ Layout.preferredWidth: 160
verticalAlignment: Label.AlignVCenter
horizontalAlignment: Label.AlignRight
privacy: is_placed_order
@@ -131,7 +120,7 @@ Rectangle {
DefaultImage {
id: rel_icon
source: General.coinIcon(!details ? atomic_app_primary_coin :
- details.rel_coin?? atomic_app_secondary_coin)
+ details.rel_coin ?? atomic_app_secondary_coin)
width: base_icon.width
Layout.preferredWidth: Style.textSize1
@@ -141,7 +130,7 @@ Rectangle {
DefaultText {
font.pixelSize: base_amount.font.pixelSize
visible: !details || details.recoverable === undefined ? false :
- details.recoverable && details.order_status !== "refunding"
+ details.recoverable && details.order_status !== "refunding"
Layout.fillHeight: true
Layout.preferredWidth: 40
verticalAlignment: Label.AlignVCenter
@@ -162,25 +151,34 @@ Rectangle {
}
Qaterial.FlatButton {
id: cancel_button_text
- visible: (!is_history? details.cancellable?? false : false)===true? (mouse_area.containsMouse || hovered)? true : false : false
+ visible: (!is_history ? details.cancellable ?? false : false) === true ? (mouse_area.containsMouse || hovered) ? true : false : false
- icon.source: Qaterial.Icons.close
Layout.fillHeight: true
Layout.preferredWidth: 30
- foregroundColor: Qaterial.Colors.pink300
Layout.alignment: Qt.AlignVCenter
outlinedColor: Style.colorTheme5
Behavior on scale {
- NumberAnimation { duration: 200 }
+ NumberAnimation {
+ duration: 200
+ }
+ }
+ Qaterial.ColorIcon {
+ iconSize: 13
+ color: Qaterial.Colors.pink300
+ source: Qaterial.Icons.close
+ anchors.centerIn: parent
+ scale: parent.visible ? 1 : 0
}
- scale: visible? 1 : 0
- onClicked: { if(details) cancelOrder(details.order_id) }
+
+ onClicked: {
+ if (details) cancelOrder(details.order_id)
+ }
hoverEnabled: true
}
Rectangle {
- visible: (!is_history? details.cancellable?? false : false) === true? (mouse_area.containsMouse || cancel_button_text.hovered )? false : true : false
+ visible: (!is_history ? details.cancellable ?? false : false) === true ? (mouse_area.containsMouse || cancel_button_text.hovered) ? false : true : false
width: 5
height: 5
color: Style.colorRed
@@ -202,6 +200,9 @@ Rectangle {
HorizontalLine {
width: parent.width
color: Style.colorWhite9
+ opacity: .4
anchors.bottom: parent.bottom
}
-}
+
+ // !isSwapDone(details.order_status) && Qt.platform.os != "osx" needeed for new progress later
+}
\ No newline at end of file
diff --git a/atomic_defi_design/qml/Exchange/Trade/Orders/OrderList.qml b/atomic_defi_design/qml/Exchange/Trade/Orders/OrderList.qml
index 9919fbb193..a5cf5dfd36 100644
--- a/atomic_defi_design/qml/Exchange/Trade/Orders/OrderList.qml
+++ b/atomic_defi_design/qml/Exchange/Trade/Orders/OrderList.qml
@@ -2,17 +2,19 @@ import QtQuick 2.15
import QtQuick.Layouts 1.15
import QtQuick.Controls 2.15
+import App 1.0
+
import "../../../Components"
-import "../../../Constants"
import "../../../"
Item {
property string title
- property var items
+ property
+ var items
property bool is_history: false
ColumnLayout {
- width: parent.width-10
+ width: parent.width - 10
height: parent.height
anchors.horizontalCenter: parent.horizontalCenter
@@ -36,14 +38,16 @@ Item {
// Row
delegate: OrderLine {
- readonly property double anim_time: list.animationTimestamp > index*list.animationDelay ?
- Math.min((list.animationTimestamp-index*list.animationDelay)/(list.animationTime), 1) : 0
+ readonly property double anim_time: list.animationTimestamp > index * list.animationDelay ?
+ Math.min((list.animationTimestamp - index * list.animationDelay) / (list.animationTime), 1) : 0
details: model
opacity: anim_time
}
- populate: Transition {
- PropertyAction { target: list; property: "resetAnimation"; value: !list.resetAnimation }
+ populate: Transition {
+ PropertyAction {
+ target: list;property: "resetAnimation";value: !list.resetAnimation
+ }
}
@@ -59,16 +63,16 @@ Item {
running: true
repeat: true
onTriggered: () => {
- list.animationTimestamp += interval
- if(list.animationTimestamp > list.animationDelay*list.count + list.animationTime)
- repeat = false
+ list.animationTimestamp += interval
+ if (list.animationTimestamp > list.animationDelay * list.count + list.animationTime)
+ repeat = false
}
}
}
// Pagination
- Pagination {
- visible: is_history && list.count>0
+ DexPaginator {
+ visible: is_history && list.count > 0
enabled: list.enabled
Layout.maximumHeight: 70
Layout.alignment: Qt.AlignHCenter
@@ -76,4 +80,4 @@ Item {
Layout.bottomMargin: 10
}
}
-}
+}
\ No newline at end of file
diff --git a/atomic_defi_design/qml/Exchange/Trade/Orders/OrderModal.qml b/atomic_defi_design/qml/Exchange/Trade/Orders/OrderModal.qml
index 7388656c6b..b24e06dfd8 100644
--- a/atomic_defi_design/qml/Exchange/Trade/Orders/OrderModal.qml
+++ b/atomic_defi_design/qml/Exchange/Trade/Orders/OrderModal.qml
@@ -2,8 +2,11 @@ import QtQuick 2.15
import QtQuick.Layouts 1.15
import QtQuick.Controls 2.15
+import App 1.0
+
+import Qaterial 1.0 as Qaterial
+
import "../../../Components"
-import "../../../Constants"
BasicModal {
id: root
@@ -11,7 +14,7 @@ BasicModal {
property var details
onDetailsChanged: {
- if(!details) root.close()
+ if (!details) root.close()
}
onOpened: swap_progress.updateSimulatedTime()
@@ -19,13 +22,11 @@ BasicModal {
onClosed: details = undefined
ModalContent {
- title: !details ? "" :
- details.is_swap ? qsTr("Swap Details") : qsTr("Order Details")
+ title: !details ? "" : details.is_swap ? qsTr("Swap Details") : qsTr("Order Details")
// Complete image
DefaultImage {
- visible: !details ? false :
- details.is_swap && details.order_status === "successful"
+ visible: !details ? false : details.is_swap && details.order_status === "successful"
Layout.alignment: Qt.AlignHCenter
source: General.image_path + "exchange-trade-complete.svg"
}
@@ -33,9 +34,9 @@ BasicModal {
// Loading symbol
DefaultBusyIndicator {
running: (!details ? false :
- details.is_swap &&
- details.order_status !== "successful" &&
- details.order_status !== "failed") && Qt.platform.os != "osx"
+ details.is_swap &&
+ details.order_status !== "successful" &&
+ details.order_status !== "failed") && Qt.platform.os != "osx"
Layout.alignment: Qt.AlignHCenter
}
@@ -45,20 +46,18 @@ BasicModal {
Layout.topMargin: 20
font.pixelSize: Style.textSize3
visible: !details ? false :
- details.is_swap || !details.is_maker
+ details.is_swap || !details.is_maker
color: !details ? "white" :
- visible ? getStatusColor(details.order_status) : ''
+ visible ? getStatusColor(details.order_status) : ''
text_value: !details ? "" :
- visible ? getStatusTextWithPrefix(details.order_status) : ''
+ visible ? getStatusTextWithPrefix(details.order_status) : ''
}
OrderContent {
Layout.topMargin: 25
- Layout.fillWidth: true
- Layout.leftMargin: 20
- Layout.rightMargin: Layout.leftMargin
- height: 120
+ Layout.preferredWidth: 500
Layout.alignment: Qt.AlignHCenter
+ Layout.preferredHeight: 66
details: root.details
in_modal: true
}
@@ -71,8 +70,7 @@ BasicModal {
// Maker/Taker
DefaultText {
- text_value: !details ? "" :
- details.is_maker ? qsTr("Maker Order"): qsTr("Taker Order")
+ text_value: !details ? "" : details.is_maker ? qsTr("Maker Order") : qsTr("Taker Order")
color: Style.colorThemeDarkLight
Layout.alignment: Qt.AlignRight
}
@@ -83,7 +81,7 @@ BasicModal {
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") : ""
+ 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
visible: field.text !== ''
@@ -92,36 +90,31 @@ BasicModal {
// Date
TextEditWithTitle {
title: qsTr("Date")
- text: !details ? "" :
- details.date
+ text: !details ? "" : details.date
visible: text !== ''
}
// ID
TextEditWithTitle {
title: qsTr("ID")
- text: !details ? "" :
- details.order_id
+ text: !details ? "" : details.order_id
visible: text !== ''
+ copy: true
privacy: true
}
// Payment ID
TextEditWithTitle {
- title: !details ? "" :
- details.is_maker ? qsTr("Maker Payment Sent ID") : qsTr("Maker Payment Spent ID")
- text: !details ? "" :
- details.maker_payment_id
+ title: !details ? "" : details.is_maker ? qsTr("Maker Payment Sent ID") : qsTr("Maker Payment Spent ID")
+ text: !details ? "" : details.maker_payment_id
visible: text !== ''
privacy: true
}
// Payment ID
TextEditWithTitle {
- title: !details ? "" :
- details.is_maker ? qsTr("Taker Payment Spent ID") : qsTr("Taker Payment Sent ID")
- text: !details ? "" :
- details.taker_payment_id
+ title: !details ? "" : details.is_maker ? qsTr("Taker Payment Spent ID") : qsTr("Taker Payment Sent ID")
+ text: !details ? "" : details.taker_payment_id
visible: text !== ''
privacy: true
}
@@ -129,16 +122,14 @@ BasicModal {
// Error ID
TextEditWithTitle {
title: qsTr("Error ID")
- text: !details ? "" :
- details.order_error_state
+ text: !details ? "" : details.order_error_state
visible: text !== ''
}
// Error Details
TextFieldWithTitle {
title: qsTr("Error Log")
- field.text: !details ? "" :
- details.order_error_message
+ field.text: !details ? "" : details.order_error_message
field.readOnly: true
copyable: true
@@ -162,43 +153,63 @@ BasicModal {
// Buttons
footer: [
- DefaultButton {
+ DexAppButton {
text: qsTr("Close")
- Layout.fillWidth: true
+ leftPadding: 20
+ rightPadding: 20
+ radius: 18
onClicked: root.close()
},
// Cancel button
- DangerButton {
- visible: !details ? false :
- details.cancellable
- Layout.fillWidth: true
+ DexAppOutlineButton {
+ id: cancelOrderButton
+ visible: !details ? false : details.cancellable
+ leftPadding: 20
+ rightPadding: 20
+ radius: 18
text: qsTr("Cancel Order")
onClicked: cancelOrder(details.order_id)
},
+ Item {
+ visible: !cancelOrderButton.visible
+ Layout.fillWidth: true
+ },
+
// Recover Funds button
- PrimaryButton {
+ DexAppButton {
+ id: refundButton
+ leftPadding: 20
+ rightPadding: 20
+ radius: 18
+ enabled: !API.app.orders_mdl.recover_fund_busy
visible: !details ? false :
- details.recoverable && details.order_status !== "refunding"
+ details.recoverable && details.order_status !== "refunding"
+ text: enabled ? qsTr("Recover Funds") : qsTr("Refunding...")
+ onClicked: API.app.orders_mdl.recover_fund(details.order_id)
+ },
+
+ Item {
+ visible: !refundButton.visible & !cancelOrderButton.visible
Layout.fillWidth: true
- text: qsTr("Recover Funds")
- onClicked: onRecoverFunds(details.order_id)
},
- PrimaryButton {
+
+ DexAppOutlineButton {
text: qsTr("View on Explorer")
- Layout.fillWidth: true
- visible: !details ? false :
- details.maker_payment_id !== '' || details.taker_payment_id !== ''
+ leftPadding: 20
+ rightPadding: 20
+ radius: 18
+ visible: !details ? false : details.maker_payment_id !== '' || details.taker_payment_id !== ''
onClicked: {
- if(!details) return
+ if (!details) return
const maker_id = details.maker_payment_id
const taker_id = details.taker_payment_id
- 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)
+ 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)
}
}
]
diff --git a/atomic_defi_design/qml/Exchange/Trade/Orders/OrdersPage.qml b/atomic_defi_design/qml/Exchange/Trade/Orders/OrdersPage.qml
index 728a72898c..5295f0abcd 100644
--- a/atomic_defi_design/qml/Exchange/Trade/Orders/OrdersPage.qml
+++ b/atomic_defi_design/qml/Exchange/Trade/Orders/OrdersPage.qml
@@ -5,8 +5,9 @@ import Qt.labs.platform 1.1
import Qaterial 1.0 as Qaterial
+import App 1.0
+
import "../../../Components"
-import "../../../Constants"
import "../../.."
Item {
@@ -15,8 +16,10 @@ Item {
readonly property date default_min_date: new Date("2019-01-01")
readonly property date default_max_date: new Date(new Date().setDate(new Date().getDate() + 30))
- property var list_model: API.app.orders_mdl
- property var list_model_proxy: API.app.orders_mdl.orders_proxy_mdl
+ property
+ var list_model: API.app.orders_mdl
+ property
+ var list_model_proxy: API.app.orders_mdl.orders_proxy_mdl
property int page_index
property alias title: order_list.title
@@ -25,19 +28,35 @@ Item {
property bool is_history: false
- property string recover_funds_result: '{}'
+ function update() {
+ reset()
+ if (combo_base.currentTicker !== "All" | combo_rel.currentTicker !== "All") {
+ buttonDelay.start()
+ }
+ }
- function onRecoverFunds(order_id) {
- const result = API.app.recover_fund(order_id)
- console.log("Refund result: ", result)
- recover_funds_result = result
- recover_funds_modal.open()
+ function reset() {
+ list_model_proxy.is_history = !is_history
+ applyFilter()
+ list_model_proxy.apply_all_filtering()
+ list_model_proxy.is_history = is_history
+ }
+
+ Component.onDestruction: reset()
+
+ Timer {
+ id: buttonDelay
+ interval: 200
+ onTriggered: {
+ applyFilter()
+ list_model_proxy.apply_all_filtering()
+ }
}
function applyDateFilter() {
list_model_proxy.filter_minimum_date = min_date.date
- if(max_date.date < min_date.date)
+ if (max_date.date < min_date.date)
max_date.date = min_date.date
list_model_proxy.filter_maximum_date = max_date.date
@@ -46,6 +65,7 @@ Item {
function applyTickerFilter() {
list_model_proxy.set_coin_filter(combo_base.currentValue + "/" + combo_rel.currentValue)
}
+
function applyTickerFilter2(ticker1, ticker2) {
list_model_proxy.set_coin_filter(ticker1 + "/" + ticker2)
}
@@ -65,7 +85,7 @@ Item {
anchors.horizontalCenter: parent.horizontalCenter
anchors.fill: parent
- anchors.bottomMargin: is_history? 0 : 10
+ anchors.bottomMargin: is_history ? 0 : 10
spacing: 15
// Bottom part
@@ -73,7 +93,7 @@ Item {
id: orders_settings
property bool displaySetting: false
Layout.fillWidth: true
- Layout.preferredHeight: displaySetting? 80 : 30
+ Layout.preferredHeight: displaySetting ? 80 : 30
Behavior on Layout.preferredHeight {
NumberAnimation {
duration: 150
@@ -82,7 +102,7 @@ Item {
Rectangle {
width: parent.width
- height: orders_settings.displaySetting? 50 : 10
+ height: orders_settings.displaySetting ? 50 : 10
Behavior on height {
NumberAnimation {
duration: 150
@@ -97,18 +117,31 @@ Item {
Row {
x: 5
y: 0
- spacing: 0
+ spacing: 5
Qaterial.OutlineButton {
icon.source: Qaterial.Icons.filter
- text: "Filter"
- foregroundColor:Style.colorWhite5
+ text: qsTr("Filter")
+ foregroundColor: Style.colorWhite5
anchors.verticalCenter: parent.verticalCenter
outlinedColor: Style.colorTheme5
onClicked: orders_settings.displaySetting = !orders_settings.displaySetting
}
+
+ DexLabel {
+ opacity: .4
+ visible: !orders_settings.displaySetting
+ anchors.verticalCenter: parent.verticalCenter
+ text: qsTr("Filter") + ": %1 / %2 %3: %4 - %5"
+ .arg(combo_base.currentTicker)
+ .arg(combo_rel.currentTicker)
+ .arg(qsTr("Date"))
+ .arg(min_date.date.toLocaleDateString(Locale.ShortFormat, "yyyy-MM-dd"))
+ .arg(max_date.date.toLocaleDateString(Locale.ShortFormat, "yyyy-MM-dd"))
+ }
+
Qaterial.OutlineButton {
visible: root.is_history && orders_settings.displaySetting
- foregroundColor:Style.colorWhite5
+ foregroundColor: Style.colorWhite5
outlinedColor: Style.colorTheme5
anchors.verticalCenter: parent.verticalCenter
text: qsTr("Export CSV")
@@ -118,18 +151,18 @@ Item {
export_csv_dialog.open()
}
}
-
}
+
Row {
anchors.right: parent.right
y: 0
rightPadding: 5
Qaterial.OutlineButton {
- visible: root.is_history
+ visible: root.is_history & orders_settings.displaySetting
Layout.leftMargin: 30
text: qsTr("Apply Filter")
- foregroundColor: enabled? Style.colorGreen2 : Style.colorTheme5
- outlinedColor: enabled? Style.colorGreen2 : Style.colorTheme5
+ foregroundColor: enabled ? Style.colorGreen2 : Style.colorTheme5
+ outlinedColor: enabled ? Style.colorGreen2 : Style.colorTheme5
enabled: list_model_proxy.can_i_apply_filtering
onClicked: list_model_proxy.apply_all_filtering()
anchors.verticalCenter: parent.verticalCenter
@@ -137,7 +170,7 @@ Item {
Qaterial.OutlineButton {
icon.source: Qaterial.Icons.close
text: "Cancel All"
- visible: !is_history && API.app.orders_mdl.length>0
+ visible: !is_history && API.app.orders_mdl.length > 0
foregroundColor: Qaterial.Colors.pink
anchors.verticalCenter: parent.verticalCenter
outlinedColor: Style.colorTheme5
@@ -145,8 +178,8 @@ Item {
}
}
RowLayout {
- visible: orders_settings.height>75
- width: parent.width-20
+ visible: orders_settings.height > 75
+ width: parent.width - 20
anchors.horizontalCenter: parent.horizontalCenter
anchors.bottom: parent.bottom
anchors.bottomMargin: -15
@@ -155,7 +188,7 @@ Item {
id: combo_base
model: API.app.portfolio_pg.global_cfg_mdl.all_proxy
onCurrentTickerChanged: applyFilter()
- width: 150
+ Layout.fillWidth: true
height: 100
valueRole: "ticker"
textRole: 'ticker'
@@ -177,27 +210,25 @@ Item {
DefaultSweetComboBox {
id: combo_rel
- model: API.app.portfolio_pg.global_cfg_mdl.all_proxy//combo_base.model
+ model: API.app.portfolio_pg.global_cfg_mdl.all_proxy //combo_base.model
onCurrentTickerChanged: applyFilter()
- width: 150
+ Layout.fillWidth: true
height: 100
valueRole: "ticker"
textRole: 'ticker'
-
}
- Item {
- Layout.fillWidth: true
- Layout.fillHeight: true
- }
-
Qaterial.TextFieldDatePicker {
id: min_date
title: qsTr("From")
from: default_min_date
to: default_max_date
date: default_min_date
+ font.pixelSize: 13
+ opacity: .8
+ color: DexTheme.foregroundColor
+ backgroundColor: DexTheme.portfolioPieGradient ? '#FFFFFF' : 'transparent'
onAccepted: applyDateFilter()
- Layout.preferredWidth: 130
+ Layout.fillWidth: true
}
Qaterial.TextFieldDatePicker {
@@ -207,8 +238,12 @@ Item {
from: min_date.date
to: default_max_date
date: default_max_date
+ font.pixelSize: 13
+ opacity: .8
+ color: DexTheme.foregroundColor
+ backgroundColor: DexTheme.portfolioPieGradient ? '#FFFFFF' : 'transparent'
onAccepted: applyDateFilter()
- Layout.preferredWidth: 130
+ Layout.fillWidth: true
}
}
}
@@ -238,13 +273,13 @@ Item {
id: export_csv_dialog
title: qsTr("Please choose the CSV export name and location")
- fileMode: FileDialog.OpenFile
+ fileMode: FileDialog.SaveFile
defaultSuffix: "csv"
- nameFilters: [ "CSV files (*.csv)", "All files (*)" ]
+ nameFilters: ["CSV files (*.csv)", "All files (*)"]
onAccepted: {
- const path = fileUrl.toString()
+ const path = currentFile.toString()
// Export
console.log("Exporting to CSV: " + path)
@@ -258,14 +293,4 @@ Item {
console.log("CSV export cancelled")
}
}
- ModalLoader {
- id: recover_funds_modal
- sourceComponent: LogModal {
- header: qsTr("Recover Funds Result")
- field.text: General.prettifyJSON(recover_funds_result)
-
- onClosed: recover_funds_result = "{}"
- }
- }
}
-
diff --git a/atomic_defi_design/qml/Exchange/Trade/Orders/SwapProgress.qml b/atomic_defi_design/qml/Exchange/Trade/Orders/SwapProgress.qml
index dffa6c21a4..5861f09635 100644
--- a/atomic_defi_design/qml/Exchange/Trade/Orders/SwapProgress.qml
+++ b/atomic_defi_design/qml/Exchange/Trade/Orders/SwapProgress.qml
@@ -2,36 +2,39 @@ import QtQuick 2.15
import QtQuick.Layouts 1.15
import QtQuick.Controls 2.15
+import App 1.0
+
import "../../../Components"
-import "../../../Constants"
// Content
ColumnLayout {
id: root
- property var details
+ property
+ var details
- readonly property var all_events: !details ? [] : has_error_event ? details.events.map(e => e.state) : details.success_events
+ readonly property
+ var all_events: !details ? [] : has_error_event ? details.events.map(e => e.state) : details.success_events
readonly property bool has_error_event: {
- if(!details) return false
+ if (!details) return false
const events = details.events
- for(let i = events.length - 1; i >= 0; --i)
- if(details.error_events.indexOf(events[i].state) !== -1)
+ for (let i = events.length - 1; i >= 0; --i)
+ if (details.error_events.indexOf(events[i].state) !== -1)
return true
return false
}
readonly property double total_time_passed: {
- if(!details) return 0
+ if (!details) return 0
const events = details.events
let sum = 0
- for(let i = 0; i < events.length; ++i)
+ for (let i = 0; i < events.length; ++i)
sum += events[i].time_diff
return sum
@@ -41,23 +44,23 @@ ColumnLayout {
const events = all_events
let sum = 0
- for(let i = 0; i < events.length; ++i)
+ for (let i = 0; i < events.length; ++i)
sum += API.app.orders_mdl.average_events_time_registry[events[i]]
return sum
}
readonly property int current_event_idx: {
- if(!details) return -1
+ if (!details) return -1
const events = details.events
- if(events.length === 0) return -1
- if(all_events.length === 0) return -1
+ if (events.length === 0) return -1
+ if (all_events.length === 0) return -1
- const last_state = events[events.length-1].state
- if(last_state === "Finished") return -1
+ const last_state = events[events.length - 1].state
+ if (last_state === "Finished") return -1
const idx = all_events.indexOf(last_state)
- if(idx === -1) return -1
+ if (idx === -1) return -1
return idx + 1
}
@@ -65,28 +68,27 @@ ColumnLayout {
// Simulated time of the running event
property double simulated_time: 0
function updateSimulatedTime() {
- if(!details) {
+ 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
+ } else simulated_time = 0
}
Timer {
@@ -97,19 +99,19 @@ ColumnLayout {
}
function getTimeText(duration, estimated) {
- return `` + qsTr("act", "SHORT FOR ACTUAL TIME") + ": " + ` ` +
- `` + General.durationTextShort(duration) + ` ` +
- ` | ` + qsTr("est", "SHORT FOR ESTIMATED") + ": " +
- General.durationTextShort(estimated) + ` `
+ return `` + qsTr("act", "SHORT FOR ACTUAL TIME") + ": " + ` ` +
+ `` + General.durationTextShort(duration) + ` ` +
+ ` | ` + qsTr("est", "SHORT FOR ESTIMATED") + ": " +
+ General.durationTextShort(estimated) + ` `
}
onTotal_time_passedChanged: updateSimulatedTime()
// Title
DefaultText {
- text_value: `` + qsTr("Progress details") + ` ` +
- ` | ` +
- getTimeText(total_time_passed + simulated_time, total_time_passed_estimated)
+ text_value: `` + qsTr("Progress details") + ` ` +
+ ` | ` +
+ getTimeText(total_time_passed + simulated_time, total_time_passed_estimated)
font.pixelSize: Style.textSize1
Layout.bottomMargin: 10
}
@@ -120,10 +122,11 @@ ColumnLayout {
model: all_events
delegate: Item {
- readonly property var event: {
- if(!details) return undefined
+ readonly property
+ var event: {
+ if (!details) return undefined
const idx = details.events.map(e => e.state).indexOf(modelData)
- if(idx === -1) return undefined
+ if (idx === -1) return undefined
return details.events[idx]
}
@@ -140,26 +143,26 @@ ColumnLayout {
DefaultText {
id: icon
- text_value: is_active ? "●" : "○"
+ text_value: is_active ? "●" : "○"
anchors.left: parent.left
anchors.leftMargin: 10
anchors.verticalCenter: col_layout.verticalCenter
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 Style.colorRed
+ if (event.state === "Finished" && details.order_status === "failed") return DexTheme.redColor
// Red for error event, green for the others
- return details.error_events.indexOf(event.state) === -1 ? Style.colorGreen : Style.colorRed
+ return details.error_events.indexOf(event.state) === -1 ? DexTheme.greenColor : DexTheme.redColor
}
// In progress one is orange
- if(is_current_event)
+ if (is_current_event)
return Style.colorOrange
// Passive color for the rest
- return Style.colorTextDisabled
+ return DexTheme.foregroundColorLightColor2
}
}
@@ -177,7 +180,7 @@ ColumnLayout {
font.pixelSize: Style.textSizeSmall4
text_value: getEventText(modelData)
- color: event ? Style.colorText : is_current_event ? Style.colorText2 : Style.colorTextDisabled
+ color: event ? DexTheme.foregroundColor : is_current_event ? DexTheme.foregroundColorLightColor0 : DexTheme.foregroundColorLightColor2
}
AnimatedRectangle {
@@ -186,12 +189,12 @@ ColumnLayout {
width: 300
height: 2
- color: Style.colorWhite8
+ color: DexTheme.foregroundColorDarkColor3
AnimatedRectangle {
width: parent.width * (total_time_passed > 0 ? (time_passed / (total_time_passed + simulated_time)) : 0)
height: parent.height
- color: Style.colorGreen
+ color: DexTheme.greenColor
}
}
@@ -204,4 +207,4 @@ ColumnLayout {
}
}
}
-}
+}
\ No newline at end of file
diff --git a/atomic_defi_design/qml/Exchange/Trade/PriceLineSimplified.qml b/atomic_defi_design/qml/Exchange/Trade/PriceLineSimplified.qml
new file mode 100644
index 0000000000..79d17208d3
--- /dev/null
+++ b/atomic_defi_design/qml/Exchange/Trade/PriceLineSimplified.qml
@@ -0,0 +1,157 @@
+import QtQuick 2.15
+import QtQuick.Layouts 1.15
+import QtQuick.Controls 2.15
+
+import "../../Components"
+import "../../Constants"
+
+import App 1.0
+
+// Price
+ColumnLayout {
+
+ 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
+ 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 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: 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))
+ }
+
+
+
+ DexLabel {
+ visible: !price_entered && invalid_cex_price
+ Layout.alignment: Qt.AlignHCenter
+ text_value: qsTr("Set swap price for evaluation")
+ font.pixelSize: fontSizeBigger
+ }
+ spacing: 35
+ RowLayout {
+ Layout.preferredWidth: 500
+ Layout.alignment: Qt.AlignHCenter
+ ColumnLayout {
+ visible: price_entered
+ DexLabel {
+ Layout.alignment: Qt.AlignLeft
+ text_value: qsTr("Exchange rate") + (preffered_order.price !== undefined ? (" (" + qsTr("Selected") + ")") : "")
+ font.pixelSize: fontSize
+ }
+
+ // Price reversed
+ DexLabel {
+ Layout.alignment: Qt.AlignLeft
+ text_value: General.formatCrypto("", "1", right_ticker) + " = " + General.formatCrypto("", price_reversed, left_ticker)
+ font.pixelSize: fontSizeBigger
+ font.weight: Font.Medium
+ }
+
+ // Price
+ DexLabel {
+ Layout.alignment: Qt.AlignLeft
+ text_value: General.formatCrypto("", price, right_ticker) + " = " + General.formatCrypto("", "1", left_ticker)
+ font.pixelSize: fontSize
+ }
+ }
+
+ Item {
+ Layout.fillWidth: true
+ }
+
+ ColumnLayout {
+ visible: !invalid_cex_price
+
+ DexLabel {
+ Layout.alignment: Qt.AlignRight
+ text_value: General.cex_icon + " " + qsTr("CEXchange rate")
+ font.pixelSize: fontSize
+
+ CexInfoTrigger {}
+ }
+
+ // 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
+ }
+
+ // Price
+ DexLabel {
+ Layout.alignment: Qt.AlignRight
+ text_value: General.formatCrypto("", cex_price, right_ticker) + " = " + General.formatCrypto("", "1", left_ticker)
+ font.pixelSize: fontSize
+ }
+ }
+ }
+
+
+ // Price Comparison
+ ColumnLayout {
+ visible: price_entered && !invalid_cex_price
+ Layout.alignment: Qt.AlignHCenter
+
+ RowLayout {
+ Layout.fillWidth: true
+
+ GradientRectangle {
+ width: 500
+ height: 6
+
+ start_color: DexTheme.greenColor
+ end_color: DexTheme.redColor
+
+ AnimatedRectangle {
+ width: 4
+ 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)
+ }
+
+ DexLabel {
+ text_value: General.formatPercent(line_scale)
+ font.pixelSize: fontSize
+ anchors.top: parent.top
+ anchors.topMargin: -15
+ }
+
+ DexLabel {
+ text_value: General.formatPercent(-line_scale)
+ font.pixelSize: fontSize
+ anchors.top: parent.top
+ anchors.topMargin: -15
+ anchors.right: parent.right
+ }
+ }
+ }
+
+ DexLabel {
+ id: price_diff_text
+ Layout.topMargin: 10
+ Layout.bottomMargin: Layout.topMargin
+ Layout.alignment: Qt.AlignHCenter
+ color: parseFloat(cex_price_diff) <= 0 ? DexTheme.greenColor : DexTheme.redColor
+ 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)) + " ")
+ font.pixelSize: fontSize
+ }
+
+
+ }
+
+ // CEXchange
+
+}
diff --git a/atomic_defi_design/qml/Exchange/Trade/ProView.qml b/atomic_defi_design/qml/Exchange/Trade/ProView.qml
index e8d3c0a336..2fdd79ffc5 100644
--- a/atomic_defi_design/qml/Exchange/Trade/ProView.qml
+++ b/atomic_defi_design/qml/Exchange/Trade/ProView.qml
@@ -12,9 +12,10 @@ import AtomicDEX.MarketMode 1.0
import AtomicDEX.TradingError 1.0
import "../../Components"
-import "../../Constants"
import "../../Wallet"
+import App 1.0
+
// Trade Form / Component import
import "TradeBox/"
import "Trading/"
@@ -33,7 +34,8 @@ import "./" as Here
ColumnLayout {
id: form
- function selectOrder(is_asks, coin, price, quantity, price_denom, price_numer, quantity_denom, quantity_numer, min_volume, base_min_volume) {
+ property alias dexConfig: dex_config_popup
+ 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)
API.app.trading_pg.preffered_order = {
@@ -45,7 +47,13 @@ ColumnLayout {
"quantity_denom": quantity_denom,
"quantity_numer": quantity_numer,
"min_volume": min_volume,
- "base_min_volume": base_min_volume
+ "base_min_volume": base_min_volume,
+ "base_max_volume": base_max_volume,
+ "rel_min_volume": rel_min_volume,
+ "rel_max_volume": rel_max_volume,
+ "base_max_volume_denom": base_max_volume_denom,
+ "base_max_volume_numer": base_max_volume_numer,
+ "uuid": uuid
}
form_base.focusVolumeField()
@@ -78,140 +86,149 @@ ColumnLayout {
}
}
}
- Connections {
- target:exchange_trade
- }
-
spacing: 10
- anchors.topMargin: window.isOsx? 60 : 5
+ anchors.topMargin: 20
anchors.leftMargin: 10
anchors.fill: parent
+ Connections {
+ target: app
+ function onPairChanged(base, rel) {
+ dex_chart.visible = true
+ }
+ }
- SplitView {
+ DexBoxManager {
id: splitView
Layout.fillWidth: true
Layout.fillHeight: true
-
+ itemLists: [left_section, order_form]
spacing: 15
handle: Item {
- implicitWidth: 10
- implicitHeight: 10
- InnerBackground {
- implicitWidth: 6
- implicitHeight: 16
+ implicitWidth: 2
+ implicitHeight: 4
+ Rectangle {
+ implicitWidth: 2
+ implicitHeight: 4
anchors.centerIn: parent
- opacity: .2
+ opacity: 0
+ color: 'transparent'
}
}
- ItemBox {
+ DexTradeBox {
id: left_section
- minimumWidth: 650
- defaultWidth: 650
+ minimumWidth: 550
+ defaultWidth: 560
expandedHort: true
+ hideHeader: true
SplitView.fillHeight: true
- title: "Chart View"
color: 'transparent'
- border.color: 'transparent'
- SplitView {
+ DexBoxManager {
anchors.fill: parent
- anchors.margins: 00
- anchors.topMargin: 0
+ anchors.margins: 0
anchors.rightMargin: 0
orientation: Qt.Vertical
handle: Item {
- implicitWidth: 10
- implicitHeight: 10
+ implicitWidth: 40
+ implicitHeight: 6
InnerBackground {
- implicitWidth: 16
+ implicitWidth: 40
implicitHeight: 6
anchors.centerIn: parent
- opacity: .4
+ opacity: 0.4
}
}
- ItemBox {
- title: qsTr("Chart View")
- expandedVert: true
+ itemLists: [dex_chart, optionBox]
+ DexTradeBox {
+ id: dex_chart
+ title: qsTr("Chart")
+ expandedVert: dex_chart.visible? true : false
+ onVisibleChanged: {
+ if(visible) {
+ expandedVert = true
+ }
+ }
+ canBeFull: true
+ onFullScreenChanged: {
+ if(fullScreen){
+ _best_order_box.visible = false
+ _orderbook_box.visible = false
+ optionBox.visible = false
+ order_form.visible = false
+ } else {
+ _best_order_box.visible = true
+ _orderbook_box.visible = true
+ optionBox.visible = true
+ order_form.visible = true
+ }
+ }
Item {
id: chart_view
anchors.fill: parent
anchors.topMargin: 40
CandleStickChart {
+ id: candleChart
+ color: 'transparent'
anchors.fill: parent
}
}
}
+ DexTradeBox {
+ canBeFull: true
+ hideHeader: true
+ maximumHeight: 80
+ minimumHeight: 75
+ RowLayout {
+ id: selectors
+ spacing: 20
+ anchors.fill: parent
+ anchors.rightMargin: 10
+ anchors.leftMargin: 10
+ TickerSelector {
+ id: selector_left
+ left_side: true
+ Layout.fillHeight: true
+ ticker_list: API.app.trading_pg.market_pairs_mdl.left_selection_box
+ ticker: left_ticker
+ Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter
+ Layout.fillWidth: true
+ }
- RowLayout {
- id: selectors
- spacing: 20
- SplitView.maximumHeight: 80
- SplitView.minimumHeight: 75
-
- TickerSelector {
- id: selector_left
- left_side: true
- Layout.fillHeight: true
- ticker_list: API.app.trading_pg.market_pairs_mdl.left_selection_box
- ticker: left_ticker
- Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter
- Layout.fillWidth: true
- }
-
- SwapIcon {
- Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
- Layout.preferredHeight: selector_left.height * 0.65
+ SwapIcon {
+ Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
+ Layout.preferredHeight: selector_left.height * 0.65
- top_arrow_ticker: selector_left.ticker
- bottom_arrow_ticker: selector_right.ticker
- hovered: swap_button.containsMouse
+ top_arrow_ticker: selector_left.ticker
+ bottom_arrow_ticker: selector_right.ticker
+ hovered: swap_button.containsMouse
- DefaultMouseArea {
- id: swap_button
- anchors.fill: parent
- hoverEnabled: true
- onClicked: {
- if (!block_everything)
- setPair(true, right_ticker)
+ DefaultMouseArea {
+ id: swap_button
+ anchors.fill: parent
+ hoverEnabled: true
+ onClicked: {
+ if (!block_everything)
+ setPair(true, right_ticker)
+ }
}
}
- }
-
- TickerSelector {
- id: selector_right
- left_side: false
- ticker_list: API.app.trading_pg.market_pairs_mdl.right_selection_box
- ticker: right_ticker
- Layout.alignment: Qt.AlignRight | Qt.AlignVCenter
- Layout.fillWidth: true
- }
- }
- ItemBox {
- title: qsTr("Multi-Order")
- defaultHeight: 250
- visible: false
- }
-
- ItemBox {
- title: qsTr("OrderBook")
- defaultHeight: 300
- Behavior on defaultHeight {
- NumberAnimation {
- duration: 150
+ TickerSelector {
+ id: selector_right
+ left_side: false
+ ticker_list: API.app.trading_pg.market_pairs_mdl.right_selection_box
+ ticker: right_ticker
+ Layout.alignment: Qt.AlignRight | Qt.AlignVCenter
+ Layout.fillWidth: true
}
}
- visible: !isUltraLarge
-
- OrderBook.Horizontal {
- anchors.topMargin: 40
- anchors.fill: parent
- clip: !parent.contentVisible
- visible: parent.visible
- }
}
- ItemBox {
+
+
+ DexTradeBox {
id: optionBox
+ expandedVert: dex_chart.visible? false : true
+ expandable: true
defaultHeight: tabView.currentIndex === 0 ? 200 : isUltraLarge? 400 : 270
Connections {
target: tabView
@@ -223,15 +240,15 @@ ColumnLayout {
}
}
}
-
- title: qsTr("Options")
+ closable: true
+ title: qsTr("Trading Information")
Column {
topPadding: 40
width: parent.width
height: parent.height
clip: !parent.contentVisible
anchors.horizontalCenter: parent.horizontalCenter
- Qaterial.TabBar {
+ Qaterial.LatoTabBar {
z: 4
id: tabView
property int taux_exchange: 0
@@ -240,30 +257,36 @@ ColumnLayout {
width: parent.width
currentIndex: tabView.currentIndex
anchors.horizontalCenter: parent.horizontalCenter
- Material.foreground: theme.foregroundColor
+ Material.foreground: DexTheme.foregroundColor
background: Rectangle {
radius: 0
- color: theme.dexBoxBackgroundColor
+ color: DexTheme.portfolioPieGradient ? "transparent" : DexTheme.dexBoxBackgroundColor
}
y: 5
leftPadding: 15
- Qaterial.TabButton {
+ Qaterial.LatoTabButton {
width: 150
text: qsTr("Exchange Rates")
- foregroundColor: CheckBox ? Qaterial.Style.buttonAccentColor : theme.foregroundColor
+ font.pixelSize: 14
+ textColor: checked ? Qaterial.Style.buttonAccentColor : DexTheme.foregroundColor
+ textSecondaryColor: DexTheme.foregroundColorLightColor0
opacity: checked ? 1 : .6
}
- Qaterial.TabButton {
+ Qaterial.LatoTabButton {
width: 120
text: qsTr("Orders")
- foregroundColor: CheckBox ? Qaterial.Style.buttonAccentColor : theme.foregroundColor
+ font.pixelSize: 14
+ textColor: checked ? Qaterial.Style.buttonAccentColor : DexTheme.foregroundColor
+ textSecondaryColor: DexTheme.foregroundColorLightColor0
opacity: checked ? 1 : .6
}
- Qaterial.TabButton {
+ Qaterial.LatoTabButton {
width: 120
- text: qsTr("history")
- foregroundColor: CheckBox ? Qaterial.Style.buttonAccentColor : theme.foregroundColor
+ text: qsTr("History")
+ font.pixelSize: 14
+ textColor: checked ? Qaterial.Style.buttonAccentColor : DexTheme.foregroundColor
+ textSecondaryColor: DexTheme.foregroundColorLightColor0
opacity: checked ? 1 : .6
}
}
@@ -278,6 +301,7 @@ ColumnLayout {
currentIndex: tabView.currentIndex
anchors.fill: parent
onCurrentIndexChanged: {
+ swipeView.currentItem.update()
if(currentIndex===2) {
history_component.list_model_proxy.is_history = true
} else {
@@ -302,43 +326,38 @@ ColumnLayout {
}
}
}
+ Item {
+ SplitView.maximumHeight: 1
+ }
}
}
-
- ItemBox {
- minimumWidth: 350
- maximumWidth: 380
- defaultWidth: 350
- title: qsTr("OrderBook & Best Orders")
- color: 'transparent'
- closable: false
- visible: isUltraLarge
- DefaultSplitView {
- anchors.topMargin: 40
+ Item {
+ id: _book_and_best
+ property bool showing: (_best_order_box.visible || _orderbook_box.visible)
+ SplitView.minimumWidth: showing? 300 : 0
+ SplitView.maximumWidth: showing? 310 : 0
+ SplitView.preferredWidth: showing? 280 : 0
+ clip: true
+ DexBoxManager {
anchors.fill: parent
orientation: Qt.Vertical
- visible: parent.contentVisible
handle: Item {
- implicitWidth: 10
- implicitHeight: 10
+ implicitWidth: 40
+ implicitHeight: 6
InnerBackground {
- implicitWidth: 16
+ implicitWidth: 40
implicitHeight: 6
anchors.centerIn: parent
- opacity: .4
+ opacity: 0.4
}
}
- Item {
- SplitView.minimumHeight: 1
- SplitView.maximumHeight: 1
- SplitView.fillWidth: true
- }
- ItemBox {
+ itemLists: [_orderbook_box, _best_order_box]
+ DexTradeBox {
+ id: _orderbook_box
SplitView.fillWidth: true
- //clip: true
- title: "OrderBook"
+ closable: true
+ title: qsTr("Order Book")
expandedVert: true
-
Behavior on SplitView.preferredWidth {
NumberAnimation {
duration: 100
@@ -351,20 +370,17 @@ ColumnLayout {
anchors.fill: parent
}
}
- ItemBox {
+ DexTradeBox {
id: _best_order_box
- SplitView.fillWidth: true
- SplitView.fillHeight: true
defaultHeight: 250
minimumHeight: 130
- //clip: true
- //smooth: true
+ closable: true
title: qsTr("Best Orders")
reloadable: true
onReload: {
+
API.app.trading_pg.orderbook.refresh_best_orders()
}
-
Behavior on SplitView.preferredWidth {
NumberAnimation {
duration: 100
@@ -382,74 +398,66 @@ ColumnLayout {
}
}
- ItemBox {
- defaultWidth: 380
- maximumWidth: 380
- minimumWidth: 350
+ DexTradeBox {
+ id: order_form
+ closable: true
+ title: qsTr("Place Order")
+ defaultWidth: isBigScreen? 300 : 280
+ maximumWidth: isBigScreen? 310 : 280
+ minimumWidth: isBigScreen? 290 : 280
+ expandable: false
SplitView.fillHeight: true
- title: qsTr("Buy & Sell")
- color: 'transparent'
- border.color: 'transparent'
- //clip: true
- SplitView {
+ ColumnLayout {
visible: parent.contentVisible
- orientation: Qt.Vertical
+ anchors.topMargin: 60
anchors.fill: parent
- anchors.topMargin: 45
- handle: Item {
- implicitWidth: 10
- implicitHeight: 10
- InnerBackground {
- implicitWidth: 16
- implicitHeight: 6
- anchors.centerIn: parent
- opacity: .4
- }
- }
- ItemBox {
- title: "Total"
- defaultHeight: 90
- hideHeader: true
- //clip: true
- visible: true
- bottomBorderColor: sell_mode? theme.greenColor : theme.redColor
- TotalView {}
- }
Item {
- SplitView.fillWidth: true
- SplitView.preferredHeight: 30
- SplitView.maximumHeight: 35
+ Layout.fillWidth: true
+ Layout.preferredHeight: 30
+ Layout.maximumHeight: 35
+ Gradient {
+ id: activeGradient
+ orientation: Qt.Horizontal
+ GradientStop {
+ position: 0.1255
+ color: DexTheme.buttonGradientEnabled1
+ }
+ GradientStop {
+ position: 0.933
+ color: DexTheme.buttonGradientEnabled2
+ }
+ }
+
+ Gradient {
+ id: activeRedGradient
+ orientation: Qt.Horizontal
+ GradientStop {
+ position: 0.1255
+ color: DexTheme.redColor
+ }
+ GradientStop {
+ position: 0.933
+ color: Qt.darker(DexTheme.redColor, 0.8)
+ }
+ }
+
Row {
- width: parent.width - 100
+ width: parent.width - 60
+ spacing: 10
anchors.centerIn: parent
Rectangle {
width: (parent.width / 2)
- height: 30
- radius: 8
+ height: 40
+ radius: 15
color: !sell_mode ? Qt.darker(
- theme.greenColor) : theme.backgroundColor
- border.color: !sell_mode ? theme.greenColor : theme.dexBoxBackgroundColor
- Rectangle {
- anchors.right: parent.right
- color: parent.color
- height: parent.height
- width: parent.radius
- border.color: parent.border.color
- border.width: parent.border.width
-
- Rectangle {
- anchors.left: parent.left
- color: parent.color
- height: parent.height - (parent.border.width * 2)
- anchors.verticalCenter: parent.verticalCenter
- width: 2
- }
- }
+ DexTheme.greenColor) : Qt.lighter(DexTheme.dexBoxBackgroundColor)
+ gradient: DexTheme.portfolioPieGradient && !sell_mode ? activeGradient : undefined
+ border.color: !sell_mode ? "transparent" : DexTheme.greenColor
DefaultText {
anchors.centerIn: parent
opacity: !sell_mode ? 1 : .5
text: qsTr("Buy")+" "+atomic_qt_utilities.retrieve_main_ticker(left_ticker)
- color: !sell_mode? Qaterial.Colors.white : theme.foregroundColor
+ color: !sell_mode? Qaterial.Colors.white : DexTheme.foregroundColor
}
DefaultMouseArea {
anchors.fill: parent
@@ -457,34 +465,21 @@ ColumnLayout {
onClicked: setMarketMode(MarketMode.Buy)
}
}
+
Rectangle {
width: (parent.width / 2)
- height: 30
- radius: 8
+ height: 40
+ radius: 15
color: sell_mode ? Qt.darker(
- theme.redColor) : theme.backgroundColor
- border.color: sell_mode ? theme.redColor : theme.dexBoxBackgroundColor
- Rectangle {
- anchors.left: parent.left
- color: parent.color
- height: parent.height
- width: parent.radius
- border.color: parent.border.color
- border.width: parent.border.width
- Rectangle {
- anchors.right: parent.right
- color: parent.color
- height: parent.height - (parent.border.width * 2)
- anchors.verticalCenter: parent.verticalCenter
- width: 2
- }
- }
+ DexTheme.redColor) : Qt.lighter(DexTheme.dexBoxBackgroundColor)
+ border.color: sell_mode ? "transparent" : DexTheme.redColor
+ gradient: DexTheme.portfolioPieGradient && sell_mode ? activeRedGradient : undefined
DefaultText {
anchors.centerIn: parent
opacity: sell_mode ? 1 : .5
text: qsTr("Sell")+" "+atomic_qt_utilities.retrieve_main_ticker(left_ticker)
- color: sell_mode? Qaterial.Colors.white : theme.foregroundColor
+ color: sell_mode? Qaterial.Colors.white : DexTheme.foregroundColor
}
DefaultMouseArea {
@@ -495,11 +490,9 @@ ColumnLayout {
}
}
}
- ItemBox {
- expandedVert: true
- hideHeader: true
- title: "Form"
- minimumHeight: 350
+ Item {
+ Layout.fillWidth: true
+ Layout.fillHeight: true
ColumnLayout {
property int space: 10
anchors.fill: parent
@@ -514,17 +507,17 @@ ColumnLayout {
height: 40
color: 'transparent'
radius: 8
- border.color: theme.redColor
+ border.color: DexTheme.redColor
anchors.horizontalCenter: parent.horizontalCenter
y: 5
DefaultText {
anchors.verticalCenter: parent.verticalCenter
leftPadding: 15
- color: theme.redColor
+ color: DexTheme.redColor
text: qsTr("Order Selected")
}
Qaterial.FlatButton {
- foregroundColor: theme.redColor
+ foregroundColor: DexTheme.redColor
icon.source: Qaterial.Icons.close
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
@@ -541,12 +534,16 @@ ColumnLayout {
Layout.fillWidth: true
Layout.leftMargin: 10
Layout.rightMargin: 10
- Layout.preferredHeight: 200
+ Layout.preferredHeight: 270
border.color: 'transparent'
color: 'transparent'
Layout.alignment: Qt.AlignHCenter
}
-
+ Item {
+ Layout.preferredHeight: 90
+ Layout.fillWidth: true
+ TotalView {}
+ }
Item {
Layout.fillHeight: true
@@ -564,11 +561,12 @@ ColumnLayout {
spacing: 15
// Trade button
- DefaultButton {
+ DexGradientAppButton {
width: parent.width - 20
anchors.horizontalCenter: parent.horizontalCenter
- button_type: sell_mode ? "danger" : "primary"
+ gradient: sell_mode ? activeRedGradient : activeGradient
+ opacity: enabled ? containsMouse ? .7: 1 : .5
text: qsTr("Start Swap")
font.weight: Font.Medium
@@ -593,7 +591,7 @@ ColumnLayout {
width: parent.width
horizontalAlignment: DefaultText.AlignHCenter
font.pixelSize: Style.textSizeSmall4
- color: theme.redColor
+ color: DexTheme.redColor
text_value: General.getTradingError(
last_trading_error,
@@ -607,33 +605,6 @@ ColumnLayout {
Item {}
}
}
- ItemBox {
- id: _best_order_box2
- visible: !isUltraLarge
- SplitView.fillWidth: true
- SplitView.fillHeight: true
- defaultHeight: 130
- minimumHeight: 80
- title: qsTr("Best Orders")
- reloadable: true
- onReload: {
- API.app.trading_pg.orderbook.refresh_best_orders()
- }
-
- Behavior on SplitView.preferredWidth {
- NumberAnimation {
- duration: 100
- }
- }
- BestOrder.List {
- clip: !parent.contentVisible
- id: best_order_list2
- visible: parent.contentVisible
- y: 40
- width: parent.width
- height: parent.height-40
- }
- }
}
}
}
@@ -642,6 +613,75 @@ ColumnLayout {
id: confirm_trade_modal
sourceComponent: ConfirmTradeModal {}
}
+ DexPopup {
+ id: dex_config_popup
+ spacing: 8
+ padding: 4
+ arrowXDecalage: 75
+ backgroundColor: DexTheme.dexBoxBackgroundColor
+ Settings {
+ id: proview_settings
+ property bool chart_visibility: true
+ property bool option_visibility: true
+ property bool orderbook_visibility: true
+ property bool best_order_visibility: false
+ property bool form_visibility: true
+ }
+
+ contentItem: Item {
+ implicitWidth: 350
+ implicitHeight: 190
+ Column {
+ anchors.fill: parent
+ rightPadding: 20
+ padding: 10
+ spacing: 8
+ DexLabel {
+ text: "Display Settings"
+ font: DexTypo.body2
+ }
+ HorizontalLine { width: parent.width-20;anchors.horizontalCenter: parent.horizontalCenter;opacity: .4 }
+ DexCheckEye {
+ text: "Trading Information"
+ targetProperty: "visible"
+ target: optionBox
+ }
+ HorizontalLine { width: parent.width-20;anchors.horizontalCenter: parent.horizontalCenter;opacity: .4 }
+ DexCheckEye {
+ text: "Order Book"
+ targetProperty: "visible"
+ target: _orderbook_box
+ }
+ HorizontalLine { width: parent.width-20;anchors.horizontalCenter: parent.horizontalCenter;opacity: .4 }
+ DexCheckEye {
+ text: "Best Order"
+ targetProperty: "visible"
+ target: _best_order_box
+ }
+ HorizontalLine { width: parent.width-20;anchors.horizontalCenter: parent.horizontalCenter;opacity: .4 }
+ DexCheckEye {
+ id: place_visibility
+ text: "Place Order"
+ targetProperty: "visible"
+ target: order_form
+ }
+ }
+ Component.onCompleted: {
+ dex_chart.visible = proview_settings.chart_visibility
+ optionBox.visible = proview_settings.option_visibility
+ _orderbook_box.visible = proview_settings.orderbook_visibility
+ _best_order_box.visible = proview_settings.best_order_visibility
+ order_form.visible = proview_settings.form_visibility
+ }
+ Component.onDestruction: {
+ proview_settings.form_visibility = order_form.visible
+ proview_settings.chart_visibility = dex_chart.visible
+ proview_settings.option_visibility = optionBox.visible
+ proview_settings.orderbook_visibility = _orderbook_box.visible
+ proview_settings.best_order_visibility = _best_order_box.visible
+ }
+ }
+ }
}
diff --git a/atomic_defi_design/qml/Exchange/Trade/SimpleView/BestOrdersModal.qml b/atomic_defi_design/qml/Exchange/Trade/SimpleView/BestOrdersModal.qml
new file mode 100644
index 0000000000..d52efb29ba
--- /dev/null
+++ b/atomic_defi_design/qml/Exchange/Trade/SimpleView/BestOrdersModal.qml
@@ -0,0 +1,204 @@
+//! Qt Imports
+import QtQuick 2.15 //> Item
+import QtQuick.Layouts 1.15 //> RowLayout
+import QtQuick.Controls 2.15 //> ItemDelegate
+
+//! Project Imports
+import "../../../Components" //> BasicModal
+import "../../../Constants" as Constants // API
+
+BasicModal
+{
+ property var selectedOrder
+ property string currentLeftToken // The token we wanna sell
+
+ property int _rowWidth: width - 20
+ property int _rowHeight: 50
+ property int _tokenColumnSize: 60
+ property int _quantityColumnSize: 100
+ property int _quantityInBaseColumnSize: 100
+ property int _fiatVolumeColumnSize: 50
+ property int _cexRateColumnSize: 50
+
+ onOpened: Constants.API.app.trading_pg.orderbook.refresh_best_orders()
+ id: root
+ width: 800
+ ModalContent
+ {
+ title: qsTr("Best Orders")
+ DefaultListView
+ {
+ enabled: !Constants.API.app.trading_pg.orderbook.best_orders_busy
+ Layout.preferredHeight: 450
+ Layout.fillWidth: true
+ model: Constants.API.app.trading_pg.orderbook.best_orders.proxy_mdl
+ header: Item // Best orders list header
+ {
+ width: _rowWidth
+ height: _rowHeight
+ RowLayout // Order Columns Name
+ {
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.fill: parent
+ DefaultText // "Token" Header
+ {
+ Layout.preferredWidth: _tokenColumnSize
+ text: qsTr("Token")
+ font.family: Style.font_family
+ font.bold: true
+ font.weight: Font.Black
+ }
+ DefaultText // "Available Quantity" Header
+ {
+ Layout.preferredWidth: _quantityColumnSize
+ text: qsTr("Available Quantity")
+ font.family: Style.font_family
+ font.bold: true
+ font.weight: Font.Black
+ }
+ DefaultText // "Available Quantity (in BASE)" header
+ {
+ Layout.preferredWidth: _quantityInBaseColumnSize
+ text: qsTr("Available Quantity (in %1)").arg(currentLeftToken)
+ font.family: Style.font_family
+ font.bold: true
+ font.weight: Font.Black
+ }
+ DefaultText // "Fiat Volume" column header
+ {
+ Layout.preferredWidth: _fiatVolumeColumnSize
+ text: qsTr("Fiat Volume")
+ font.family: Style.font_family
+ font.bold: true
+ font.weight: Font.Black
+ }
+ DefaultText // "CEX Rate" column header
+ {
+ Layout.preferredWidth: _cexRateColumnSize
+ text: qsTr("CEX Rate")
+ font.family: Style.font_family
+ font.bold: true
+ font.weight: Font.Black
+ }
+ }
+ }
+ delegate: ItemDelegate // Order Line
+ {
+ width: _rowWidth
+ height: _rowHeight
+ HorizontalLine { width: parent.width }
+ RowLayout // Order Info
+ {
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.fill: parent
+ RowLayout // Order Token
+ {
+ property int _iconWidth: 24
+
+ Layout.preferredWidth: _tokenColumnSize
+ DefaultImage // Order Token Icon
+ {
+ Layout.preferredWidth: parent._iconWidth
+ Layout.preferredHeight: 24
+ source: General.coinIcon(coin)
+ }
+ DefaultText // Order Token Name
+ {
+ id: _tokenName
+ Layout.preferredWidth: _tokenColumnSize - parent._iconWidth
+ text: coin
+ font.pixelSize: 14
+ }
+ }
+ VerticalLine { Layout.preferredHeight: parent.parent.height }
+ DefaultText // Order Available Quantity
+ {
+ Layout.preferredWidth: _quantityColumnSize
+ text: parseFloat(General.formatDouble(quantity, General.amountPrecision, true)).toFixed(8)
+ font.pixelSize: 14
+ }
+ VerticalLine { Layout.preferredHeight: parent.parent.height }
+ DefaultText // Order Available Quantity In BASE
+ {
+ Layout.preferredWidth: _quantityInBaseColumnSize
+ text: parseFloat(General.formatDouble(base_max_volume, General.amountPrecision, true)).toFixed(8)
+ font.pixelSize: 14
+ }
+ VerticalLine { Layout.preferredHeight: parent.parent.height }
+ DefaultText // Order Fiat Volume
+ {
+ Layout.preferredWidth: _fiatVolumeColumnSize
+ text: price_fiat + Constants.API.app.settings_pg.current_fiat_sign
+ }
+ VerticalLine { Layout.preferredHeight: parent.parent.height }
+ DefaultText
+ {
+ Layout.preferredWidth: _cexRateColumnSize
+ text: cex_rates=== "0" ? "N/A" : parseFloat(cex_rates)>0? "+"+parseFloat(cex_rates).toFixed(2)+"%" : parseFloat(cex_rates).toFixed(2)+"%"
+ }
+ DefaultTooltip
+ {
+ id: _tooltip
+ dim: true
+ modal: true
+ closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside
+ width: 250
+ contentItem: DexLabelUnlinked
+ {
+ text_value: qsTr(" %1 is not enabled - Do you want to enable it to be able to select %2 best orders ?Yes - No ").arg(coin).arg(coin)
+ wrapMode: DefaultText.Wrap
+ width: 250
+ onLinkActivated:
+ {
+ if (link==="#no") _tooltip.close()
+ else
+ {
+ if (Constants.API.app.enable_coins([coin]) === true) _tooltip.close()
+ else cannot_enable_coin_modal.open()
+ }
+ }
+ ModalLoader
+ {
+ property string coin_to_enable_ticker: coin
+ id: cannot_enable_coin_modal
+ sourceComponent: CannotEnableCoinModal { coin_to_enable_ticker: cannot_enable_coin_modal.coin_to_enable_ticker }
+ }
+ }
+ delay: 200
+ }
+ }
+ onClicked:
+ {
+ if (!Constants.API.app.portfolio_pg.global_cfg_mdl.get_coin_info(coin).is_enabled) _tooltip.open()
+ else selectedOrder = { "coin": coin, "uuid": uuid, "price": price, "base_min_volume": base_min_volume, "base_max_volume": base_max_volume }
+ }
+ }
+
+ BusyIndicator
+ {
+ width: 200
+ height: 200
+ visible: !parent.enabled
+ running: visible
+ anchors.centerIn: parent
+ }
+ }
+
+ footer:
+ [
+ DefaultButton
+ {
+ Layout.fillWidth: true
+ text: qsTr("Cancel")
+ onClicked: close()
+ },
+ PrimaryButton
+ {
+ enabled: !Constants.API.app.trading_pg.orderbook.best_orders_busy
+ Layout.fillWidth: true
+ text: qsTr("Refresh")
+ onClicked: API.app.trading_pg.orderbook.refresh_best_orders()
+ }
+ ]
+ }
+}
diff --git a/atomic_defi_design/qml/Exchange/Trade/SimpleView/CoinsListModal.qml b/atomic_defi_design/qml/Exchange/Trade/SimpleView/CoinsListModal.qml
new file mode 100644
index 0000000000..93cee39eeb
--- /dev/null
+++ b/atomic_defi_design/qml/Exchange/Trade/SimpleView/CoinsListModal.qml
@@ -0,0 +1,115 @@
+//! Qt Imports
+import QtQuick 2.15 //> Rectangle, MouseArea
+import QtQuick.Layouts 1.15 //> RowLayout
+import QtQuick.Controls 2.15 //> TextField, TextField.background, ItemDelegate
+
+//! Project Imports
+import "../../../Components" //> BasicModal, DefaultText
+import "../../../Constants" //> API
+
+BasicModal
+{
+ property string selectedTicker
+ id: root
+ width: 450
+ height: 560
+ ColumnLayout {
+ spacing: 10
+ Layout.fillWidth: true
+ height: 540
+ DexLabel {
+ text: qsTr("Select a ticker")
+ font: DexTypo.head5
+ opacity: .7
+ }
+ HorizontalLine {
+
+ }
+ RowLayout
+ {
+ Layout.fillWidth: true
+ TextField
+ {
+ id: searchName
+ Layout.fillWidth: true
+ Layout.preferredHeight: 60
+ Layout.alignment: Qt.AlignHCenter
+ placeholderText: "Search a name"
+ font.pixelSize: Style.textSize1
+ background: Rectangle
+ {
+ color: DexTheme.backgroundColor
+ border.width: 1
+ border.color: DexTheme.colorRectangleBorderGradient1
+ radius: 10
+ }
+ onTextChanged:
+ {
+ if (text.length > 30)
+ text = text.substring(0, 30)
+ API.app.trading_pg.market_pairs_mdl.left_selection_box.search_exp = text
+ }
+
+ Component.onDestruction: API.app.trading_pg.market_pairs_mdl.left_selection_box.search_exp = ""
+ }
+ }
+
+ RowLayout
+ {
+ Layout.topMargin: 10
+ Layout.fillWidth: true
+ DefaultText { text: qsTr("Token name") }
+ }
+
+ DefaultListView
+ {
+ id: view
+ Layout.fillWidth: true
+ Layout.fillHeight: true
+ model: API.app.trading_pg.market_pairs_mdl.left_selection_box
+ spacing: 20
+ clip: true
+ delegate: ItemDelegate
+ {
+ width: root.width
+ anchors.horizontalCenter: root.horizontalCenter
+ height: 40
+
+ DefaultImage
+ {
+ id: _coinIcon
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.leftMargin: 5
+ anchors.left: parent.left
+ width: 30
+ height: 30
+ source: General.coinIcon(model.ticker)
+ DefaultText
+ {
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.left: parent.right
+ anchors.leftMargin: 20
+ text: General.formatCrypto("", model.balance, model.ticker)
+
+ DefaultText
+ {
+ anchors.left: parent.right
+ anchors.leftMargin: 5
+ text: "(%1)".arg(General.getFiatText(model.balance, model.ticker, false))
+ }
+ }
+ }
+
+ MouseArea
+ {
+ anchors.fill: parent
+ onClicked:
+ {
+ root.selectedTicker = model.ticker
+ close()
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/atomic_defi_design/qml/Exchange/Trade/SimpleView/List.qml b/atomic_defi_design/qml/Exchange/Trade/SimpleView/List.qml
new file mode 100644
index 0000000000..cbb1ba6fa4
--- /dev/null
+++ b/atomic_defi_design/qml/Exchange/Trade/SimpleView/List.qml
@@ -0,0 +1,318 @@
+//! Qt Imports
+import QtQuick 2.15
+import QtQuick.Layouts 1.15
+import QtQuick.Controls 2.15
+
+//! 3rdParty Imports
+import Qaterial 1.0 as Qaterial
+
+import App 1.0
+
+//! Project Imports
+import "../../../Components"
+import "../../../Constants" as Constants //> Style
+import "../Orders" as Orders
+import "Main.js" as Main
+
+DexListView {
+ id: order_list_view
+ anchors.fill: parent
+ model: API.app.orders_mdl.orders_proxy_mdl
+ clip: true
+ currentIndex: -1
+ spacing: 5
+ delegate: ClipRRect {
+ property var details: model
+ readonly property bool is_placed_order: !details ? false :
+ details.order_id !== ''
+
+ property bool expanded: order_list_view.currentIndex === index
+ width: order_list_view.width - 40
+ x: 20
+ height: expanded? colum_order.height + 25 : 70
+ radius: 12
+ Rectangle {
+ anchors.fill: parent
+ color: order_mouse_area.containsMouse? DexTheme.surfaceColor : DexTheme.portfolioPieGradient ? '#FFFFFF' : 'transparent'
+ border.color: DexTheme.surfaceColor
+ border.width: expanded? 1 : 0
+ radius: 10
+ }
+ DexMouseArea {
+ id: order_mouse_area
+ anchors.fill: parent
+ hoverEnabled: true
+ onClicked: {
+ if(order_list_view.currentIndex === index) {
+ order_list_view.currentIndex = -1
+ }else {
+ order_list_view.currentIndex = index
+ }
+ }
+ }
+ Column {
+ id: colum_order
+ width: parent.width
+ spacing: 5
+ topPadding: 0
+ RowLayout {
+ width: parent.width
+ height: 70
+ spacing: 5
+ Item {
+ Layout.preferredWidth: 40
+ height: 30
+ BusyIndicator {
+ width: 30
+ height: width
+ anchors.centerIn: parent
+ running: !isSwapDone(details.order_status) && Qt.platform.os != "osx"
+ DefaultText {
+ anchors.centerIn: parent
+ font.pixelSize: 9
+ color: !details ? "white" : getStatusColor(details.order_status)
+ text_value: !details ? "" :
+ visible ? getStatusStep(details.order_status) : ''
+ }
+ }
+ }
+ Row {
+ Layout.preferredWidth: 100
+ Layout.fillHeight: true
+ Layout.alignment: Label.AlignVCenter
+ spacing: 5
+ DefaultImage {
+ id: base_icon
+ source: General.coinIcon(!details ? atomic_app_primary_coin :
+ details.base_coin?? atomic_app_primary_coin)
+ width: Constants.Style.textSize1
+ height: width
+ anchors.verticalCenter: parent.verticalCenter
+ }
+ DexLabel {
+ id: base_amount
+ text_value: !details ? "" :
+ General.formatCrypto("", details.base_amount, details.base_coin).replace(" "," ")
+ //details.base_amount_current_currency, API.app.settings_pg.current_currency
+ font: rel_amount.font
+ privacy: is_placed_order
+ anchors.verticalCenter: parent.verticalCenter
+ }
+ }
+
+ Item {
+ Layout.preferredWidth: 40
+ Layout.fillWidth: true
+ SwapIcon {
+ //visible: !status_text.visible
+ width: 30
+ height: 30
+ opacity: .6
+ anchors.centerIn: parent
+ top_arrow_ticker: !details ? atomic_app_primary_coin :
+ details.base_coin?? ""
+ bottom_arrow_ticker: !details ? atomic_app_primary_coin :
+ details.rel_coin?? ""
+ }
+ }
+ Row {
+ Layout.preferredWidth: 120
+ Layout.fillHeight: true
+ Layout.alignment: Label.AlignVCenter
+ spacing: 5
+ DefaultImage {
+ id: rel_icon
+ source: General.coinIcon(!details ? atomic_app_primary_coin :
+ details.rel_coin?? atomic_app_secondary_coin)
+
+ width: base_icon.width
+ height: width
+ anchors.verticalCenter: parent.verticalCenter
+ }
+ DefaultText {
+ id: rel_amount
+ text_value: !details ? "" :
+ General.formatCrypto("", details.rel_amount, details.rel_coin).replace(" "," ")
+ font: Qt.font({
+ pixelSize: 14,
+ letterSpacing: 0.4,
+ family: DexTypo.fontFamily,
+ weight: Font.Normal
+ })
+ anchors.verticalCenter: parent.verticalCenter
+ privacy: is_placed_order
+ }
+ }
+ Qaterial.ColorIcon {
+ Layout.alignment: Qt.AlignVCenter
+ color: DexTheme.foregroundColor
+ source: expanded? Qaterial.Icons.chevronUp : Qaterial.Icons.chevronDown
+ iconSize: 14
+ }
+ Item {
+ Layout.preferredWidth: 10
+ Layout.fillHeight: true
+ opacity: .6
+
+ }
+
+ }
+ RowLayout {
+ visible: expanded
+ width: parent.width-40
+ anchors.horizontalCenter: parent.horizontalCenter
+ height: 20
+ opacity: .6
+ DexLabel {
+ Layout.fillWidth: true
+ Layout.fillHeight: true
+ verticalAlignment: Label.AlignVCenter
+ text: !details ? "" :
+ General.formatCrypto("", details.base_amount, details.base_coin)
+ }
+ DexLabel {
+ Layout.fillWidth: true
+ Layout.fillHeight: true
+ verticalAlignment: Label.AlignVCenter
+ horizontalAlignment: Text.AlignRight
+ text: !details ? "" :
+ General.formatCrypto("", details.rel_amount, details.rel_coin)
+ }
+ }
+ RowLayout {
+ visible: expanded
+ width: parent.width-40
+ anchors.horizontalCenter: parent.horizontalCenter
+ height: 20
+ opacity: .6
+ DexLabel {
+ Layout.fillWidth: true
+ Layout.fillHeight: true
+ verticalAlignment: Label.AlignVCenter
+ text: "%1 %2".arg(API.app.settings_pg.current_currency).arg(details.base_amount_current_currency)
+ }
+ DexLabel {
+ Layout.fillWidth: true
+ Layout.fillHeight: true
+ verticalAlignment: Label.AlignVCenter
+ horizontalAlignment: Text.AlignRight
+ text: "%1 %2".arg(API.app.settings_pg.current_currency).arg(details.rel_amount_current_currency)
+ }
+ }
+ RowLayout {
+ visible: expanded
+ width: parent.width-40
+ anchors.horizontalCenter: parent.horizontalCenter
+ height: 20
+ opacity: .6
+ DexLabel {
+ Layout.fillWidth: true
+ Layout.fillHeight: true
+ verticalAlignment: Label.AlignVCenter
+ text: !details ? "" : details.date?? ""
+ }
+ Item {
+ Layout.preferredWidth: 100
+ Layout.fillHeight: true
+ visible: !details || details.recoverable === undefined ? false : details.recoverable && details.order_status !== "refunding"
+ Row {
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.right: parent.right
+ anchors.rightMargin: 0
+ spacing: 5
+ Qaterial.ColorIcon {
+ anchors.verticalCenter: parent.verticalCenter
+ source: Qaterial.Icons.alert
+ iconSize: 15
+ color: Qaterial.Colors.amber
+ }
+ DexLabel {
+ anchors.verticalCenter: parent.verticalCenter
+ text: "Refund "
+ color: Qaterial.Colors.amber
+ }
+ }
+ MouseArea {
+ id: refund_hover
+ anchors.fill: parent
+ hoverEnabled: true
+ }
+ DefaultTooltip {
+ visible: (parent.visible && refund_hover.containsMouse) ?? false
+
+ contentItem: ColumnLayout {
+ DexLabel {
+ text_value: qsTr("Funds are recoverable")
+ font.pixelSize: Constants.Style.textSizeSmall4
+ }
+ }
+ }
+ }
+ }
+ RowLayout {
+ visible: expanded
+ width: parent.width-30
+ anchors.horizontalCenter: parent.horizontalCenter
+ height: 30
+ opacity: .6
+ Qaterial.OutlineButton {
+ Layout.preferredWidth: 100
+ Layout.fillHeight: true
+ bottomInset: 0
+ topInset: 0
+ outlinedColor: DexTheme.redColor
+ visible: (!main_order.is_history? details.cancellable?? false : false)===true? (order_mouse_area.containsMouse || hovered)? true : false : false
+ onClicked: { if(details) cancelOrder(details.order_id) }
+ Row {
+ anchors.centerIn: parent
+ spacing: 5
+ Qaterial.ColorIcon {
+ anchors.verticalCenter: parent.verticalCenter
+ source: Qaterial.Icons.close
+ iconSize: 17
+ color: DexTheme.redColor
+ }
+ DexLabel {
+ anchors.verticalCenter: parent.verticalCenter
+ text: "Cancel "
+ color: DexTheme.redColor
+ }
+ }
+ }
+
+ Qaterial.OutlineButton {
+ Layout.preferredWidth: 80
+ Layout.fillHeight: true
+ bottomInset: 0
+ topInset: 0
+ outlinedColor: Qaterial.Colors.gray
+ Row {
+ anchors.centerIn: parent
+ spacing: 5
+ Qaterial.ColorIcon {
+ anchors.verticalCenter: parent.verticalCenter
+ source: Qaterial.Icons.eye
+ iconSize: 15
+ color: Qaterial.Colors.gray
+ }
+ DexLabel {
+ anchors.verticalCenter: parent.verticalCenter
+ text: "Show "
+ color: Qaterial.Colors.gray
+ }
+ }
+ onClicked: {
+ order_modal.open()
+ order_modal.item.details = details
+ }
+ }
+ Item {
+ Layout.fillWidth: true
+ Layout.fillHeight: true
+
+ }
+ }
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/atomic_defi_design/qml/Exchange/Trade/SimpleView/Main.js b/atomic_defi_design/qml/Exchange/Trade/SimpleView/Main.js
new file mode 100644
index 0000000000..3c585494c5
--- /dev/null
+++ b/atomic_defi_design/qml/Exchange/Trade/SimpleView/Main.js
@@ -0,0 +1,4 @@
+function getSubPages()
+{
+ return { Trade: 0, Orders: 1, History: 2 }
+}
diff --git a/atomic_defi_design/qml/Exchange/Trade/SimpleView/Main.qml b/atomic_defi_design/qml/Exchange/Trade/SimpleView/Main.qml
new file mode 100644
index 0000000000..fab3a6f170
--- /dev/null
+++ b/atomic_defi_design/qml/Exchange/Trade/SimpleView/Main.qml
@@ -0,0 +1,201 @@
+//! Qt Imports
+import QtQuick 2.15
+import QtQuick.Layouts 1.15
+import QtQuick.Controls 2.15
+
+//! 3rdParty Imports
+import Qaterial 1.0 as Qaterial
+
+import App 1.0
+
+//! Project Imports
+import "../../../Components"
+import "../../../Constants" as Constants
+import "../Orders" as Orders
+import "Main.js" as Main
+
+Item {
+ id: root
+
+ readonly property var subPages: Main.getSubPages()
+
+ // Variable which holds the current sub-page of the SimpleView.
+ property var currentSubPage: subPages.Trade
+
+ onCurrentSubPageChanged: _selectedTabMarker.update()
+
+ Connections
+ {
+ target: exchange_trade
+ function onOrderPlaced()
+ {
+ currentSubPage = subPages.Orders
+ }
+ }
+
+ Column
+ {
+ width: root.currentSubPage === subPages.Trade? _simpleTrade.best? 600 : 450 : 450
+ y: 120
+ spacing: 30
+ anchors.horizontalCenter: parent.horizontalCenter
+
+ InnerBackground // Sub-pages Tabs Selector
+ {
+ anchors.horizontalCenter: parent.horizontalCenter
+ width: 250
+ height: 40
+ border.width: 1
+ border.color: DexTheme.dexBoxBackgroundColor
+ color: DexTheme.surfaceColor
+ shadowOff: true
+ radius: 40
+
+ FloatingBackground // Selected Tab Rectangle
+ {
+ id: _selectedTabMarker
+
+ function update() // Updates transform according to selected sub-page.
+ {
+ switch (currentSubPage)
+ {
+ case subPages.Trade:
+ x = 0
+ break;
+ case subPages.Orders:
+ x = (parent.width / 3)
+ orders_view.update()
+ break;
+ case subPages.History:
+ x = (parent.width / 3) *2
+ history_view.update()
+ break;
+ }
+ }
+
+ Behavior on x {
+ NumberAnimation {
+ duration: 150
+ }
+ }
+ show_shadow: false
+ light_gradient.visible: false
+
+ border.width: 3
+ border.color: 'transparent'
+ height: parent.height - 2
+ anchors.verticalCenter: parent.verticalCenter
+ width: (parent.width / 3)
+ radius: 40
+ color: DexTheme.tabBarBackgroudColor
+ }
+ RowLayout {
+ anchors.fill: parent
+ spacing: 0
+
+ NavigationLabel
+ {
+ id: _tradeText
+ currentPage: currentSubPage
+ selectedPage: subPages.Trade
+ Layout.preferredWidth: parent.width/3
+ Layout.fillHeight: true
+ text: qsTr("Trade")
+ font.pixelSize: Constants.Style.textSize
+ onClicked: if (currentSubPage !== subPages.Trade) currentSubPage = subPages.Trade
+ }
+
+ NavigationLabel
+ {
+ id: _ordersText
+ currentPage: currentSubPage
+ selectedPage: subPages.Orders
+ Layout.preferredWidth: parent.width/3
+ Layout.fillHeight: true
+ text: qsTr("Orders")
+ font.pixelSize: Constants.Style.textSize
+ onClicked: if (currentSubPage !== subPages.Orders) currentSubPage = subPages.Orders
+ }
+
+ NavigationLabel
+ {
+ id: _historyText
+ currentPage: currentSubPage
+ selectedPage: subPages.History
+ Layout.preferredWidth: parent.width/3
+ Layout.fillHeight: true
+ text: qsTr("History")
+ font.pixelSize: Constants.Style.textSize
+ onClicked: if (currentSubPage !== subPages.History) currentSubPage = subPages.History
+ }
+
+ }
+
+ }
+
+ SwipeView {
+ id: _swipeSimplifiedView
+ currentIndex: root.currentSubPage
+ anchors.horizontalCenter: parent.horizontalCenter
+ width: 600
+ height: 650
+ clip: true
+ interactive: false
+ Item {
+ DexRectangle {
+ id: subTradePage
+ height: _simpleTrade.height
+ width: _simpleTrade.best? 600 : _simpleTrade.coinSelection ? 450 : 380
+ anchors.horizontalCenter: parent.horizontalCenter
+ radius: 20
+ color: DexTheme.dexBoxBackgroundColor
+ border.width: DexTheme.portfolioPieGradient ? 0 : 1
+ gradient: DexTheme.portfolioPieGradient ? app.globalGradient : undefined
+ sizeAnimationDuration: 250
+ sizeAnimation: true
+ ClipRRect {
+ anchors.fill: parent
+ radius: 20
+ Trade
+ {
+ id: _simpleTrade
+ width: parent.width
+ }
+ }
+ }
+ }
+ Item {
+ DexRectangle {
+ width: 420
+ anchors.horizontalCenter: parent.horizontalCenter
+ height: 500
+ radius: 20
+ color: DexTheme.dexBoxBackgroundColor
+ border.width: DexTheme.portfolioPieGradient ? 0 : 1
+ gradient: DexTheme.portfolioPieGradient ? app.globalGradient : undefined
+ SubOrders {
+ id: orders_view
+ }
+ }
+ }
+ Item {
+ DexRectangle {
+ width: 420
+ anchors.horizontalCenter: parent.horizontalCenter
+ height: 500
+ radius: 20
+ color: DexTheme.dexBoxBackgroundColor
+ border.width: DexTheme.portfolioPieGradient ? 0 : 1
+ gradient: DexTheme.portfolioPieGradient ? app.globalGradient : undefined
+ SubHistory {
+ id: history_view
+ }
+ }
+ }
+ }
+ }
+ ModalLoader {
+ id: order_modal
+ sourceComponent: Orders.OrderModal {}
+ }
+}
diff --git a/atomic_defi_design/qml/Exchange/Trade/SimpleView/NavigationLabel.qml b/atomic_defi_design/qml/Exchange/Trade/SimpleView/NavigationLabel.qml
new file mode 100644
index 0000000000..bb87c8cb37
--- /dev/null
+++ b/atomic_defi_design/qml/Exchange/Trade/SimpleView/NavigationLabel.qml
@@ -0,0 +1,29 @@
+//! Qt Imports
+import QtQuick 2.15
+//! 3rdParty Imports
+import Qaterial 1.0 as Qaterial
+
+import App 1.0
+
+//! Project Imports
+import "../../../Components"
+
+DexLabel // Trade Tab
+{
+ id: control
+ property var currentPage
+ property var selectedPage
+ horizontalAlignment: Text.AlignHCenter
+ verticalAlignment: Text.AlignVCenter
+ font.pixelSize: Constants.Style.textSize
+ property bool checked: false
+ signal clicked()
+ color: DexTheme.foregroundColor
+ DexMouseArea
+ {
+ id: mouseArea
+ anchors.fill: parent
+ onClicked: control.clicked()
+ hoverEnabled: true
+ }
+}
\ No newline at end of file
diff --git a/atomic_defi_design/qml/Exchange/Trade/SimpleView/OrderRemovedModal.qml b/atomic_defi_design/qml/Exchange/Trade/SimpleView/OrderRemovedModal.qml
new file mode 100644
index 0000000000..281ab68c75
--- /dev/null
+++ b/atomic_defi_design/qml/Exchange/Trade/SimpleView/OrderRemovedModal.qml
@@ -0,0 +1,27 @@
+import "../../../Components"
+import "../../../Constants"
+
+BasicModal
+{
+ id: root
+ width: 1000
+ ModalContent
+ {
+ title: qsTr("Selected Order Removed")
+
+ DefaultText
+ {
+ text: qsTr("The selected order does not exist anymore, it might have been matched or canceled, and no order with a better price is available. Please select a new order.")
+ }
+
+ footer:
+ [
+ DefaultButton
+ {
+ text: qsTr("OK")
+ onClicked: close()
+ }
+ ]
+ }
+
+}
diff --git a/atomic_defi_design/qml/Exchange/Trade/SimpleView/SubBestOrder.qml b/atomic_defi_design/qml/Exchange/Trade/SimpleView/SubBestOrder.qml
new file mode 100644
index 0000000000..91a8df37f1
--- /dev/null
+++ b/atomic_defi_design/qml/Exchange/Trade/SimpleView/SubBestOrder.qml
@@ -0,0 +1,246 @@
+//! Qt Imports
+import QtQuick 2.15 //> Item
+import QtQuick.Layouts 1.15 //> RowLayout
+import QtQuick.Controls 2.15 //> ItemDelegate
+
+import App 1.0
+
+//! Project Imports
+import "../../../Components" //> BasicModal
+import "../../../Constants" as Constants //> API
+
+DefaultListView
+{
+ id: _listBestOrdersView
+
+ property var tradeCard
+ property var selectedOrder
+ property bool best: true
+ property string currentLeftToken // The token we wanna sell
+
+ property int _rowWidth: width - 20
+ property int _rowHeight: 50
+ property int _tokenColumnSize: 60
+ property int _quantityColumnSize: 100
+ property int _quantityInBaseColumnSize: 100
+ property int _fiatVolumeColumnSize: 50
+ property int _cexRateColumnSize: 50
+
+ enabled: !Constants.API.app.trading_pg.orderbook.best_orders_busy
+ model: Constants.API.app.trading_pg.orderbook.best_orders.proxy_mdl
+ headerPositioning: ListView.OverlayHeader
+ reuseItems: true
+ cacheBuffer: 40
+ clip: true
+
+ Connections
+ {
+ target: _tradeCard
+ function onBestChanged()
+ {
+ Constants.API.app.trading_pg.orderbook.best_orders.proxy_mdl.setFilterFixedString("")
+ positionViewAtBeginning()
+ }
+ }
+
+ onVisibleChanged: currentLeftToken = _tradeCard.selectedTicker
+
+ header: DexRectangle // Best orders list header
+ {
+ width: _rowWidth
+ height: _rowHeight
+ border.color: 'transparent'
+ color: DexTheme.portfolioPieGradient ? DexTheme.contentColorTopBold : DexTheme.dexBoxBackgroundColor
+ z: 2
+ radius: 0
+
+ MouseArea { anchors.fill: parent }
+ RowLayout // Order Columns Name
+ {
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.fill: parent
+ DexLabel // "Token" Header
+ {
+ Layout.preferredWidth: _tokenColumnSize
+ text: qsTr("Token")
+ font.family: Constants.Style.font_family
+ font.bold: true
+ font.pixelSize: 12
+ font.weight: Font.Bold
+ }
+ DexLabel // "Available Quantity" Header
+ {
+ Layout.preferredWidth: _quantityColumnSize
+ text: qsTr("Available Quantity")
+ font.family: Constants.Style.font_family
+ font.bold: true
+ font.pixelSize: 12
+ font.weight: Font.Bold
+ }
+ DexLabel // "Available Quantity (in BASE)" header
+ {
+ Layout.preferredWidth: _quantityInBaseColumnSize
+ text: qsTr("Available Quantity (in %1)").arg(currentLeftToken)
+ font.family: Constants.Style.font_family
+ font.bold: true
+ font.pixelSize: 12
+ font.weight: Font.Bold
+ }
+ DexLabel // "Fiat Volume" column header
+ {
+ Layout.preferredWidth: _fiatVolumeColumnSize
+ text: qsTr("Fiat Volume")
+ font.family: Constants.Style.font_family
+ font.bold: true
+ font.pixelSize: 12
+ font.weight: Font.Bold
+ }
+ DexLabel // "CEX Rate" column header
+ {
+ Layout.preferredWidth: _cexRateColumnSize
+ text: qsTr("CEX Rate")
+ font.family: Constants.Style.font_family
+ font.bold: true
+ font.pixelSize: 12
+ font.weight: Font.Bold
+ }
+ }
+ }
+
+ delegate: ItemDelegate // Order Line
+ {
+ property bool _isCoinEnabled: Constants.API.app.portfolio_pg.global_cfg_mdl.get_coin_info(coin).is_enabled
+
+ width: _rowWidth
+ height: _rowHeight
+
+ HorizontalLine { width: parent.width; opacity: .5 }
+
+ RowLayout // Order Info
+ {
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.fill: parent
+ RowLayout // Order Token
+ {
+ property int _iconWidth: 24
+
+ Layout.preferredWidth: _tokenColumnSize
+ DefaultImage // Order Token Icon
+ {
+ Layout.preferredWidth: parent._iconWidth
+ Layout.preferredHeight: 24
+
+ source: General.coinIcon(coin)
+ opacity: !_isCoinEnabled? .1 : 1
+ }
+ DefaultText // Order Token Name
+ {
+ id: _tokenName
+ Layout.preferredWidth: _tokenColumnSize - parent._iconWidth
+ text: coin
+ font.pixelSize: 14
+ }
+ }
+
+ DefaultText // Order Available Quantity
+ {
+ Layout.preferredWidth: _quantityColumnSize
+ text: parseFloat(General.formatDouble(quantity, General.amountPrecision, true)).toFixed(8)
+ font.pixelSize: 14
+ }
+
+ DefaultText // Order Available Quantity In BASE
+ {
+ Layout.preferredWidth: _quantityInBaseColumnSize
+ text: parseFloat(General.formatDouble(base_max_volume, General.amountPrecision, true)).toFixed(8)
+ font.pixelSize: 14
+ }
+
+ DefaultText // Order Fiat Volume
+ {
+ Layout.preferredWidth: _fiatVolumeColumnSize
+ text: price_fiat+Constants.API.app.settings_pg.current_fiat_sign
+ }
+
+ DefaultText
+ {
+ Layout.preferredWidth: _cexRateColumnSize
+ color: cex_rates=== "0" ? Qt.darker(DexTheme.foregroundColor) : parseFloat(cex_rates)>0? DexTheme.redColor : DexTheme.greenColor
+ text: cex_rates=== "0" ? "N/A" : parseFloat(cex_rates)>0? "+"+parseFloat(cex_rates).toFixed(2)+"%" : parseFloat(cex_rates).toFixed(2)+"%"
+ }
+ DefaultTooltip
+ {
+ id: _tooltip
+
+ width: 250
+
+ dim: true
+ modal: true
+ closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside
+
+ contentItem: DexLabelUnlinked
+ {
+ text_value: qsTr(" %1 is not enabled - Do you want to enable it to be able to select %2 best orders ?Yes - No ").arg(coin).arg(coin)
+ wrapMode: DefaultText.Wrap
+ width: 250
+ onLinkActivated:
+ {
+ if (link === "#no") _tooltip.close()
+ else
+ {
+ if (Constants.API.app.enable_coins([coin]) === false)
+ cannot_enable_coin_modal.open()
+ else
+ {
+ color = DexTheme.buttonColorTextDisabled
+ opacity = 0.8
+ _coinIsEnabling.visible = true
+ }
+ }
+ }
+ }
+
+ BusyIndicator
+ {
+ id: _coinIsEnabling
+
+ visible: false
+ enabled: visible
+ anchors.fill: parent
+
+ Connections
+ {
+ target: Constants.API.app.portfolio_pg.global_cfg_mdl.all_disabled_proxy
+
+ function onLengthChanged()
+ {
+ _tooltip.close()
+ _isCoinEnabled = Constants.API.app.portfolio_pg.global_cfg_mdl.get_coin_info(coin).is_enabled
+ }
+ }
+ }
+
+ ModalLoader
+ {
+ property string coin_to_enable_ticker: coin
+ id: cannot_enable_coin_modal
+ sourceComponent: CannotEnableCoinModal { coin_to_enable_ticker: cannot_enable_coin_modal.coin_to_enable_ticker }
+ }
+
+ delay: 200
+ }
+ }
+ onClicked:
+ {
+ if (!Constants.API.app.portfolio_pg.global_cfg_mdl.get_coin_info(coin).is_enabled)
+ {
+ _tooltip.open()
+ }
+ else
+ {
+ _listBestOrdersView.tradeCard.best = false
+ _listBestOrdersView.selectedOrder = { "coin": coin, "uuid": uuid, "price": price, "base_min_volume": base_min_volume, "base_max_volume": base_max_volume, "from_best_order": true }
+ }
+ }
+ }
+}
diff --git a/atomic_defi_design/qml/Exchange/Trade/SimpleView/SubCoinSelector.qml b/atomic_defi_design/qml/Exchange/Trade/SimpleView/SubCoinSelector.qml
new file mode 100644
index 0000000000..1bc8b444fc
--- /dev/null
+++ b/atomic_defi_design/qml/Exchange/Trade/SimpleView/SubCoinSelector.qml
@@ -0,0 +1,193 @@
+//! Qt Imports
+import QtQuick 2.15 //> Item
+import QtQuick.Layouts 1.15 //> RowLayout
+import QtQuick.Controls 2.15 //> ItemDelegate
+
+// 3rdParty
+import Qaterial 1.0 as Qaterial
+
+import App 1.0
+
+//! Project Imports
+import "../../../Components" //> BasicModal
+import "../../../Constants" as Constants //> API
+
+DefaultListView
+{
+ id: _listCoinView
+
+ property int _rowWidth: width - 20
+ property int _rowHeight: 50
+ property int _tokenColumnSize: 160
+
+ signal tickerSelected(var ticker)
+
+ model: Constants.API.app.trading_pg.market_pairs_mdl.left_selection_box
+ headerPositioning: ListView.OverlayHeader
+ reuseItems: true
+ cacheBuffer: 40
+
+ header: DexRectangle
+ {
+ z: 2
+ width: _rowWidth
+ height: _rowHeight
+ border.color: 'transparent'
+ color: DexTheme.portfolioPieGradient ? DexTheme.contentColorTopBold : DexTheme.dexBoxBackgroundColor
+ radius: 0
+
+ RowLayout // Coins Columns Name
+ {
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.fill: parent
+ spacing: 2
+ DexLabel // "Token" Header
+ {
+ property bool asc: true
+
+ Layout.preferredWidth: _tokenColumnSize
+ text: qsTr("Token")
+ font.family: Style.font_family
+ font.bold: true
+ font.pixelSize: 12
+ font.weight: Font.Bold
+ color: children[1].containsMouse? DexTheme.accentColor : DexTheme.foregroundColor
+ DexMouseArea
+ {
+ anchors.fill: parent
+ hoverEnabled: true
+ onClicked:
+ {
+ parent.asc = !parent.asc
+ _listCoinView.model.sort_by_name(parent.asc)
+ }
+ }
+ }
+ DexLabel // "Balance" Header
+ {
+ property bool asc: true
+
+ Layout.fillWidth: true
+ text: qsTr("Balance")
+ font.family: Style.font_family
+ font.bold: true
+ font.pixelSize: 12
+ font.weight: Font.Bold
+ color: children[1].containsMouse? DexTheme.accentColor : DexTheme.foregroundColor
+
+ DexMouseArea
+ {
+ anchors.fill: parent
+ hoverEnabled: true
+ onClicked:
+ {
+ parent.asc = !parent.asc
+ _listCoinView.model.sort_by_currency_balance(parent.asc)
+ }
+ }
+ }
+ DexLabel // Fiat Balance Header
+ {
+ property bool asc: true
+
+ text: qsTr("Balance Fiat")
+ font.family: Style.font_family
+ font.bold: true
+ font.pixelSize: 12
+ font.weight: Font.Bold
+ color: children[1].containsMouse? DexTheme.accentColor : DexTheme.foregroundColor
+
+ DexMouseArea
+ {
+ anchors.fill: parent
+ hoverEnabled: true
+ onClicked:
+ {
+ parent.asc = !parent.asc
+ _listCoinView.model.sort_by_currency_balance(parent.asc)
+ }
+ }
+ }
+ }
+ }
+
+ delegate: ItemDelegate
+ {
+ width: _listCoinView._rowWidth
+ height: 40
+ RowLayout
+ {
+ anchors.fill: parent
+ spacing: 2
+ Item
+ {
+ Layout.preferredWidth: _tokenColumnSize
+ height: 40
+ Row
+ {
+ anchors.verticalCenter: parent.verticalCenter
+ spacing: 10
+ DefaultImage
+ {
+ id: _coinIcon
+ width: 20
+ height: 20
+ source: General.coinIcon(model.ticker)
+ anchors.verticalCenter: parent.verticalCenterv
+ }
+ DefaultText
+ {
+ anchors.verticalCenter: parent.verticalCenter
+ text: model.ticker
+
+ }
+ }
+ Qaterial.DebugRectangle
+ {
+ anchors.fill: parent
+ visible: false
+ }
+ }
+ Item
+ {
+ Layout.fillWidth: true
+ height: 40
+ DexLabel
+ {
+ anchors.verticalCenter: parent.verticalCenter
+ text: model.balance.replace(" ","")
+ horizontalAlignment: Label.AlignLeft
+
+ }
+ Qaterial.DebugRectangle
+ {
+ anchors.fill: parent
+ visible: false
+ }
+ }
+ DexLabel
+ {
+ Layout.alignment: Qt.AlignVCenter
+ text: "%1".arg(General.getFiatText(model.balance, model.ticker, false))
+ Qaterial.DebugRectangle
+ {
+ anchors.fill: parent
+ visible: false
+ }
+ }
+ }
+
+ MouseArea
+ {
+ anchors.fill: parent
+ onClicked: tickerSelected(model.ticker)
+ }
+ }
+
+ DexLabel
+ {
+ anchors.centerIn: parent
+ text: qsTr('No Selectable coin.')
+ visible: parent.count === 0
+ }
+}
diff --git a/atomic_defi_design/qml/Exchange/Trade/SimpleView/SubHistory.qml b/atomic_defi_design/qml/Exchange/Trade/SimpleView/SubHistory.qml
new file mode 100644
index 0000000000..0303626ae6
--- /dev/null
+++ b/atomic_defi_design/qml/Exchange/Trade/SimpleView/SubHistory.qml
@@ -0,0 +1,344 @@
+//! Qt Imports
+import QtQuick 2.15
+import QtQuick.Layouts 1.15
+import QtQuick.Controls 2.15
+import Qt.labs.platform 1.1
+
+//! 3rdParty Imports
+import Qaterial 1.0 as Qaterial
+
+//! Project Imports
+import "../../../Components"
+import "../../../Constants" as Constants //> Style
+import "../Orders" as Orders
+import "Main.js" as Main
+
+import App 1.0
+
+Item {
+ id: _subHistoryRoot
+
+ readonly property date default_min_date: new Date("2019-01-01")
+ readonly property date default_max_date: new Date(new Date().setDate(new Date().getDate() + 30))
+ property var list_model_proxy: API.app.orders_mdl.orders_proxy_mdl
+ property bool displayFilter: false
+
+ function update() {
+ reset()
+ if(combo_base.currentTicker !== "All" | combo_rel.currentTicker !== "All") {
+ buttonDelay.start()
+ }
+ }
+
+ function reset() {
+ list_model_proxy.is_history = false
+ applyFilter()
+ applyAllFiltering()
+ list_model_proxy.is_history = true
+
+ }
+
+ function applyTickerFilter() {
+ applyTickerFilter2(combo_base.currentTicker, combo_rel.currentTicker)
+ }
+
+ function applyTickerFilter2(ticker1, ticker2) {
+ list_model_proxy.set_coin_filter(ticker1 + "/" + ticker2)
+ }
+
+ function applyDateFilter() {
+ list_model_proxy.filter_minimum_date = min_date.date
+
+ if(max_date.date < min_date.date)
+ max_date.date = min_date.date
+
+ list_model_proxy.filter_maximum_date = max_date.date
+ }
+
+ function applyFilter() {
+ applyTickerFilter()
+ applyDateFilter()
+ }
+
+ function applyAllFiltering() {
+ list_model_proxy.apply_all_filtering()
+ }
+
+ anchors.fill: parent
+
+ Component.onDestruction: reset()
+
+ Timer {
+ id: buttonDelay
+ interval: 200
+ running: true
+ onTriggered: applyButton.clicked()
+ }
+
+ ColumnLayout // History
+ {
+ height: parent.height
+ width: parent.width
+ spacing: 20
+
+ Column // Header
+ {
+ leftPadding: 20
+ topPadding: 20
+
+ DefaultText // Title
+ {
+ text: qsTr("History")
+ font: DexTypo.head6
+ opacity: .8
+ }
+
+ DexLabel // Description
+ {
+ width: _subHistoryRoot.width - 40
+ anchors.topMargin: 12
+ font.pixelSize: Constants.Style.textSizeSmall4
+ DexLabel {
+ opacity: .4
+ text: qsTr("Filter") + " %1 / %2 %3 %4 - %5"
+ .arg(combo_base.currentTicker)
+ .arg(combo_rel.currentTicker)
+ .arg(qsTr("Date"))
+ .arg(min_date.date.toLocaleDateString(Locale.ShortFormat, "yyyy.MM.dd"))
+ .arg(max_date.date.toLocaleDateString(Locale.ShortFormat, "yyyy.MM.dd"))
+ }
+
+ DexAppButton
+ {
+ anchors.right: parent.right
+ anchors.rightMargin: -5
+ anchors.bottom: parent.bottom
+ iconSource: _subHistoryRoot.displayFilter ? Qaterial.Icons.close : Qaterial.Icons.cogBox
+ iconSize: 14
+ backgroundColor: DexTheme.iconButtonColor
+ foregroundColor: DexTheme.iconButtonForegroundColor
+ opacity: containsMouse ? .7 : 1
+ width: 35
+ height: 25
+ ToolTip.delay: 500
+ ToolTip.timeout: 5000
+ ToolTip.visible: containsMouse
+ ToolTip.text: _subHistoryRoot.displayFilter ? qsTr("Close filtering options.") : qsTr("Open filering options.")
+ onClicked: _subHistoryRoot.displayFilter = !_subHistoryRoot.displayFilter
+ }
+ }
+ }
+
+ Item { height: 2; Layout.fillWidth: true }
+
+ Item {
+ id: main_order
+ Layout.fillHeight: true
+ Layout.fillWidth: true
+ property bool is_history: true
+
+ Component.onCompleted: {
+ _subHistoryRoot.list_model_proxy.is_history = is_history
+ }
+ List {
+ id: order_list_view
+ }
+ DexRectangle {
+ anchors.fill: parent
+ color: DexTheme.portfolioPieGradient ? 'transparent' : DexTheme.dexBoxBackgroundColor
+ opacity: .8
+ visible: _subHistoryRoot.displayFilter
+ border.width: 0
+ }
+ DexRectangle {
+ width: parent.width
+ height: _subHistoryRoot.displayFilter ? parent.height : 60
+ visible: height>100
+ sizeAnimation: true
+ color: DexTheme.portfolioPieGradient ? DexTheme.contentColorTopBold : DexTheme.dexBoxBackgroundColor
+ radius: 0
+ y: -20
+ Column {
+ anchors.horizontalCenter: parent.horizontalCenter
+ leftPadding: 15
+ rightPadding: 15
+ visible: parent.height > 250
+ DexLabel {
+ text: qsTr("Filter settings")
+ topPadding: 10
+ leftPadding: 10
+ font: DexTypo.head6
+ opacity: .8
+ }
+ RowLayout {
+ width: main_order.width - 30
+ height: 35
+ anchors.horizontalCenter: parent.horizontalCenter
+ spacing: 0
+ DefaultSweetComboBox {
+ id: combo_base
+ Layout.fillWidth: true
+ model: Constants.API.app.portfolio_pg.global_cfg_mdl.all_proxy
+ onCurrentTickerChanged: applyTickerFilter()
+ height: 60
+ valueRole: "ticker"
+ textRole: 'ticker'
+ }
+
+ }
+ RowLayout {
+ width: main_order.width - 30
+ height: 35
+ anchors.horizontalCenter: parent.horizontalCenter
+ spacing: 5
+ DefaultSweetComboBox {
+ id: combo_rel
+ Layout.fillWidth: true
+ model: Constants.API.app.portfolio_pg.global_cfg_mdl.all_proxy//combo_base.model
+ onCurrentTickerChanged: applyTickerFilter()
+ height: 60
+ valueRole: "ticker"
+ textRole: 'ticker'
+
+ }
+
+ }
+ spacing: 10
+ RowLayout {
+ width: main_order.width - 40
+ height: 50
+ anchors.horizontalCenter: parent.horizontalCenter
+ spacing: 5
+ Qaterial.TextFieldDatePicker {
+ id: min_date
+ title: qsTr("From")
+ from: default_min_date
+ to: default_max_date
+ date: default_min_date
+ onAccepted: applyDateFilter()
+ Layout.fillWidth: true
+ Layout.fillHeight: true
+ opacity: .8
+ color: DexTheme.foregroundColor
+ backgroundColor: DexTheme.portfolioPieGradient ? '#FFFFFF' : 'transparent'
+ }
+
+ Qaterial.TextFieldDatePicker {
+ id: max_date
+ enabled: min_date.enabled
+ title: qsTr("To")
+ from: min_date.date
+ to: default_max_date
+ date: default_max_date
+ onAccepted: applyDateFilter()
+ Layout.fillWidth: true
+ Layout.fillHeight: true
+ rightInset: 0
+ opacity: .8
+ color: DexTheme.foregroundColor
+ backgroundColor: DexTheme.portfolioPieGradient ? '#FFFFFF' : 'transparent'
+ }
+
+ }
+ }
+
+ Item {
+ anchors.bottom: parent.bottom
+ width: parent.width - 40
+ anchors.horizontalCenter: parent.horizontalCenter
+ height: 60
+ RowLayout {
+ anchors.fill: parent
+ spacing: 15
+ DexAppButton {
+ Layout.fillWidth: true
+ radius: 10
+ Layout.alignment: Qt.AlignVCenter
+ text: qsTr("Cancel")
+ onClicked: {
+ _subHistoryRoot.displayFilter = false
+ }
+ }
+ DexAppOutlineButton {
+ id: applyButton
+ height: 35
+ Layout.fillWidth: true
+ radius: 10
+ Layout.alignment: Qt.AlignVCenter
+ opacity: containsMouse ? .7 : 1
+ text: qsTr("Apply filter")
+ onClicked: {
+ _subHistoryRoot.displayFilter = false
+ _subHistoryRoot.applyFilter()
+ _subHistoryRoot.applyAllFiltering()
+ }
+ }
+ }
+ }
+ }
+
+ }
+ Item
+ {
+ height: 2
+ Layout.fillWidth: true
+ }
+ Item {
+ Layout.fillWidth: true
+ Layout.preferredHeight: 30
+ Item{
+ width: parent.width
+ height: 50
+ y: -20
+ DexComboBox {
+ readonly property int item_count: API.app.orders_mdl.limit_nb_elements
+ readonly property var options: [5, 10, 25, 50, 100, 200]
+ anchors.verticalCenter: parent.verticalCenter
+ height: 35
+ width: 80
+ x: 15
+ model: options
+ currentIndex: options.indexOf(item_count)
+ onCurrentValueChanged: API.app.orders_mdl.limit_nb_elements = currentValue
+ }
+ DexAppButton {
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.right: parent.right
+ text: qsTr("Export")
+ height: 35
+ anchors.rightMargin: 15
+ onClicked: {
+ export_csv_dialog.folder = General.os_file_prefix + API.app.settings_pg.get_export_folder()
+ export_csv_dialog.open()
+ }
+ }
+ }
+
+ }
+ FileDialog {
+ id: export_csv_dialog
+
+ title: qsTr("Please choose the CSV export name and location")
+ fileMode: FileDialog.SaveFile
+
+ defaultSuffix: "csv"
+ nameFilters: [ "CSV files (*.csv)", "All files (*)" ]
+
+ onAccepted: {
+ const path = currentFile.toString()
+
+ // Export
+ console.log("Exporting to CSV: " + path)
+ API.app.exporter_service.export_swaps_history_to_csv(path.replace(General.os_file_prefix, ""))
+
+ // Open the save folder
+ const folder_path = path.substring(0, path.lastIndexOf("/"))
+ Qt.openUrlExternally(folder_path)
+ }
+ onRejected: {
+ console.log("CSV export cancelled")
+ }
+ }
+
+ }
+}
diff --git a/atomic_defi_design/qml/Exchange/Trade/SimpleView/SubOrders.qml b/atomic_defi_design/qml/Exchange/Trade/SimpleView/SubOrders.qml
new file mode 100644
index 0000000000..f414ca3011
--- /dev/null
+++ b/atomic_defi_design/qml/Exchange/Trade/SimpleView/SubOrders.qml
@@ -0,0 +1,298 @@
+//! Qt Imports
+import QtQuick 2.15
+import QtQuick.Layouts 1.15
+import QtQuick.Controls 2.15
+
+//! 3rdParty Imports
+import Qaterial 1.0 as Qaterial
+
+//! Project Imports
+import "../../../Components"
+import "../../../Constants" as Constants //> Style
+import "../Orders" as Orders
+import "Main.js" as Main
+
+import App 1.0
+
+Item
+{
+ id: _subOrdersRoot
+
+ readonly property date default_min_date: new Date("2019-01-01")
+ readonly property date default_max_date: new Date(new Date().setDate(new Date().getDate() + 30))
+ property var list_model_proxy: Constants.API.app.orders_mdl.orders_proxy_mdl
+ property bool displayFilter: false
+
+ anchors.fill: parent
+
+ Component.onDestruction: reset()
+
+ function update()
+ {
+ reset()
+ }
+
+ function reset()
+ {
+ list_model_proxy.is_history = true
+ applyFilter()
+ applyAllFiltering()
+ list_model_proxy.is_history = false
+ }
+
+ function applyTickerFilter() {
+ applyTickerFilter2(combo_base.currentTicker, combo_rel.currentTicker)
+ }
+
+ function applyTickerFilter2(ticker1, ticker2) {
+ list_model_proxy.set_coin_filter(ticker1 + "/" + ticker2)
+ }
+
+ function applyDateFilter() {
+ list_model_proxy.filter_minimum_date = min_date.date
+
+ if(max_date.date < min_date.date)
+ max_date.date = min_date.date
+
+ list_model_proxy.filter_maximum_date = max_date.date
+ }
+
+ function applyFilter() {
+ applyTickerFilter()
+ applyDateFilter()
+ }
+
+ function applyAllFiltering() {
+ list_model_proxy.apply_all_filtering()
+ }
+
+
+
+ ColumnLayout // Orders Content
+ {
+ height: parent.height
+ width: parent.width
+ spacing: 20
+
+ Column // Header
+ {
+ leftPadding: 20
+ topPadding: 20
+
+ DefaultText // Title
+ {
+ text: qsTr("Orders")
+ font: DexTypo.head6
+ opacity: .8
+ }
+
+ DexLabel // Description
+ {
+ width: _subOrdersRoot.width - 40
+ anchors.topMargin: 12
+ font.pixelSize: Constants.Style.textSizeSmall4
+ //text: _filterApplied? "" : qsTr("Finished orders")
+ DexLabel {
+ opacity: .4
+ text: qsTr("Filter") + " %1 / %2 %3 %4 - %5"
+ .arg(combo_base.currentTicker)
+ .arg(combo_rel.currentTicker)
+ .arg(qsTr("Date"))
+ .arg(min_date.date.toLocaleDateString(Locale.ShortFormat, "yyyy.MM.dd"))
+ .arg(max_date.date.toLocaleDateString(Locale.ShortFormat, "yyyy.MM.dd"))
+ }
+ DexAppButton
+ {
+ anchors.right: parent.right
+ anchors.rightMargin: -5
+ anchors.bottom: parent.bottom
+ iconSource: _subOrdersRoot.displayFilter ? Qaterial.Icons.close : Qaterial.Icons.cogBox
+ iconSize: 14
+ backgroundColor: DexTheme.iconButtonColor
+ foregroundColor: DexTheme.iconButtonForegroundColor
+ opacity: containsMouse ? .7 : 1
+ width: 35
+ height: 25
+ ToolTip.delay: 500
+ ToolTip.timeout: 5000
+ ToolTip.visible: containsMouse
+ ToolTip.text: _subOrdersRoot.displayFilter ? qsTr("Close filtering options.") : qsTr("Open filering options.")
+ onClicked: _subOrdersRoot.displayFilter = !_subOrdersRoot.displayFilter
+ }
+ }
+ }
+
+ Item
+ {
+ height: 2
+ Layout.fillWidth: true
+ }
+
+ Item {
+ id: main_order
+ Layout.fillHeight: true
+ Layout.fillWidth: true
+ property bool is_history: false
+ property var list_model_proxy: Constants.API.app.orders_mdl.orders_proxy_mdl
+ Component.onCompleted: list_model_proxy.is_history = false
+
+ List { id: order_list_view }
+
+ DexRectangle {
+ anchors.fill: parent
+ color: DexTheme.portfolioPieGradient ? 'transparent' : DexTheme.dexBoxBackgroundColor
+ opacity: .8
+ visible: _subOrdersRoot.displayFilter
+ border.width: 0
+ }
+
+ DexRectangle {
+ width: parent.width
+ height: _subOrdersRoot.displayFilter ? parent.height : 60
+ visible: height > 100
+ sizeAnimation: true
+ color: DexTheme.portfolioPieGradient ? DexTheme.contentColorTopBold : DexTheme.dexBoxBackgroundColor
+ radius: 0
+ y: -20
+ Column {
+ anchors.horizontalCenter: parent.horizontalCenter
+ leftPadding: 15
+ rightPadding: 15
+ visible: parent.height > 250
+ DexLabel {
+ text: qsTr("Filter settings")
+ topPadding: 10
+ leftPadding: 10
+ font: DexTypo.head6
+ opacity: .8
+ }
+ RowLayout {
+ width: main_order.width - 30
+ height: 35
+ anchors.horizontalCenter: parent.horizontalCenter
+ spacing: 0
+ DefaultSweetComboBox {
+ id: combo_base
+ Layout.fillWidth: true
+ model: Constants.API.app.portfolio_pg.global_cfg_mdl.all_proxy
+ onCurrentTickerChanged: applyTickerFilter()
+ height: 60
+ valueRole: "ticker"
+ textRole: 'ticker'
+ }
+
+ }
+ RowLayout {
+ width: main_order.width - 30
+ height: 35
+ anchors.horizontalCenter: parent.horizontalCenter
+ spacing: 5
+ DefaultSweetComboBox {
+ id: combo_rel
+ Layout.fillWidth: true
+ model: Constants.API.app.portfolio_pg.global_cfg_mdl.all_proxy//combo_base.model
+ onCurrentTickerChanged: applyTickerFilter()
+ height: 60
+ valueRole: "ticker"
+ textRole: 'ticker'
+
+ }
+
+ }
+
+ RowLayout {
+ width: main_order.width - 40
+ height: 50
+ anchors.horizontalCenter: parent.horizontalCenter
+ spacing: 5
+ Qaterial.TextFieldDatePicker {
+ id: min_date
+ title: qsTr("From")
+ from: default_min_date
+ to: default_max_date
+ date: default_min_date
+ onAccepted: applyDateFilter()
+ Layout.fillWidth: true
+ Layout.fillHeight: true
+ opacity: .8
+ color: DexTheme.foregroundColor
+ backgroundColor: DexTheme.portfolioPieGradient ? '#FFFFFF' : 'transparent'
+ }
+
+ Qaterial.TextFieldDatePicker {
+ id: max_date
+ enabled: min_date.enabled
+ title: qsTr("To")
+ from: min_date.date
+ to: default_max_date
+ date: default_max_date
+ onAccepted: applyDateFilter()
+ Layout.fillWidth: true
+ Layout.fillHeight: true
+ rightInset: 0
+ opacity: .8
+ color: DexTheme.foregroundColor
+ backgroundColor: DexTheme.portfolioPieGradient ? '#FFFFFF' : 'transparent'
+ }
+
+ }
+
+ spacing: 10
+
+ }
+
+ Item {
+ anchors.bottom: parent.bottom
+ width: parent.width - 40
+ anchors.horizontalCenter: parent.horizontalCenter
+ height: 60
+ RowLayout {
+ anchors.fill: parent
+ spacing: 15
+ DexAppButton {
+ Layout.fillWidth: true
+ radius: 10
+ Layout.alignment: Qt.AlignVCenter
+ text: qsTr("Cancel")
+ onClicked: {
+ _subOrdersRoot.displayFilter = false
+ }
+ }
+ DexAppOutlineButton {
+ id: applyButton
+ height: 35
+ Layout.fillWidth: true
+ radius: 10
+ Layout.alignment: Qt.AlignVCenter
+ opacity: containsMouse ? .7 : 1
+ text: qsTr("Apply filter")
+ onClicked: {
+ _subOrdersRoot.displayFilter = false
+ _subOrdersRoot.applyFilter()
+ _subOrdersRoot.applyAllFiltering()
+ }
+ }
+ }
+ }
+ }
+ }
+
+ Item
+ {
+ height: 2
+ Layout.fillWidth: true
+ }
+ Item {
+ Layout.fillWidth: true
+ Layout.preferredHeight: 15
+ DexLabel // Title
+ {
+ text: order_list_view.count + " " + qsTr("Orders")
+ anchors.horizontalCenter: parent.horizontalCenter
+ y: -10
+ //anchors.verticalCenterOffset: -4
+ }
+ }
+
+ }
+}
diff --git a/atomic_defi_design/qml/Exchange/Trade/SimpleView/Trade.qml b/atomic_defi_design/qml/Exchange/Trade/SimpleView/Trade.qml
new file mode 100644
index 0000000000..c50703f63d
--- /dev/null
+++ b/atomic_defi_design/qml/Exchange/Trade/SimpleView/Trade.qml
@@ -0,0 +1,1013 @@
+//! Qt Imports
+import QtQuick 2.15
+import QtQuick.Layouts 1.15
+import QtQuick.Controls 2.15
+
+//! 3rdParty Imports
+import Qaterial 1.0 as Qaterial
+
+//! Project Imports
+import AtomicDEX.TradingError 1.0
+import AtomicDEX.SelectedOrderStatus 1.0
+import "../../../Components"
+import "../../../Constants" as Constants
+import "../"
+
+import App 1.0
+
+ClipRRect // Trade Card
+{
+ id: _tradeCard
+
+ property string selectedTicker: !Constants.API.app.portfolio_pg.global_cfg_mdl.get_coin_info(left_ticker).is_testnet &&
+ left_ticker !== "RICK" && left_ticker !== "MORTY" ?
+ left_ticker : ""
+ property var selectedOrder: undefined
+ property bool best: false
+ property bool coinSelection: false
+
+ onSelectedTickerChanged: { selectedOrder = undefined; setPair(true, selectedTicker); _fromValue.field.text = "" }
+ onSelectedOrderChanged:
+ {
+ if (typeof selectedOrder !== 'undefined' && selectedOrder.from_best_order) Constants.API.app.trading_pg.orderbook.select_best_order(selectedOrder.uuid)
+ else if (typeof selectedOrder !== 'undefined') Constants.API.app.trading_pg.preffered_order = selectedOrder
+ else Constants.API.app.trading_pg.reset_order()
+
+ Constants.API.app.trading_pg.determine_fees()
+ }
+ onEnabledChanged: selectedOrder = undefined
+ Component.onDestruction: selectedOrder = undefined
+ Component.onCompleted: _fromValue.field.forceActiveFocus()
+ onBestChanged: if (best) Constants.API.app.trading_pg.orderbook.refresh_best_orders()
+
+ width: bestOrderSimplified.visible ? 600 : coinSelection ? 450 : 380
+ height: col.height + 15
+ radius: 20
+
+ Connections // Catches C++ `trading_page` class signals.
+ {
+ enabled: parent.enabled
+ target: Constants.API.app.trading_pg
+
+ function onSelectedOrderStatusChanged() // When the selected order status has changed.
+ {
+ if (Constants.API.app.trading_pg.selected_order_status == SelectedOrderStatus.OrderNotExistingAnymore)
+ {
+ _orderDisappearModalLoader.open()
+ _confirmSwapModal.close()
+ }
+ }
+
+ function onPreferredOrderChangeFinished() // When selected order has changed
+ {
+ if (typeof selectedOrder === 'undefined')
+ return
+ if (parseFloat(_fromValue.field.text) > Constants.API.app.trading_pg.max_volume)
+ _fromValue.field.text = Constants.API.app.trading_pg.max_volume
+ }
+
+ function onVolumeChanged()
+ {
+ _fromValue.field.text = Constants.API.app.trading_pg.volume
+ }
+ }
+
+ Connections
+ {
+ target: Constants.API.app.trading_pg.orderbook.bids
+
+ function onBetterOrderDetected(newOrder)
+ {
+ // We shoould rename SelectedOrderStatus enum to OrderbookNotification.
+ if (Constants.API.app.trading_pg.selected_order_status == SelectedOrderStatus.BetterPriceAvailable)
+ {
+ // Price changed and we can still afford the volume.
+ if (parseFloat(newOrder.base_max_volume) <= selectedOrder.base_max_volume && parseFloat(newOrder.rel_max_volume) >= Constants.API.app.trading_pg.total_amount)
+ {
+ console.log("Updating forms with better price");
+ Qaterial.SnackbarManager.show(
+ {
+ expandable: true,
+ text: qsTr("Better price found: %1. Updating forms.")
+ .arg(parseFloat(newOrder.price).toFixed(8)),
+ timeout: Qaterial.Constants.Style.snackbar.longDisplayTime
+ })
+ selectedOrder = newOrder
+ }
+ else
+ {
+ console.log("Asking user if he want a better price but lower volume");
+ Qaterial.SnackbarManager.show(
+ {
+ expandable: true,
+ action: "Update",
+ text: qsTr("Better price (%1) found but received quantity (%2) is lower than your current one (%3). Click here to update the selected order.")
+ .arg(parseFloat(newOrder.price).toFixed(8))
+ .arg(parseFloat(newOrder.rel_max_volume).toFixed(8))
+ .arg(Constants.API.app.trading_pg.total_amount),
+ onAccept: function() { selectedOrder = newOrder },
+ onClose: function() { selectedOrder = undefined },
+ maximumLineCount: 2,
+ timeout: 10000
+ })
+ }
+ }
+ }
+ }
+
+ ModalLoader
+ {
+ id: _orderDisappearModalLoader
+ sourceComponent: OrderRemovedModal {}
+ onLoaded: selectedOrder = undefined
+ }
+
+ MouseArea // Swap Card Mouse Area
+ {
+ anchors.fill: parent
+ onPressed: _fromValue.focus = false // When clicking outside `_fromValue` TextField, `fromValue` losts its focus.
+ }
+
+ Column // Swap Card Content
+ {
+ id: col
+
+ width: parent.width
+ spacing: 20
+
+ Column // Header
+ {
+ id: _swapCardHeader
+
+ width: parent.width - 20
+ leftPadding: 20
+ topPadding: 20
+ spacing: 15
+ DexLabel // Title
+ {
+ text: qsTr("Swap")
+ font: DexTypo.head6
+ opacity: .85
+ }
+
+ DefaultText // Description
+ {
+ anchors.topMargin: 12
+ font.pixelSize: Constants.Style.textSizeSmall4
+ text: qsTr("Instant trading with best orders")
+
+ Qaterial.AppBarButton // Reset Form Button
+ {
+ enabled: !coinSelection && !best && typeof selectedOrder !== 'undefined'
+ visible: enabled
+
+ anchors.left: parent.right
+ anchors.leftMargin: 100
+ anchors.bottom: parent.bottom
+ anchors.bottomMargin: -8
+
+ width: 50
+ height: 50
+
+ hoverEnabled: true
+
+ ToolTip.delay: 500
+ ToolTip.timeout: 5000
+ ToolTip.visible: hovered
+ ToolTip.text: qsTr("Reset form.")
+
+ onClicked: selectedOrder = undefined
+
+ Qaterial.ColorIcon
+ {
+ anchors.centerIn: parent
+ source: Qaterial.Icons.broom
+ color: DexTheme.foregroundColor
+ opacity: .8
+ }
+ }
+ }
+ }
+
+ Item
+ {
+ width: _tradeCard.width
+ height: .5
+ }
+
+ ColumnLayout // Content
+ {
+ width: parent.width
+
+ anchors.horizontalCenter: parent.horizontalCenter
+
+ DexRectangle // From
+ {
+ id: swap_from_card
+ Layout.preferredWidth: _tradeCard.width - 20
+ Layout.preferredHeight: 90
+ Layout.alignment: Qt.AlignHCenter
+ radius: 20
+ color: DexTheme.tradeFieldBoxBackgroundColor
+ visible: !coinSelectorSimplified.visible
+
+ DefaultText // From Text
+ {
+ id: _fromTitle
+ anchors.top: parent.top
+ anchors.topMargin: 14
+ anchors.left: parent.left
+ anchors.leftMargin: 17
+ text: qsTr("From")
+ font.pixelSize: Constants.Style.textSizeSmall4
+ }
+
+ Text // Tradable Balance
+ {
+ readonly property int _maxWidth: 140
+
+ id: _fromBalance
+ visible: selectedTicker !== ""
+ width: Math.min(_maxWidth, _textMetrics.boundingRect.width + 10)
+ anchors.verticalCenter: _fromTitle.verticalCenter
+ anchors.right: parent.right
+ anchors.rightMargin: 17
+ text: qsTr("%1").arg(Constants.API.app.trading_pg.max_volume)
+ font.pixelSize: Constants.Style.textSizeSmall2
+ elide: Text.ElideRight
+ color: DexTheme.foregroundColorLightColor1
+
+ DexImage
+ {
+ id: _fromBalanceIcon
+ width: 16
+ height: 16
+ anchors.right: parent.left
+ anchors.rightMargin: 8
+ anchors.verticalCenter: parent.verticalCenter
+ source: Constants.General.image_path + "menu-assets-white.svg"
+ opacity: .6
+ }
+
+ MouseArea
+ {
+ anchors.left: _fromBalanceIcon.left
+ anchors.right: _fromBalance.right
+ anchors.top: _fromBalance.top
+ anchors.bottom: _fromBalance.bottom
+ hoverEnabled: true
+ ToolTip
+ {
+ visible: parent.containsMouse
+ text: qsTr("Tradable: ") + parent.parent.text
+ }
+ }
+
+ TextMetrics
+ {
+ id: _textMetrics
+ font: _fromBalance.font
+ text: _fromBalance.text
+ elide: _fromBalance.elide
+ }
+ }
+
+ AmountField // Amount
+ {
+ id: _fromValue
+ enabled: selectedTicker !== ""
+ anchors.bottom: parent.bottom
+ anchors.bottomMargin: 19
+ anchors.left: parent.left
+ anchors.leftMargin: 2
+ field.placeholderText: typeof selectedOrder !== 'undefined' ? qsTr("Minimum: %1").arg(Constants.API.app.trading_pg.min_trade_vol) : qsTr("Enter an amount")
+ field.font.pixelSize: Constants.Style.textSizeSmall5
+ field.background: Rectangle { color: swap_from_card.color }
+ field.onTextChanged:
+ {
+ if (field.text === "")
+ {
+ Constants.API.app.trading_pg.volume = 0
+ field.text = ""
+ }
+ else Constants.API.app.trading_pg.volume = field.text
+ }
+ field.onFocusChanged:
+ {
+ if (!focus && parseFloat(field.text) < parseFloat(Constants.API.app.trading_pg.min_trade_vol))
+ {
+ field.text = Constants.API.app.trading_pg.min_trade_vol
+ }
+ }
+ Component.onCompleted: field.text = ""
+ }
+
+ Text // Amount In Fiat
+ {
+ enabled: _fromValue.field.text
+ anchors.top: _fromValue.bottom
+ anchors.topMargin: -3
+ anchors.left: _fromValue.left
+ anchors.leftMargin: 24
+ font.pixelSize: Constants.Style.textSizeSmall1
+ color: DexTheme.foregroundColor
+ opacity: .9
+ text: enabled ? Constants.General.getFiatText(_fromValue.field.text, selectedTicker) : ""
+ }
+
+ Rectangle // Select ticker button
+ {
+ id: _selectTickerBut
+
+ anchors.bottom: parent.bottom
+ anchors.bottomMargin: 19
+ anchors.right: parent.right
+ anchors.rightMargin: 20
+
+ width: (_selectedTickerIcon.enabled ? _selectedTickerIcon.width : 0) + Math.max(_selectedTickerText.implicitWidth, _selectedTickerTypeText.implicitWidth) + _selectedTickerArrow.width + 29.5
+
+ height: 30
+
+ radius: 10
+ border.width: 0
+ color: _selectedTickerMouseArea.containsMouse ? "#8b95ed" : swap_from_card.color
+
+ DefaultMouseArea
+ {
+ id: _selectedTickerMouseArea
+ anchors.fill: parent
+ onClicked:
+ {
+ _tradeCard.coinSelection = true
+ _tradeCard.best = false
+ }
+ hoverEnabled: true
+ }
+
+ DefaultImage
+ {
+ id: _selectedTickerIcon
+ enabled: selectedTicker !== ""
+ visible: enabled
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.leftMargin: 5
+ anchors.left: parent.left
+ width: 20
+ height: 20
+ source: Constants.General.coinIcon(selectedTicker)
+ }
+
+ DefaultText
+ {
+ id: _selectedTickerText
+
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.verticalCenterOffset: _selectedTickerIcon.enabled ? -5 : 0
+ anchors.left: _selectedTickerIcon.right
+ anchors.leftMargin: _selectedTickerIcon.enabled ? 10 : -10
+
+ width: 60
+
+ text: _selectedTickerIcon.enabled ? atomic_qt_utilities.retrieve_main_ticker(selectedTicker) : qsTr("Pick a coin")
+ font.pixelSize: Constants.Style.textSizeSmall2
+
+ wrapMode: Text.NoWrap
+
+ DefaultText
+ {
+ id: _selectedTickerTypeText
+
+ enabled: _selectedTickerIcon.enabled
+ visible: enabled
+
+ anchors.top: parent.bottom
+
+ text: Constants.API.app.portfolio_pg.global_cfg_mdl.get_coin_info(selectedTicker).type
+ font.pixelSize: 9
+ }
+ }
+
+ Arrow
+ {
+ id: _selectedTickerArrow
+
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.right: parent.right
+ anchors.rightMargin: 5
+ color: DexTheme.foregroundColor
+
+ up: false
+ }
+
+ ModalLoader
+ {
+ property string selectedTicker
+ onSelectedTickerChanged: _tradeCard.selectedTicker = selectedTicker
+ id: coinsListModalLoader
+ sourceComponent: CoinsListModal {}
+ }
+
+ Connections
+ {
+ target: coinsListModalLoader
+ function onLoaded() { coinsListModalLoader.item.selectedTickerChanged.connect(function() { _tradeCard.selectedTicker = coinsListModalLoader.item.selectedTicker }) }
+ }
+ }
+
+ DexRectangle // MAX Button
+ {
+ anchors.right: _selectTickerBut.left
+ anchors.rightMargin: 5
+ anchors.verticalCenter: _selectTickerBut.verticalCenter
+
+ visible: selectedTicker !== ""
+
+ width: 40
+ height: 20
+
+ border.width: 0
+
+ DefaultMouseArea
+ {
+ id: _maxButMouseArea
+ anchors.fill: parent
+ hoverEnabled: true
+ onClicked: _fromValue.field.text = Constants.API.app.trading_pg.max_volume
+ }
+
+ DexLabel
+ {
+ anchors.centerIn: parent
+ color: _maxButMouseArea.containsMouse ?
+ _maxButMouseArea.pressed ? "#173948" : "#204c61"
+ : DexTheme.accentColor
+ text: qsTr("MAX")
+ }
+ }
+ }
+
+ DexRectangle // To
+ {
+ Layout.preferredWidth: _tradeCard.width - 20
+ Layout.preferredHeight: 90
+ Layout.alignment: Qt.AlignHCenter
+ Layout.topMargin: 15
+ radius: 20
+ color: DexTheme.tradeFieldBoxBackgroundColor
+ visible: !bestOrderSimplified.visible && !coinSelectorSimplified.visible
+
+ DefaultText
+ {
+ anchors.fill: parent
+ anchors.leftMargin: 17
+ anchors.topMargin: 14
+ text: qsTr("To")
+ font.pixelSize: Constants.Style.textSizeSmall4
+ }
+
+ AmountField // Amount
+ {
+ id: _toValue
+ enabled: false
+ anchors.bottom: parent.bottom
+ anchors.bottomMargin: 19
+ anchors.left: parent.left
+ anchors.leftMargin: 2
+ field.text: Constants.API.app.trading_pg.total_amount
+ field.font.pixelSize: Constants.Style.textSizeSmall5
+ field.color: DexTheme.textPlaceHolderColor
+ field.background: Rectangle { color: swap_from_card.color}
+ }
+
+ Text // Amount In Fiat
+ {
+ enabled: parseFloat(_toValue.field.text) > 0
+ anchors.top: _toValue.bottom
+ anchors.topMargin: -3
+ anchors.left: _toValue.left
+ anchors.leftMargin: 24
+ font.pixelSize: Constants.Style.textSizeSmall1
+ color: DexTheme.foregroundColor
+ opacity: .9
+ text: enabled ? Constants.General.getFiatText(_toValue.field.text, _tradeCard.selectedOrder.coin?? "") : ""
+ }
+
+ Rectangle // Shows best order coin
+ {
+ id: _selectBestOrderButton
+
+ anchors.bottom: parent.bottom
+ anchors.bottomMargin: 19
+ anchors.right: parent.right
+ anchors.rightMargin: 20
+
+ height: 30
+ width: _bestOrderIcon.enabled ?
+ _bestOrderIcon.width + Math.max(_bestOrderTickerText.implicitWidth, _bestOrderTickerTypeText.implicitWidth) + _bestOrderArrow.width + 29.5 :
+ _bestOrderNoTickerText.implicitWidth + 30
+
+ radius: 10
+ border.width: 0
+
+ color: _bestOrdersMouseArea.containsMouse ? "#8b95ed" : swap_from_card.color
+ opacity: _bestOrdersMouseArea.enabled ? 1 : 0.3
+
+ DefaultMouseArea
+ {
+ id: _bestOrdersMouseArea
+
+ anchors.fill: parent
+
+ enabled: parseFloat(_fromValue.field.text) > 0
+
+ hoverEnabled: true
+
+ onClicked: _tradeCard.best = true
+ }
+
+ // When no order is currently selected.
+ DefaultText
+ {
+ id: _bestOrderNoTickerText
+
+ enabled: !_bestOrderIcon.enabled
+ visible: enabled
+
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.leftMargin: 5
+ anchors.left: parent.left
+
+ text: qsTr("Pick an order")
+ font.pixelSize: Constants.Style.textSizeSmall2
+ }
+
+ // Token Icon (When a best order is currently selected)
+ DefaultImage
+ {
+ id: _bestOrderIcon
+
+ enabled: typeof selectedOrder !== 'undefined'
+ visible: enabled
+
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.leftMargin: 5
+ anchors.left: parent.left
+
+ width: 20
+ height: 20
+
+ source: enabled ? Constants.General.coinIcon(selectedOrder.coin) : ""
+ }
+
+ // Ticker (When a best order is currently selected)
+ DefaultText
+ {
+ id: _bestOrderTickerText
+
+ enabled: _bestOrderIcon.enabled
+ visible: _bestOrderIcon.visible
+
+ anchors.verticalCenter: _bestOrderIcon.verticalCenter
+ anchors.verticalCenterOffset: -5
+ anchors.left: _bestOrderIcon.right
+ anchors.leftMargin: 10
+
+ width: 60
+
+ text: enabled ? atomic_qt_utilities.retrieve_main_ticker(selectedOrder.coin) : ""
+ font.pixelSize: Constants.Style.textSizeSmall2
+
+ wrapMode: Text.NoWrap
+
+
+ DefaultText
+ {
+ id: _bestOrderTickerTypeText
+
+ anchors.top: parent.bottom
+
+ text: enabled ? Constants.API.app.portfolio_pg.global_cfg_mdl.get_coin_info(selectedOrder.coin).type : ""
+ font.pixelSize: 9
+ }
+ }
+
+ Arrow
+ {
+ id: _bestOrderArrow
+
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.right: parent.right
+ anchors.rightMargin: 5
+
+ color: DexTheme.foregroundColor
+
+ up: false
+ }
+
+ ModalLoader
+ {
+ id: _bestOrdersModalLoader
+ sourceComponent: BestOrdersModal {}
+ }
+ }
+ }
+
+ RowLayout // Unit Price
+ {
+ id: _unitPrice
+
+ // LAYOUT
+ Layout.topMargin: 10
+ Layout.alignment: Qt.AlignHCenter
+ Layout.fillWidth: true
+
+ enabled: typeof selectedOrder !== 'undefined'
+ visible: enabled && !bestOrderSimplified.visible && !coinSelectorSimplified.visible
+
+ DefaultText
+ {
+ Layout.rightMargin: 120
+ font.pixelSize: Constants.Style.textSizeSmall3
+ text: qsTr("Price")
+ }
+ DefaultText
+ {
+ Layout.alignment: Qt.AlignRight
+ font.pixelSize: Constants.Style.textSizeSmall3
+ text: selectedOrder ? "1 %1 = %2 %3"
+ .arg(atomic_qt_utilities.retrieve_main_ticker(selectedTicker))
+ .arg(parseFloat(Constants.API.app.trading_pg.price).toFixed(8))
+ .arg(atomic_qt_utilities.retrieve_main_ticker(selectedOrder.coin))
+ : ""
+ }
+ }
+
+ Item
+ {
+ Layout.topMargin: 10
+ Layout.alignment: Qt.AlignHCenter
+ Layout.preferredWidth: _tradeCard.width - 30
+ Layout.preferredHeight: 50
+ visible: !bestOrderSimplified.visible && !coinSelectorSimplified.visible
+
+ DexGradientAppButton
+ {
+ enabled: !Constants.API.app.trading_pg.preimage_rpc_busy && !_swapAlert.visible
+ opacity: enabled ? 1 : .6
+ radius: 10
+ anchors.fill: parent
+ text: qsTr("Swap Now")
+ onClicked: _confirmSwapModal.open()
+
+ ModalLoader
+ {
+ id: _confirmSwapModal
+ sourceComponent: ConfirmTradeModal {}
+ }
+
+ Connections
+ {
+ target: exchange_trade
+ function onBuy_sell_rpc_busyChanged()
+ {
+ if (buy_sell_rpc_busy)
+ return
+
+ const response = Constants.General.clone(buy_sell_last_rpc_data)
+
+ if (response.error_code)
+ {
+ _confirmSwapModal.close()
+
+ toast.show(qsTr("Failed to place the order"),
+ Constants.General.time_toast_important_error,
+ response.error_message)
+
+ selectedOrder = undefined
+ return
+ }
+ else if (response.result && response.result.uuid)
+ {
+ selectedOrder = undefined
+ _fromValue.field.text = "0"
+
+ // Make sure there is information
+ _confirmSwapModal.close()
+
+ toast.show(qsTr("Placed the order"), Constants.General.time_toast_basic_info,
+ Constants.General.prettifyJSON(response.result), false)
+
+ Constants.General.prevent_coin_disabling.restart()
+ }
+ }
+ }
+ }
+
+ Image // Alert
+ {
+ id: _swapAlert
+
+ function getAlert()
+ {
+ var left_ticker = Constants.API.app.trading_pg.market_pairs_mdl.left_selected_coin
+ var right_ticker = Constants.API.app.trading_pg.market_pairs_mdl.right_selected_coin
+ if (_fromValue.field.text === "" || parseFloat(_fromValue.field.text) === 0)
+ return qsTr("Entered amount must be superior than 0.")
+ if (typeof selectedOrder === 'undefined')
+ return qsTr("You must select an order.")
+ if (Constants.API.app.trading_pg.last_trading_error == TradingError.VolumeIsLowerThanTheMinimum)
+ return qsTr("Entered amount is below the minimum required by this order: %1").arg(selectedOrder.base_min_volume)
+ if (Constants.API.app.trading_pg.last_trading_error == TradingError.LeftParentChainNotEnabled)
+ return qsTr("%1 needs to be enabled in order to use %2").arg(Constants.API.app.portfolio_pg.global_cfg_mdl.get_parent_coin(left_ticker)).arg(left_ticker)
+ if (Constants.API.app.trading_pg.last_trading_error == TradingError.LeftParentChainNotEnoughBalance)
+ return qsTr("%1 balance needs to be funded, a non-zero balance is required to pay the gas of %2 transactions").arg(Constants.API.app.portfolio_pg.global_cfg_mdl.get_parent_coin(left_ticker)).arg(left_ticker)
+ if (Constants.API.app.trading_pg.last_trading_error == TradingError.RightParentChainNotEnabled)
+ return qsTr("%1 needs to be enabled in order to use %2").arg(Constants.API.app.portfolio_pg.global_cfg_mdl.get_parent_coin(right_ticker)).arg(right_ticker)
+ if (Constants.API.app.trading_pg.last_trading_error == TradingError.RightParentChainNotEnoughBalance)
+ return qsTr("%1 balance needs to be funded, a non-zero balance is required to pay the gas of %2 transactions").arg(Constants.API.app.portfolio_pg.global_cfg_mdl.get_parent_coin(right_ticker)).arg(right_ticker)
+
+ return ""
+ }
+
+ anchors.left: parent.left
+ anchors.leftMargin: 10
+ anchors.verticalCenter: parent.verticalCenter
+
+ visible: ToolTip.text !== ""
+
+ source: Qaterial.Icons.alert
+
+ ToolTip.visible: _alertMouseArea.containsMouse
+ ToolTip.text: getAlert()
+
+ DefaultColorOverlay
+ {
+ anchors.fill: parent
+ source: parent
+ color: "yellow"
+ }
+ MouseArea
+ {
+ id: _alertMouseArea
+ anchors.fill: parent
+ hoverEnabled: true
+ }
+ }
+ }
+ }
+ Item
+ {
+ id: coinSelectorSimplified
+ width: parent.width
+ height: 300
+ visible: _tradeCard.coinSelection
+ Item
+ {
+ width: parent.width
+ height: 50
+ Qaterial.ColorIcon
+ {
+ anchors.verticalCenter: parent.verticalCenter
+ source: Qaterial.Icons.magnify
+ color: DexTheme.foregroundColor
+ x: 25
+ opacity: .7
+ }
+ DexTextField
+ {
+ id: _coinSearchField
+ width: parent.width-70
+ height: parent.height
+ font.pixelSize: 16
+ x: 45
+ placeholderText: qsTr("Search")
+ background: DexRectangle
+ {
+ border.width: 0
+ color: 'transparent'
+ }
+ onTextChanged:
+ {
+ _coinList.model.setFilterFixedString(text)
+ }
+ }
+ }
+ Connections {
+ target: _tradeCard
+ function onCoinSelectionChanged() {
+ _coinSearchField.text = ""
+ }
+ }
+
+ SubCoinSelector
+ {
+ id: _coinList
+
+ onTickerSelected:
+ {
+ _tradeCard.selectedTicker = ticker
+ _tradeCard.coinSelection = false
+ _fromValue.field.forceActiveFocus()
+ }
+
+ anchors.fill: parent
+ anchors.rightMargin: 10
+ anchors.leftMargin: 20
+ anchors.bottomMargin: 10
+ anchors.topMargin: 50
+ }
+
+ }
+ Item
+ {
+ id: bestOrderSimplified
+ width: parent.width
+ height: 300
+ visible: _tradeCard.best
+ Item
+ {
+ width: parent.width
+ height: 50
+ Qaterial.ColorIcon
+ {
+ anchors.verticalCenter: parent.verticalCenter
+ source: Qaterial.Icons.magnify
+ x: 25
+ opacity: .7
+ }
+ DexTextField
+ {
+ id: _bestOrderSearchField
+ width: parent.width-70
+ height: parent.height
+ font.pixelSize: 16
+ x: 45
+ placeholderText: qsTr("Search")
+ background: DexRectangle
+ {
+ border.width: 0
+ color: 'transparent'
+ }
+ onTextChanged:
+ {
+ Constants.API.app.trading_pg.orderbook.best_orders.proxy_mdl.setFilterFixedString(text)
+ }
+ }
+ }
+ Connections {
+ target: _tradeCard
+ function onBestChanged() {
+ _bestOrderSearchField.text = ""
+ }
+ }
+ SubBestOrder
+ {
+ id: _bestOrderList
+ tradeCard: _tradeCard
+ onSelectedOrderChanged:
+ {
+ _tradeCard.selectedOrder = selectedOrder
+ _bestOrderSearchField.text = ""
+ _fromValue.field.forceActiveFocus()
+ }
+ onBestChanged:
+ {
+ if(!best)
+ {
+ _tradeCard.best = false
+ }
+ }
+ anchors.fill: parent
+ anchors.rightMargin: 10
+ anchors.leftMargin: 20
+ anchors.bottomMargin: 10
+ anchors.topMargin: 50
+ visible: _tradeCard.width == 600
+ }
+ BusyIndicator
+ {
+ id: bestOrdersLoading
+ width: 200
+ height: 200
+ visible: Constants.API.app.trading_pg.orderbook.best_orders_busy
+ running: visible
+ anchors.centerIn: parent
+ }
+
+ DexLabel
+ {
+ visible: _bestOrderList.count === 0 && !bestOrdersLoading.visible
+
+ anchors.centerIn: parent
+ text: qsTr("No buy orders found for %1.").arg(selectedTicker)
+ font.pixelSize: Style.textSize2
+
+ DexLabel
+ {
+ anchors.top: parent.bottom
+ anchors.horizontalCenter: parent.horizontalCenter
+ text: qsTr("You can check later or try to sell a different coin.")
+ }
+ }
+ }
+
+ Item // Swap Info - Details
+ {
+ id: _feesCard
+ anchors.horizontalCenter: parent.horizontalCenter
+ width: 350
+ height: 60
+
+ enabled: !_swapAlert.visible
+ visible: _feesList.count !== 0 & _tradeCard.selectedOrder !== undefined & parseFloat(_fromValue.field.text) > 0 & !bestOrderSimplified.visible & !coinSelectorSimplified.visible
+
+ DexRectangle {
+ radius: 25
+ anchors.fill: parent
+ }
+
+ DefaultBusyIndicator
+ {
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.horizontalCenter: parent.horizontalCenter
+ visible: Constants.API.app.trading_pg.preimage_rpc_busy
+ }
+
+ DefaultListView
+ {
+ id: _feesList
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.horizontalCenter: parent.horizontalCenter
+
+ visible: !Constants.API.app.trading_pg.preimage_rpc_busy
+ enabled: parent.enabled
+ model: Constants.API.app.trading_pg.fees.total_fees
+ delegate: RowLayout
+ {
+ width: _feesCard.width
+ Component.onCompleted: _feesCard.height += 20
+ Component.onDestruction: _feesCard.height -= 20
+
+ DefaultText
+ {
+ Layout.alignment: Qt.AlignLeft
+ Layout.leftMargin: 10
+ text: qsTr("Total %1 fees: ").arg(modelData.coin)
+ font.pixelSize: Constants.Style.textSizeSmall3
+ }
+ DefaultText
+ {
+ Layout.alignment: Qt.AlignRight
+ Layout.rightMargin: 10
+ text: qsTr("%2 (%3)")
+ .arg(parseFloat(modelData.required_balance).toFixed(8) / 1)
+ .arg(Constants.General.getFiatText(modelData.required_balance, modelData.coin, false))
+ font.pixelSize: Constants.Style.textSizeSmall3
+ }
+ }
+ }
+ }
+ }
+ Row
+ {
+ anchors.rightMargin: 15
+ anchors.right: parent.right
+ height: 50
+ spacing: 5
+ y: 12
+ DexAppButton
+ {
+ visible: _tradeCard.best
+ iconSource: Qaterial.Icons.refresh
+ iconSize: 14
+ backgroundColor: DexTheme.iconButtonColor
+ foregroundColor: DexTheme.iconButtonForegroundColor
+ opacity: enabled ? containsMouse ? .7 : 1 : .4
+ anchors.verticalCenter: parent.verticalCenter
+ enabled: !Constants.API.app.trading_pg.orderbook.best_orders_busy
+ width: 35
+ height: 25
+ onClicked:
+ {
+ Constants.API.app.trading_pg.orderbook.refresh_best_orders()
+ }
+ }
+ DexAppButton
+ {
+ visible: _tradeCard.best || _tradeCard.coinSelection
+ iconSource: Qaterial.Icons.close
+ iconSize: 14
+ backgroundColor: DexTheme.iconButtonColor
+ foregroundColor: DexTheme.iconButtonForegroundColor
+ opacity: containsMouse ? .9 : 1
+ anchors.verticalCenter: parent.verticalCenter
+ width: 35
+ height: 25
+ onClicked:
+ {
+ _tradeCard.best = false
+ _tradeCard.coinSelection = false
+ }
+ }
+ }
+}
diff --git a/atomic_defi_design/qml/Exchange/Trade/SweetDexComboBox.qml b/atomic_defi_design/qml/Exchange/Trade/SweetDexComboBox.qml
index f4e2bd75d0..3f2d8e9d2a 100644
--- a/atomic_defi_design/qml/Exchange/Trade/SweetDexComboBox.qml
+++ b/atomic_defi_design/qml/Exchange/Trade/SweetDexComboBox.qml
@@ -7,9 +7,9 @@ import QtQuick.Controls.impl 2.15
import QtQuick.Controls.Universal 2.15
import "../../Components"
-import "../../Constants"
+import App 1.0
-DefaultComboBox {
+DexComboBox {
id: control
mainBorderColor: Style.getCoinColor(ticker)
@@ -89,7 +89,7 @@ DefaultComboBox {
anchors.fill: parent
anchors.rightMargin: 2
border.color: "transparent"
- color: theme.backgroundColor
+ color: DexTheme.backgroundColor
}
}
@@ -164,7 +164,7 @@ DefaultComboBox {
width: parent.width
y: -5
height: parent.height+10
- color: theme.dexBoxBackgroundColor
+ color: DexTheme.portfolioPieGradient ? DexTheme.contentColorTopBold : DexTheme.dexBoxBackgroundColor
border.width: 1
border.color: control.mainBorderColor
//radius: Style.rectangleCornerRadius
diff --git a/atomic_defi_design/qml/Exchange/Trade/Trade.qml b/atomic_defi_design/qml/Exchange/Trade/Trade.qml
index 8bdb8de2f0..4a9b576128 100644
--- a/atomic_defi_design/qml/Exchange/Trade/Trade.qml
+++ b/atomic_defi_design/qml/Exchange/Trade/Trade.qml
@@ -2,38 +2,28 @@ import QtQuick 2.15
import QtQuick.Layouts 1.15
import QtQuick.Controls 2.15
import QtQuick.Controls.Material 2.15
-
+import Qt.labs.settings 1.0
import QtGraphicalEffects 1.0
import Qaterial 1.0 as Qaterial
-import Qt.labs.settings 1.0
import AtomicDEX.MarketMode 1.0
import AtomicDEX.TradingError 1.0
+import AtomicDEX.TradingMode 1.0
import "../../Components"
-import "../../Constants"
import "../../Wallet"
-// Trade Form / Component import
-import "TradeBox/"
import "Trading/"
-import "Trading/Items/"
-
-// OrderBook / Component import
-import "OrderBook/" as OrderBook
-
-// Best Order
-import "BestOrder/" as BestOrder
-// Orders (orders, history)
-import "Orders/" as OrdersView
+import "SimpleView" as SimpleView
-import "./" as Here
+import App 1.0
Item {
id: exchange_trade
readonly property string total_amount: API.app.trading_pg.total_amount
+ property bool orderSelected: false
//property var form_base: sell_mode? form_base.formBase : buyBox.formBase
Component.onCompleted: {
API.app.trading_pg.on_gui_enter_dex()
@@ -48,7 +38,8 @@ Item {
Component.onDestruction: {
API.app.trading_pg.on_gui_leave_dex()
}
- property bool isUltraLarge: width > 1400
+ property bool isUltraLarge: true // width > 1400
+ property bool isBigScreen: width > 1400
onIsUltraLargeChanged: {
if (isUltraLarge) {
API.app.trading_pg.orderbook.asks.proxy_mdl.qml_sort(
@@ -158,19 +149,22 @@ Item {
API.app.trading_pg.place_sell_order(nota, confs)
else
API.app.trading_pg.place_buy_order(nota, confs)
+
+ orderPlaced()
}
+ signal orderPlaced()
+
readonly property bool buy_sell_rpc_busy: API.app.trading_pg.buy_sell_rpc_busy
readonly property var buy_sell_last_rpc_data: API.app.trading_pg.buy_sell_last_rpc_data
-
-
- // Form
- ProView {
- id: form
+ Loader
+ {
+ id: _viewLoader
+ anchors.fill: parent
+ source: API.app.trading_pg.current_trading_mode == TradingMode.Pro ? "ProView.qml" : "SimpleView/Main.qml"
}
TradeViewHeader {
- y: window.isOsx? -5 : -45
}
}
diff --git a/atomic_defi_design/qml/Exchange/Trade/TradeBox/BuyBox.qml b/atomic_defi_design/qml/Exchange/Trade/TradeBox/BuyBox.qml
index e1554cf438..d0049c04d9 100644
--- a/atomic_defi_design/qml/Exchange/Trade/TradeBox/BuyBox.qml
+++ b/atomic_defi_design/qml/Exchange/Trade/TradeBox/BuyBox.qml
@@ -6,23 +6,24 @@ import Qt.labs.settings 1.0
import AtomicDEX.MarketMode 1.0
import "../../../Components"
-import "../../../Constants"
import "../../../Wallet"
+import App 1.0
+
FloatingBackground {
property alias can_submit_trade: form_base.can_submit_trade
property alias formBase: form_base
- Layout.preferredHeight: !sell_mode? 350 : 45
+ Layout.preferredHeight: !sell_mode ? 350 : 45
Behavior on Layout.preferredHeight {
NumberAnimation {
duration: 200
}
}
Layout.fillWidth: true
- radius: sell_mode? 3 : 4
+ radius: sell_mode ? 3 : 4
border.color: Style.colorGreen
color: Style.colorTheme9
- opacity:mouse_area2.containsMouse? 1 : !sell_mode? 1 : .2
+ opacity: mouse_area2.containsMouse ? 1 : !sell_mode ? 1 : .2
Rectangle {
width: parent.width
height: 45
@@ -30,7 +31,7 @@ FloatingBackground {
radius: 2
DefaultText {
anchors.centerIn: parent
- text: qsTr("Buy")+" "+ atomic_qt_utilities.retrieve_main_ticker(left_ticker)
+ text: qsTr("Buy") + " " + atomic_qt_utilities.retrieve_main_ticker(left_ticker)
color: Style.colorTheme9
font.pixelSize: Style.textSize2
}
@@ -39,8 +40,8 @@ FloatingBackground {
OrderForm {
id: form_base
y: 45
- width: parent.width-25
- height: parent.height-45
+ width: parent.width - 25
+ height: parent.height - 45
clip: true
visible: !sell_mode
border.color: 'transparent'
@@ -56,4 +57,4 @@ FloatingBackground {
hoverEnabled: true
onClicked: setMarketMode(MarketMode.Buy)
}
-}
+}
\ No newline at end of file
diff --git a/atomic_defi_design/qml/Exchange/Trade/TradeBox/OrderForm.qml b/atomic_defi_design/qml/Exchange/Trade/TradeBox/OrderForm.qml
index e6f97903c4..607802c6ca 100644
--- a/atomic_defi_design/qml/Exchange/Trade/TradeBox/OrderForm.qml
+++ b/atomic_defi_design/qml/Exchange/Trade/TradeBox/OrderForm.qml
@@ -7,7 +7,8 @@ import AtomicDEX.MarketMode 1.0
import AtomicDEX.TradingError 1.0
import "../../../Components"
-import "../../../Constants"
+
+import App 1.0
FloatingBackground {
id: root
@@ -19,11 +20,11 @@ FloatingBackground {
readonly property string total_amount: API.app.trading_pg.total_amount
- readonly property bool can_submit_trade: last_trading_error === TradingError.None
+ readonly property bool can_submit_trade: last_trading_error === TradingError.None
// Will move to backend: Minimum Fee
function getMaxBalance() {
- if(General.isFilled(base_ticker))
+ if (General.isFilled(base_ticker))
return API.app.get_balance(base_ticker)
return "0"
@@ -33,22 +34,31 @@ FloatingBackground {
function getMaxVolume() {
// base in this orderbook is always the left side, so when it's buy, we want the right side balance (rel in the backend)
const value = sell_mode ? API.app.trading_pg.orderbook.base_max_taker_vol.decimal :
- API.app.trading_pg.orderbook.rel_max_taker_vol.decimal
+ API.app.trading_pg.orderbook.rel_max_taker_vol.decimal
- if(General.isFilled(value))
+ if (General.isFilled(value))
return value
return getMaxBalance()
}
- function setMinimumAmount(value){
+
+ function setMinimumAmount(value) {
API.app.trading_pg.min_trade_vol = value
}
- function reset() {
- }
+ function reset() {}
//implicitHeight: form_layout.height
+ Connections {
+ target: exchange_trade
+ function onBackend_priceChanged() {
+ input_price.field.text = exchange_trade.backend_price
+ }
+ function onBackend_volumeChanged() {
+ input_volume.field.text = exchange_trade.backend_volume
+ }
+ }
ColumnLayout {
id: form_layout
width: parent.width
@@ -58,21 +68,21 @@ FloatingBackground {
Layout.fillWidth: true
spacing: 15
+ Layout.topMargin: 20
Item {
Layout.fillWidth: true
Layout.bottomMargin: input_volume.field.font.pixelSize
height: input_volume.height
- AmountFieldWithInfo {
+ DexAmountField {
id: input_price
width: parent.width
-
- field.left_text: qsTr("Price")
- field.right_text: atomic_qt_utilities.retrieve_main_ticker(right_ticker)
- field.enabled: !(API.app.trading_pg.preffered_order.price!==undefined)
+ leftText: qsTr("Price")
+ rightText: atomic_qt_utilities.retrieve_main_ticker(right_ticker)
+ field.enabled: !(API.app.trading_pg.preffered_order.price !== undefined)
field.text: backend_price
- field.onTextChanged: setPrice(field.text)
+ field.onTextChanged: setPrice(value)
DefaultTooltip {
visible: handler.containsMouse
@@ -87,8 +97,8 @@ FloatingBackground {
Rectangle {
width: parent.width
height: parent.height
- radius: 30
- color: Style.colorTheme9
+ radius: 4
+ color: DexTheme.contentColorTop
opacity: .8
visible: !parent.field.enabled
MouseArea {
@@ -97,6 +107,7 @@ FloatingBackground {
hoverEnabled: true
}
}
+
}
DefaultText {
@@ -118,16 +129,15 @@ FloatingBackground {
Layout.bottomMargin: input_volume.field.font.pixelSize
height: input_volume.height
- AmountFieldWithInfo {
+ DexAmountField {
id: input_volume
width: parent.width
-
- field.left_text: qsTr("Volume")
- field.right_text: atomic_qt_utilities.retrieve_main_ticker(left_ticker)
+ leftText: qsTr("Volume")
+ rightText: atomic_qt_utilities.retrieve_main_ticker(left_ticker)
field.placeholderText: sell_mode ? qsTr("Amount to sell") : qsTr("Amount to receive")
- field.text: backend_volume
- field.onTextChanged: setVolume(field.text)
+ field.text: API.app.trading_pg.volume
+ field.onTextChanged: setVolume(value)
}
DefaultText {
@@ -142,49 +152,95 @@ FloatingBackground {
}
}
- DefaultRangeSlider {
+ DexRangeSlider {
+ id: _volumeRange
+
+ property real oldSecondValue: 0
+ property real oldFirstValue: 0
+
function getRealValue() {
return first.position * (first.to - first.from)
}
+
function getRealValue2() {
return second.position * (second.to - second.from)
}
- property real oldSecondValue: 0
enabled: input_volume.field.enabled && !(!sell_mode && General.isZero(non_null_price)) && to > 0
- Layout.fillWidth: true
+
+ Layout.preferredWidth: parent.width - 20
+
+ rangeBackgroundColor: Qt.lighter(rangeDistanceColor)
+ rangeDistanceColor: sell_mode ? DexTheme.redColor : DexTheme.greenColor
from: API.app.trading_pg.orderbook.current_min_taker_vol
to: Math.max(0, parseFloat(max_volume))
- //live: false
- rangeBackgroundColor: Style.colorTheme7
- rangeDistanceColor: sell_mode? Style.colorRed : Style.colorGreen
+ first.value: parseFloat(API.app.trading_pg.min_trade_vol)
+
+ firstDisabled: !_useCustomMinTradeAmountCheckbox.checked
+ defaultFirstValue: parseFloat(API.app.trading_pg.min_trade_vol)
+ firstTooltip.text: qsTr("Minimum volume: %1").arg(General.formatDouble(first.value, General.getRecommendedPrecision(second.value)))
second.value: parseFloat(non_null_volume)
- second.onValueChanged: { if(second.pressed) setVolume(General.formatDouble(second.value)) }
- secondTooltip.text: General.formatDouble(second.value, General.getRecommendedPrecision(to))
- second.onPressedChanged: {
- if(second.pressed) {
- oldSecondValue = second.value
- }else {
- if(oldSecondValue!==second.value) {
- API.app.trading_pg.orderbook.refresh_best_orders()
+ secondTooltip.text: qsTr("Volume: %1").arg(General.formatDouble(second.value, General.getRecommendedPrecision(to)))
+
+ first.onValueChanged: if (first.pressed) setMinimumAmount(General.formatDouble(first.value))
+ second.onValueChanged: if (second.pressed) setVolume(General.formatDouble(second.value))
+ second.onPressedChanged: if (second.pressed) oldSecondValue = second.value
+
+ DexLabel {
+ anchors.left: parent.right
+ anchors.leftMargin: 8
+ anchors.verticalCenter: parent.verticalCenter
+
+ text: General.cex_icon
+
+ DefaultMouseArea {
+ anchors.fill: parent
+ hoverEnabled: true
+
+ onClicked: _sliderHelpModal.open()
+
+ DefaultTooltip {
+ visible: parent.containsMouse
+ delay: 500
+
+ contentItem: DefaultText {
+ text_value: qsTr("How it works ?")
+ wrapMode: DefaultText.Wrap
+ width: 300
+ }
}
}
- }
- first.value: parseFloat(API.app.trading_pg.min_trade_vol)
- first.onValueChanged: { if(first.pressed) setMinimumAmount(General.formatDouble(first.value)) }
- firstTooltip.text: General.formatDouble(first.value, General.getRecommendedPrecision(second.value))
+ ModalLoader {
+ id: _sliderHelpModal
+ sourceComponent: HelpModal {
+ title: qsTr("How to use the pro-view slider ?")
+ helpSentence: qsTr("This slider is used to setup the order requirements you need.\nLeft slider: Sets the minimum amount required to process a trade.\nRight slider: Sets the volume you want to trade.")
+ }
+ }
+ }
}
+ DexCheckBox {
+ id: _useCustomMinTradeAmountCheckbox
- // Fees
-
+ Layout.topMargin: 15
+ Layout.alignment: Qt.AlignHCenter
+ Layout.fillWidth: true
+ text: qsTr("Use custom minimum trade amount")
+ font.pixelSize: 13
+ onPressed: {
+ if (!checked) {
+ _volumeRange.oldFirstValue = _volumeRange.defaultFirstValue
+ } else {
+ _volumeRange.defaultFirstValue = API.app.trading_pg.orderbook.current_min_taker_vol
+ _volumeRange.first.value = API.app.trading_pg.orderbook.current_min_taker_vol
+ }
+ }
+ }
}
-
- // Total amount
-
}
-}
+}
\ No newline at end of file
diff --git a/atomic_defi_design/qml/Exchange/Trade/TradeBox/SellBox.qml b/atomic_defi_design/qml/Exchange/Trade/TradeBox/SellBox.qml
index 835ff627df..665bc6c070 100644
--- a/atomic_defi_design/qml/Exchange/Trade/TradeBox/SellBox.qml
+++ b/atomic_defi_design/qml/Exchange/Trade/TradeBox/SellBox.qml
@@ -7,13 +7,14 @@ import Qt.labs.settings 1.0
import AtomicDEX.MarketMode 1.0
import "../../../Components"
-import "../../../Constants"
import "../../../Wallet"
+import App 1.0
+
Item {
property alias can_submit_trade: form_base.can_submit_trade
property alias formBase: form_base
- Layout.preferredHeight: sell_mode? 350 : 45
+ Layout.preferredHeight: sell_mode ? 350 : 45
Behavior on Layout.preferredHeight {
NumberAnimation {
duration: 200
@@ -24,7 +25,7 @@ Item {
//radius: sell_mode? 4 : 3
//border.color: Style.colorRed
//color: Style.colorTheme6
- opacity: mouse_area.containsMouse? 1 : sell_mode? 1 : .35
+ opacity: mouse_area.containsMouse ? 1 : sell_mode ? 1 : .35
Rectangle {
visible: false
@@ -42,7 +43,7 @@ Item {
DefaultText {
anchors.centerIn: parent
anchors.verticalCenterOffset: -2
- text: qsTr("Sell")+" "+ atomic_qt_utilities.retrieve_main_ticker(left_ticker)
+ text: qsTr("Sell") + " " + atomic_qt_utilities.retrieve_main_ticker(left_ticker)
color: Qaterial.Colors.gray200
font.pixelSize: Style.textSize1
}
@@ -50,8 +51,8 @@ Item {
OrderForm {
id: form_base
y: 45
- width: parent.width-25
- height: parent.height-45
+ width: parent.width - 25
+ height: parent.height - 45
//clip: true
visible: sell_mode
border.color: 'transparent'
@@ -72,4 +73,4 @@ Item {
hoverEnabled: true
onClicked: setMarketMode(MarketMode.Sell)
}
-}
+}
\ No newline at end of file
diff --git a/atomic_defi_design/qml/Exchange/Trade/Trading/Items/TotalView.qml b/atomic_defi_design/qml/Exchange/Trade/Trading/Items/TotalView.qml
index 85be16880c..0a1b7dc9c6 100644
--- a/atomic_defi_design/qml/Exchange/Trade/Trading/Items/TotalView.qml
+++ b/atomic_defi_design/qml/Exchange/Trade/Trading/Items/TotalView.qml
@@ -11,7 +11,7 @@ import AtomicDEX.TradingError 1.0
import "../../../../Components"
-import "../../../../Constants"
+import App 1.0
Item {
@@ -19,60 +19,70 @@ Item {
anchors.topMargin: 0
Item {
width: parent.width
- height: 80
+ height: 140
Column {
- width: parent.width-60
- anchors.centerIn: parent
- spacing: 0
+ width: parent.width-15
+ anchors.horizontalCenter: parent.horizontalCenter
+ spacing: 5
+ leftPadding: 10
+ rightPadding: 10
RowLayout {
width: parent.width
+ height: 30
DefaultText {
- color: theme.foregroundColor
- text:"Total "+API.app.settings_pg.current_fiat+" "+General.cex_icon
- font.pixelSize: Style.textSizeSmall5
- Layout.preferredWidth: 120
- font.weight: Font.DemiBold
+ color: DexTheme.foregroundColor
+ text: "TOTAL "+API.app.settings_pg.current_fiat+" "+General.cex_icon
+ font.pixelSize: 14
+ font.weight: Font.Normal
+ opacity: .6
CexInfoTrigger {}
}
Item {
- height: 40
+ height: 30
Layout.fillWidth: true
DefaultText {
anchors.verticalCenter: parent.verticalCenter
+ anchors.rightMargin: 20
anchors.right: parent.right
- anchors.rightMargin: 10
- font.weight: Font.Light
- font.pixelSize: Style.textSizeSmall4
+ font.weight: Font.DemiBold
+ font.pixelSize: 16
+ font.family: 'lato'
+ color: DexTheme.accentColor
text_value: General.getFiatText(total_amount, right_ticker).replace(General.cex_icon,"")
-
}
}
}
- HorizontalLine {
- width: parent.width-50
+
+ Rectangle {
+ color: DexTheme.foregroundColor
+ opacity: .2
+ height: 1.5
+ width:parent.width-20
anchors.horizontalCenter: parent.horizontalCenter
}
-
+
RowLayout {
width: parent.width
- DefaultText {
- color: theme.foregroundColor
- text: "Total "+ atomic_qt_utilities.retrieve_main_ticker(right_ticker)
- font.pixelSize: Style.textSizeSmall5
- Layout.preferredWidth: 120
- font.weight: Font.DemiBold
-
+ height: 30
+ DexLabel {
+ color: DexTheme.foregroundColor
+ text: "TOTAL "+ atomic_qt_utilities.retrieve_main_ticker(right_ticker)
+ font.pixelSize: 14
+ opacity: .6
+ font.weight: Font.Normal
}
Item {
- height: 40
+ height: 30
Layout.fillWidth: true
DefaultText {
- text_value: General.formatCrypto("", total_amount, right_ticker).replace(right_ticker,"")
anchors.verticalCenter: parent.verticalCenter
+ anchors.rightMargin: 20
anchors.right: parent.right
- anchors.rightMargin: 10
- font.weight: Font.Light
- font.pixelSize: Style.textSizeSmall4
+ font.weight: Font.DemiBold
+ font.pixelSize: 16
+ font.family: 'lato'
+ color: DexTheme.accentColor
+ text_value: General.formatCrypto("", total_amount, right_ticker).replace(right_ticker,"")
}
}
}
diff --git a/atomic_defi_design/qml/Exchange/Trade/Trading/TradeViewHeader.qml b/atomic_defi_design/qml/Exchange/Trade/Trading/TradeViewHeader.qml
index 2d9b87ab0b..311bbbc620 100644
--- a/atomic_defi_design/qml/Exchange/Trade/Trading/TradeViewHeader.qml
+++ b/atomic_defi_design/qml/Exchange/Trade/Trading/TradeViewHeader.qml
@@ -14,67 +14,186 @@ import AtomicDEX.TradingMode 1.0
import "../" as OtherPage
import "../../../Components"
-import "../../../Constants"
+
+import App 1.0
Item {
- height: 25
+ height: 40
visible: true
+ width: parent.width-5
+ anchors.horizontalCenterOffset: 5
+ anchors.horizontalCenter: parent.horizontalCenter
+ y: -20
- width: parent.width+10
- Connections {
- target: API.app.trading_pg
- function onTradingModeChanged(){
- console.log(API.app.trading_pg.current_trading_mode)
+ Row {
+ anchors.right: parent.right
+ anchors.verticalCenter: parent.verticalCenter
+ spacing: 5
+ Rectangle {
+ width: _learnRow.implicitWidth+15
+ height: 25
+ radius: height/2
+ visible: false
+ Behavior on color {
+ ColorAnimation {
+ duration: 150
+ }
+ }
+ color: tuto_area.containsMouse? 'transparent' : DexTheme.accentColor
+ Row {
+ id: _learnRow
+ anchors.centerIn: parent
+ spacing: 10
+ Qaterial.ColorIcon {
+ source: Qaterial.Icons.televisionPlay
+ anchors.verticalCenter: parent.verticalCenter
+ iconSize: 15
+ color: tuto_area.containsMouse? DexTheme.accentColor : DexTheme.surfaceColor
+ }
+ DexLabel {
+ anchors.verticalCenter: parent.verticalCenter
+ font.weight: Font.Medium
+ color: tuto_area.containsMouse? DexTheme.accentColor : DexTheme.surfaceColor
+ text: qsTr("How to trade")
+ }
+ }
+ DexMouseArea {
+ id: tuto_area
+ hoverEnabled: true
+ anchors.fill: parent
+ }
+ }
+ Rectangle {
+ width: _faqRow.implicitWidth+15
+ height: 25
+ radius: height/2
+ visible: false
+ Behavior on color {
+ ColorAnimation {
+ duration: 150
+ }
+ }
+ color: faq_area.containsMouse? 'transparent' : DexTheme.accentColor
+ Row {
+ id: _faqRow
+ anchors.centerIn: parent
+ spacing: 10
+ DexLabel {
+ anchors.verticalCenter: parent.verticalCenter
+ font.weight: Font.Medium
+ color: faq_area.containsMouse? DexTheme.accentColor : DexTheme.surfaceColor
+ text: qsTr("FAQ")
+ }
+ }
+ DexMouseArea {
+ id: faq_area
+ hoverEnabled: true
+ anchors.fill: parent
+ }
+ }
+ Rectangle {
+ width: 40
+ height: 25
+ visible: API.app.trading_pg.current_trading_mode == TradingMode.Pro
+ radius: height/2
+ Behavior on color {
+ ColorAnimation {
+ duration: 150
+ }
+ }
+ color: cog_area.containsMouse? 'transparent' : API.app.trading_pg.current_trading_mode == TradingMode.Pro ? _viewLoader.item.dexConfig.visible? 'transparent' : DexTheme.accentColor : DexTheme.accentColor
+ Row {
+ anchors.centerIn: parent
+ spacing: 10
+ Qaterial.ColorIcon {
+ source: Qaterial.Icons.cog
+ anchors.verticalCenter: parent.verticalCenter
+ iconSize: 15
+ color: cog_area.containsMouse? DexTheme.accentColor : API.app.trading_pg.current_trading_mode == TradingMode.Pro ? _viewLoader.item.dexConfig.visible? DexTheme.accentColor : DexTheme.surfaceColor : DexTheme.surfaceColor
+ }
+ }
+ DexMouseArea {
+ id: cog_area
+ hoverEnabled: true
+ anchors.fill: parent
+ onClicked: {
+ if(API.app.trading_pg.current_trading_mode == TradingMode.Pro) {
+ if(_viewLoader.item.dexConfig.visible){
+ _viewLoader.item.dexConfig.close()
+ }else {
+ _viewLoader.item.dexConfig.openAt(mapToItem(Overlay.overlay, width / 2, height), Item.Top)
+ }
+ }
+ }
+ }
}
}
RowLayout {
- width: parent.width-20
anchors.fill: parent
- anchors.rightMargin: 190
- DefaultText {
- leftPadding: 20
- topPadding: 5
- Layout.alignment: Qt.AlignVCenter
- font.family: 'Ubuntu'
- font.pixelSize: 20
- font.weight: Font.Light
- color: theme.foregroundColor
- text: API.app.trading_pg.multi_order_enabled? qsTr("Trading Mode - Multi Ordering") : qsTr("Trading Mode - Single Order")
- }
+ spacing: 5
Item {
+ Layout.preferredWidth: 140
Layout.fillHeight: true
- Layout.fillWidth: true
- Qaterial.LatoTabBar {
- anchors.horizontalCenter: parent.horizontalCenter
+ Rectangle {
+ id: background_rect
+ width: 70
+ height: 30
+ radius: 10
anchors.verticalCenter: parent.verticalCenter
- Qaterial.LatoTabButton {
- text: qsTr("Pro-Mode")
- textColor: theme.foregroundColor
- textSecondaryColor: Qt.darker(theme.foregroundColor,0.8)
- onCheckedChanged: {
- if(checked) {
- API.app.trading_pg.current_trading_mode = TradingMode.Pro
- }
+ color: DexTheme.tabBarBackgroudColor
+ Behavior on x {
+ NumberAnimation {
+ duration: 200
}
-
}
- Qaterial.LatoTabButton {
- text: qsTr("Starter")
- textSecondaryColor: Qt.darker(theme.foregroundColor,0.8)
- textColor: theme.foregroundColor
- ToolTip.text: "(Under Work)"
- onCheckedChanged: {
- if(checked) {
+ x: API.app.trading_pg.current_trading_mode != TradingMode.Pro ? 0 : 70
+ }
+ RowLayout {
+ anchors.fill: parent
+ spacing: 0
+ DexLabel {
+ text: "Simple"
+ Layout.preferredWidth: 70
+ Layout.fillHeight: true
+ verticalAlignment: Text.AlignVCenter
+ horizontalAlignment: Text.AlignHCenter
+ font.bold: true
+ color: DexTheme.foregroundColor
+ DexMouseArea {
+ id: simple_area
+ hoverEnabled: true
+ anchors.fill: parent
+ onClicked: {
+ background_rect.x = 0
API.app.trading_pg.current_trading_mode = TradingMode.Simple
}
}
-
+ }
+ DexLabel {
+ text: "Pro"
+ Layout.preferredWidth: 70
+ Layout.fillHeight: true
+ verticalAlignment: Text.AlignVCenter
+ horizontalAlignment: Text.AlignHCenter
+ font.bold: true
+ color: DexTheme.foregroundColor
+ DexMouseArea {
+ id: pro_area
+ hoverEnabled: true
+ anchors.fill: parent
+ onClicked: {
+ background_rect.x = 70
+ API.app.trading_pg.current_trading_mode = TradingMode.Pro
+ }
+ }
}
}
}
-
-
+ Item {
+ Layout.fillHeight: true
+ Layout.fillWidth: true
+ }
}
}
diff --git a/atomic_defi_design/qml/Portfolio/AmountChart.qml b/atomic_defi_design/qml/Portfolio/AmountChart.qml
index 29e23a4607..6ba676966a 100644
--- a/atomic_defi_design/qml/Portfolio/AmountChart.qml
+++ b/atomic_defi_design/qml/Portfolio/AmountChart.qml
@@ -13,6 +13,7 @@ import AtomicDEX.WalletChartsCategories 1.0
import "../Components"
import "../Constants"
+import App 1.0
// Portfolio
InnerBackground {
@@ -21,18 +22,15 @@ InnerBackground {
function drawChart() {
areaLine.clear()
areaLine3.clear()
- //scatter.clear()
- dateA.min = new Date(API.app.portfolio_pg.charts[0].timestamp*1000)
- dateA.max = new Date(API.app.portfolio_pg.charts[API.app.portfolio_pg.charts.length-1].timestamp*1000)
+ dateA.min = new Date(API.app.portfolio_pg.charts[0].timestamp * 1000)
+ dateA.max = new Date(API.app.portfolio_pg.charts[API.app.portfolio_pg.charts.length - 1].timestamp*1000)
chart_2.update()
- for (let ii =0; ii0){
- if(API.app.portfolio_pg.charts.length===0){
+ if(parseFloat(API.app.portfolio_pg.balance_fiat_all) > 0){
+ if(API.app.portfolio_pg.charts.length === 0){
restart()
}else {
portfolio_asset_chart.isProgress = false
@@ -109,14 +107,14 @@ InnerBackground {
gridVisible: false
lineVisible: false
format: " MMM d"
- labelsColor: theme.foregroundColor
+ labelsColor: DexTheme.foregroundColor
}
axisY: ValueAxis {
lineVisible: false
max: parseFloat(API.app.portfolio_pg.max_total_chart)
min: parseFloat(API.app.portfolio_pg.min_total_chart)
- labelsColor: theme.foregroundColor
- gridLineColor: theme.chartGridLineColor
+ labelsColor: DexTheme.foregroundColor
+ gridLineColor: DexTheme.chartGridLineColor
}
color: Qt.rgba(77,198,255,0.02)
borderColor: 'transparent'
@@ -128,7 +126,7 @@ InnerBackground {
visible: false
max: parseFloat(API.app.portfolio_pg.max_total_chart)
min: parseFloat(API.app.portfolio_pg.min_total_chart)
- color: theme.foregroundColor
+ color: DexTheme.foregroundColor
}
axisX: DateTimeAxis {
id: dateA2
@@ -151,21 +149,21 @@ InnerBackground {
id: verticalLine
height: parent.height-84
opacity: .7
- visible: mouse_area.containsMouse && mouse_area.mouseX>60
+ visible: mouse_area.containsMouse && mouse_area.mouseX > 60
anchors.verticalCenterOffset: -6
anchors.verticalCenter: parent.verticalCenter
width: 3
radius: 4
- border.color: theme.accentColor
- color: theme.foregroundColor
+ border.color: DexTheme.accentColor
+ color: DexTheme.foregroundColor
x: mouse_area.mouseX-80
}
}
LineSeries {
id: areaLine3
- color: theme.accentColor
+ color: DexTheme.accentColor
visible: !isSpline
width: 3.0
axisY: ValueAxis {
@@ -191,23 +189,23 @@ InnerBackground {
width: parent.width+200
height: parent.height
x: -40
- hoverEnabled: true
+ enabled: false
+ hoverEnabled: false
onPositionChanged: {
let mx = mouseX
- //console.log(mx)
let point = Qt.point(mx, mouseY)
let p = chart_2.mapToValue(point, area)
let idx = API.app.portfolio_pg.get_neareast_point(Math.floor(p.x) / 1000);
let pos = areaLine3.at(idx);
let chartPosition = chart_2.mapToPosition(pos, areaLine3)
- if(mx<170) {
+ if(mx < 170) {
boxi.x = mx
}else {
- boxi.x = mx-170
+ boxi.x = mx - 170
}
- boxi.y = chartPosition.y+10
+ boxi.y = chartPosition.y + 10
boxi.value = pos.y
boxi.timestamp = pos.x
}
@@ -219,7 +217,7 @@ InnerBackground {
Rectangle {
anchors.fill: parent
opacity: .6
- color: theme.dexBoxBackgroundColor
+ color: DexTheme.dexBoxBackgroundColor
visible: portfolio_asset_chart.isProgress
radius: parent.radius
DexBusyIndicator {
@@ -235,7 +233,7 @@ InnerBackground {
spacing: 20
scale: .8
FloatingBackground {
- width: rd.width+10
+ width: rd.width + 10
height: 50
Row {
@@ -246,32 +244,32 @@ InnerBackground {
Qaterial.OutlineButton {
text: "YTD"
- foregroundColor: theme.foregroundColor
- outlinedColor: API.app.portfolio_pg.chart_category.valueOf() === 3? theme.accentColor : theme.backgroundColor
+ foregroundColor: DexTheme.foregroundColor
+ outlinedColor: API.app.portfolio_pg.chart_category.valueOf() === 3 ? DexTheme.accentColor : DexTheme.backgroundColor
onClicked: {
API.app.portfolio_pg.chart_category = WalletChartsCategories.Ytd
}
}
Qaterial.OutlineButton {
text: "1M"
- foregroundColor: theme.foregroundColor
- outlinedColor: API.app.portfolio_pg.chart_category.valueOf() === 2? theme.accentColor : theme.backgroundColor
+ foregroundColor: DexTheme.foregroundColor
+ outlinedColor: API.app.portfolio_pg.chart_category.valueOf() === 2 ? DexTheme.accentColor : DexTheme.backgroundColor
onClicked: {
API.app.portfolio_pg.chart_category = WalletChartsCategories.OneMonth
}
}
Qaterial.OutlineButton {
text: "7D"
- foregroundColor: theme.foregroundColor
- outlinedColor: API.app.portfolio_pg.chart_category.valueOf() === 1? theme.accentColor : theme.backgroundColor
+ foregroundColor: DexTheme.foregroundColor
+ outlinedColor: API.app.portfolio_pg.chart_category.valueOf() === 1? DexTheme.accentColor : DexTheme.backgroundColor
onClicked: API.app.portfolio_pg.chart_category = WalletChartsCategories.OneWeek
}
Qaterial.OutlineButton {
text: "24H"
opacity: .4
- foregroundColor: theme.foregroundColor
+ foregroundColor: DexTheme.foregroundColor
enabled: false
- outlinedColor: API.app.portfolio_pg.chart_category.valueOf() === 0? theme.accentColor : theme.backgroundColor
+ outlinedColor: API.app.portfolio_pg.chart_category.valueOf() === 0? DexTheme.accentColor : DexTheme.backgroundColor
onClicked: API.app.portfolio_pg.chart_category = 0
}
}
@@ -306,14 +304,33 @@ InnerBackground {
spacing: 5
DexLabel {
text: "%1 %2".arg( API.app.settings_pg.current_fiat_sign).arg(boxi.value)
- color: theme.accentColor
- font: theme.textType.subtitle2
+ color: DexTheme.accentColor
+ font: DexTypo.subtitle2
}
DexLabel {
text: Qt.formatDate(new Date(boxi.timestamp), "dd MMM yyyy");
- font: theme.textType.body2
+ font: DexTypo.body2
}
}
}
}
+ Rectangle {
+ anchors.fill: parent
+ radius: parent.radius
+ opacity: 0.7
+ color: "black"
+ Column {
+ anchors.centerIn: parent
+ spacing: 20
+ Qaterial.ColorIcon {
+ anchors.horizontalCenter: parent.horizontalCenter
+ source: Qaterial.Icons.rocketLaunchOutline
+ color: DexTheme.accentColor
+ }
+ DexLabel {
+ anchors.horizontalCenter: parent.horizontalCenter
+ text: qsTr("Work in progress")
+ }
+ }
+ }
}
diff --git a/atomic_defi_design/qml/Portfolio/AssetPieChart.qml b/atomic_defi_design/qml/Portfolio/AssetPieChart.qml
index de858a087f..22f01e2f23 100644
--- a/atomic_defi_design/qml/Portfolio/AssetPieChart.qml
+++ b/atomic_defi_design/qml/Portfolio/AssetPieChart.qml
@@ -13,6 +13,7 @@ import AtomicDEX.WalletChartsCategories 1.0
import "../Components"
import "../Constants"
+import App 1.0
// Portfolio
Item {
@@ -27,18 +28,19 @@ Item {
function addItem(value) {
var item = pieSeries.append(value.ticker, value.main_currency_balance)
item.labelColor = 'white'
- item.color = Qt.lighter(Style.getCoinColor(value.ticker))
- item.borderColor = theme.backgroundColor
+ item.color = Style.getCoinColor(value.ticker)
+ item.borderColor = 'transparent'
item.borderWidth = 2
item.holeSize = 1
- item.labelFont = theme.textType.body2
+ item.labelFont = DexTypo.body2
item.hovered.connect(function (state) {
if (state) {
- item.explodeDistanceFactor = 0.01
- portfolio.currentTotal = API.app.settings_pg.current_fiat_sign+" "+ value.main_currency_balance
+ item.explodeDistanceFactor = 0.03
+ portfolio.currentTotal = API.app.settings_pg.current_fiat_sign + " " + value.main_currency_balance
portfolio.currentValue = value.balance + " " + item.label
- item.color = Qt.lighter(Qt.lighter(Style.getCoinColor(value.ticker)))
+ item.color = Qt.lighter(Style.getCoinColor(value.ticker))
} else {
+ item.borderWidth = 2
item.explodeDistanceFactor = 0.01
portfolio.currentValue = ""
portfolio.currentTotal = ""
@@ -53,172 +55,191 @@ Item {
refresh()
}
}
- FloatingBackground {
+ Gradient {
+ id: gd
+ GradientStop {
+ position: .80
+ color: DexTheme.contentColorTop
+ }
+ GradientStop {
+ position: 1
+ color: 'transparent'
+ }
+ }
+ DexRectangle {
+ id: bg
y: 35
height: parent.height
width: parent.width
anchors.centerIn: parent
- ChartView {
- width: 550
- height: 500
- theme: ChartView.ChartView.ChartThemeLight
- antialiasing: true
- legend.visible: false
- smooth: true
- scale: portfolio.isUltraLarge? 1: 0.6
- Behavior on scale {
- NumberAnimation {
- duration: 200
- }
- }
- y: portfolio.isUltraLarge? -55:-150
- backgroundColor: 'transparent'
-
- anchors.horizontalCenter: parent.horizontalCenter
- dropShadowEnabled: true
-
- PieSeries {
- id: pieSeries
- }
- Rectangle {
- anchors.centerIn: parent
- color: theme.backgroundColor
- width: 295
- height: width
- radius: width/2
- //border.color: theme.accentColor
- //border.width: 2
- Column {
- anchors.centerIn: parent
- spacing: 5
- DefaultText {
- anchors.horizontalCenter: parent.horizontalCenter
- text_value: currentTotal !== "" ? currentTotal : General.formatFiat("", API.app.portfolio_pg.balance_fiat_all, API.app.settings_pg.current_currency)
- font: theme.textType.head4
- color: Qt.lighter(
- Style.colorWhite4,
- currency_change_button.containsMouse ? Style.hoverLightMultiplier : 1.0)
- privacy: true
- DexFadebehavior on text {
- fadeDuration: 100
- }
- Component.onCompleted: {
- font.family = 'Lato'
- }
- }
- DefaultText {
- anchors.horizontalCenter: parent.horizontalCenter
- text_value: portfolio.currentValue
- font: theme.textType.body2
- DexFadebehavior on text {
- fadeDuration: 100
- }
- color: Qt.lighter(
- theme.foregroundColor, 0.6)
- privacy: true
- Component.onCompleted: {
- font.family = 'Lato'
- }
- }
- DefaultText {
- id: count_label
- anchors.horizontalCenter: parent.horizontalCenter
- text_value: portfolio_helper.count + " " + qsTr(
- "Assets")
- font: theme.textType.body2
- DexFadebehavior on text {
- fadeDuration: 100
- }
- color: Qt.lighter(
- theme.foregroundColor, 0.8)
- privacy: true
- visible: portfolio.currentValue == ""
+ border.width: 0
+ gradient: DexTheme.portfolioPieGradient ? gd : undefined
+
+ RowLayout {
+ anchors.fill: parent
+ spacing: 0
+ Item {
+ Layout.preferredWidth: (parent.width / 2) - 150
+ Layout.fillHeight: true
+ ChartView {
+ id: _chartView
- Component.onCompleted: {
- font.family = 'Lato'
+ width: 620
+ height: 620
+ theme: ChartView.ChartView.ChartThemeLight
+ antialiasing: true
+ legend.visible: false
+ smooth: true
+ scale: portfolio.isUltraLarge? 1 : 0.7
+ Behavior on scale {
+ NumberAnimation {
+ duration: 200
}
}
- }
- DefaultMouseArea {
- id: currency_change_button
+ y: portfolio.isUltraLarge? -55 : -150
+ backgroundColor: 'transparent'
- width: parent.width - 100
- height: parent.height - 100
anchors.centerIn: parent
+ dropShadowEnabled: true
- hoverEnabled: true
- onClicked: {
- const current_fiat = API.app.settings_pg.current_currency
- const available_fiats = API.app.settings_pg.get_available_currencies()
- const current_index = available_fiats.indexOf(
- current_fiat)
- const next_index = (current_index + 1)
- % available_fiats.length
- const next_fiat = available_fiats[next_index]
- API.app.settings_pg.current_currency = next_fiat
+ PieSeries {
+ id: pieSeries
}
- }
- }
- Rectangle {
- anchors.centerIn: parent
- width: 295
- height: width
- color: 'transparent'
- radius: width/2
- border.width: API.app.portfolio_pg.balance_fiat_all>0 ? 0 : 5
- border.color: Qt.lighter(theme.backgroundColor)
- }
- }
-
+ DexRectangle {
+ anchors.centerIn: parent
+ color: DexTheme.theme === "light" ? DexTheme.contentColorTopBold : bg.color
+ width: 380
+ height: width
+ radius: width / 2
+ Column {
+ anchors.centerIn: parent
+ spacing: 5
+ DexLabel {
+ anchors.horizontalCenter: parent.horizontalCenter
+ text_value: currentTotal !== "" ? currentTotal : General.formatFiat("", API.app.portfolio_pg.balance_fiat_all, API.app.settings_pg.current_currency)
+ font: DexTypo.head4
+ color: currency_change_button.containsMouse ? DexTheme.foregroundColor : DexTheme.foregroundColorDarkColor3
+ privacy: true
+ DexFadebehavior on text {
+ fadeDuration: 100
+ }
+ Component.onCompleted: {
+ font.family = 'Lato'
+ }
+ }
+ DexLabel {
+ anchors.horizontalCenter: parent.horizontalCenter
+ text_value: portfolio.currentValue
+ font: DexTypo.body2
+ DexFadebehavior on text {
+ fadeDuration: 100
+ }
+ color: Qt.lighter(
+ DexTheme.foregroundColor, 0.6)
+ privacy: true
+ Component.onCompleted: {
+ font.family = 'Lato'
+ }
+ }
+ DexLabel {
+ id: count_label
+ anchors.horizontalCenter: parent.horizontalCenter
+ text_value: portfolio_helper.count + " " + qsTr(
+ "Assets")
+ font: DexTypo.body2
+ DexFadebehavior on text {
+ fadeDuration: 100
+ }
+ color: Qt.lighter(
+ DexTheme.foregroundColor, 0.8)
+ privacy: true
+ visible: portfolio.currentValue == ""
+
+ Component.onCompleted: {
+ font.family = 'Lato'
+ }
+ }
+ }
+ DefaultMouseArea {
+ id: currency_change_button
+ width: parent.width - 100
+ height: parent.height - 100
+ anchors.centerIn: parent
- Item {
- scale: portfolio.isUltraLarge? 1: 0.8
- y: portfolio.isUltraLarge? 380 : 170
- Behavior on scale {
- NumberAnimation {
- duration: 200
+ hoverEnabled: true
+ onClicked: {
+ const current_fiat = API.app.settings_pg.current_currency
+ const available_fiats = API.app.settings_pg.get_available_currencies()
+ const current_index = available_fiats.indexOf(
+ current_fiat)
+ const next_index = (current_index + 1)
+ % available_fiats.length
+ const next_fiat = available_fiats[next_index]
+ API.app.settings_pg.current_currency = next_fiat
+ }
+ }
+ }
+ Rectangle {
+ anchors.centerIn: parent
+ width: 295
+ height: width
+ color: 'transparent'
+ radius: width/2
+ border.width: API.app.portfolio_pg.balance_fiat_all > 0 ? 0 : 5
+ border.color: Qt.lighter(DexTheme.contentColorTop)
+ }
}
}
+ Item {
+ Layout.preferredWidth: (parent.width / 2) + 150
+ Layout.fillHeight: true
+ Item {
+ scale: portfolio.isUltraLarge ? 1 : 0.95
+ y: 10
+ Behavior on scale {
+ NumberAnimation {
+ duration: 200
+ }
+ }
+ width: parent.width-100
+ anchors.verticalCenter: parent.verticalCenter
+ height: !portfolio.isUltraLarge? _pieColumn.contentHeight > 300 ? 300 : _pieColumn.contentHeight : _pieColumn.contentHeight > 550 ? 550 :_pieColumn.contentHeight
- width: portfolio.isUltraLarge? parent.width - 50 : parent.width+20
- height: 200
- Qaterial.DebugRectangle {
- anchors.fill: parent
- visible: false
- }
+ anchors.horizontalCenter: parent.horizontalCenter
- anchors.horizontalCenter: parent.horizontalCenter
- Flickable {
- anchors.fill: parent
- contentHeight: colo.height
- clip: true
- Column {
- width: parent.width
- id: colo
- Repeater {
+ DexListView {
+ id: _pieColumn
+ anchors.fill: parent
+ clip: true
model: portfolio_mdl.pie_chart_proxy_mdl
-
- RowLayout {
+ scrollbar_visible: false
+ delegate: RowLayout {
id: rootItem
property color itemColor: Style.getCoinColor(
ticker)
- width: parent.width
+ width: _pieColumn.width
height: 50
spacing: 20
DexLabel {
Layout.preferredWidth: 60
- text: atomic_qt_utilities.retrieve_main_ticker(
- ticker)
+ text: ticker
+ font.bold: true
Layout.alignment: Qt.AlignVCenter
- Component.onCompleted: font.weight = Font.Medium
+ Component.onCompleted: font.weight = Font.Bold
}
- Rectangle {
+
+ Item {
Layout.alignment: Qt.AlignVCenter
Layout.fillWidth: true
- height: 8
- radius: 10
- color: theme.dexBoxBackgroundColor
+ height: 5
+ Rectangle {
+ anchors.fill: parent
+ radius: 10
+ opacity: 0.1
+ color: DexTheme.foregroundColorLightColor5
+
+ }
Rectangle {
height: parent.height
width: (parseFloat(percent_main_currency) * parent.width) / 100
@@ -227,20 +248,26 @@ Item {
}
}
+
+
DexLabel {
- text: percent_main_currency +" %"
- Component.onCompleted: font.family = 'lato'
+
+ text: percent_main_currency + " %"
+
Layout.alignment: Qt.AlignVCenter
+
+ Component.onCompleted: font.family = 'lato'
}
}
}
- }
- }
- Qaterial.DebugRectangle {
- anchors.fill: parent
- visible: false
+ }
}
}
+
+
+
+
+
}
}
diff --git a/atomic_defi_design/qml/Portfolio/PieItem.qml b/atomic_defi_design/qml/Portfolio/PieItem.qml
index aec7c5a8f2..53bb9fe7a6 100644
--- a/atomic_defi_design/qml/Portfolio/PieItem.qml
+++ b/atomic_defi_design/qml/Portfolio/PieItem.qml
@@ -8,11 +8,12 @@ import Qaterial 1.0 as Qaterial
import "../Components"
import "../Constants"
+import App 1.0
PieSlice {
label: "XRP"; value: 10; color: Qaterial.Colors.yellow500;
- borderColor: theme.backgroundColor
- labelColor: 'white'; labelFont: theme.textType.head5
+ borderColor: DexTheme.backgroundColor
+ labelColor: 'white'; labelFont: DexTypo.head5
borderWidth: 3
Behavior on explodeDistanceFactor {
NumberAnimation {
diff --git a/atomic_defi_design/qml/Portfolio/Portfolio.qml b/atomic_defi_design/qml/Portfolio/Portfolio.qml
index 6fd607cabb..25e9ee8eea 100644
--- a/atomic_defi_design/qml/Portfolio/Portfolio.qml
+++ b/atomic_defi_design/qml/Portfolio/Portfolio.qml
@@ -12,7 +12,8 @@ import ModelHelper 0.1
import AtomicDEX.WalletChartsCategories 1.0
import "../Components"
-import "../Constants"
+import "../Constants" as Constants
+import App 1.0
// Portfolio
Item {
@@ -25,17 +26,17 @@ Item {
property bool isSpline: false
function getPercent(fiat_amount) {
const portfolio_balance = parseFloat(
- API.app.portfolio_pg.balance_fiat_all)
+ Constants.API.app.portfolio_pg.balance_fiat_all)
if (fiat_amount <= 0 || portfolio_balance <= 0)
return "-"
- return General.formatPercent(
+ return Constants.General.formatPercent(
(100 * fiat_amount / portfolio_balance).toFixed(2), false)
}
- property string total: General.formatFiat(
- "", API.app.portfolio_pg.balance_fiat_all,
- API.app.settings_pg.current_currency)
+ property string total: Constants.General.formatFiat(
+ "", Constants.API.app.portfolio_pg.balance_fiat_all,
+ Constants.API.app.settings_pg.current_currency)
readonly property int sort_by_name: 0
readonly property int sort_by_value: 1
readonly property int sort_by_change: 3
@@ -137,11 +138,12 @@ Item {
id: willyBG
Layout.fillHeight: true
Layout.fillWidth: true
+ visible: false
}
AssetPieChart {
id: pie
- Layout.preferredWidth: portfolio.isUltraLarge ? 350 : 250
+ Layout.fillWidth: true
Layout.preferredHeight: portfolio.isUltraLarge ? 600 : 350
Layout.alignment: Qt.AlignTop
}
@@ -158,42 +160,55 @@ Item {
anchors.topMargin: 5
RowLayout {
anchors.fill: parent
- Item {
- Layout.fillWidth: true
- Layout.fillHeight: true
- DefaultSwitch {
- anchors.verticalCenter: parent.verticalCenter
- text: qsTr("Show only coins with balance")
- checked: portfolio_coins.with_balance
- onCheckedChanged: portfolio_coins.with_balance = checked
- }
- }
- DexTextField {
- id: input_coin_filter
- implicitHeight: 45
- function reset() {
- if (text === "")
- resetCoinFilter()
- else
- text = ""
- }
+ DexRectangle {
Layout.alignment: Qt.AlignVCenter
Layout.preferredWidth: 250
- height: 60
-
- placeholderText: qsTr("Search")
+ height: 45
+ radius: 16
+ color: DexTheme.contentColorTop
+ DefaultTextField {
+ id: input_coin_filter
+ anchors.fill: parent
+ anchors.margins: 2
+ function reset() {
+ input_coin_filter.text = ""
+ }
+ Qaterial.Icon {
+ icon: Qaterial.Icons.magnify
+ color: input_coin_filter.color
+ anchors.verticalCenter: parent.verticalCenter
+ x: 5
+ }
+ leftPadding: 40
+ placeholderText: qsTr("Search")
- onTextChanged: {
- portfolio_coins.setFilterFixedString(text)
+ font.pixelSize: Constants.Style.textSizeSmall3
+ onTextChanged: portfolio_coins.setFilterFixedString(text)
+ Component.onDestruction: portfolio_coins.setFilterFixedString("")
+ background: null
}
-
- width: 120
+ }
+
+ Item {
+ Layout.fillWidth: true
+ }
+
+ DefaultSwitch {
+ Layout.alignment: Qt.AlignVCenter
+ text: qsTr("Show only coins with balance") + " %1 ".arg(qsTr("(%1/%2)").arg(coinsList.innerList.count).arg(portfolio_mdl.length))
+ checked: portfolio_coins.with_balance
+ onCheckedChanged: portfolio_coins.with_balance = checked
}
}
}
}
- TableDex {}
+
+ TableDex
+ {
+ id: coinsList
+ }
+
Item {
width: 1
height: 10
@@ -209,37 +224,32 @@ Item {
anchors.fill: parent
anchors.leftMargin: 40
anchors.rightMargin: 40
+
Item {
Layout.fillWidth: true
Layout.fillHeight: true
+
DexLabel {
- font: theme.textType.head4
+ font: DexTypo.head6
anchors.verticalCenter: parent.verticalCenter
- text: qsTr("Portfolio")
+ text: qsTr("Dashboard")
}
}
+
Item {
Row {
anchors.verticalCenter: parent.verticalCenter
anchors.right: parent.right
- Qaterial.ExtendedFabButton {
+
+ DexGradientAppButton {
width: 250
- backgroundColor: theme.accentColor
- foregroundColor: theme.foregroundColor
- Row {
- anchors.centerIn: parent
- spacing: 6
- Qaterial.ColorIcon {
- source: Qaterial.Icons.plus
- color: theme.foregroundColor
- anchors.verticalCenter: parent.verticalCenter
- }
- DexLabel {
- text: qsTr("Add asset")
- anchors.verticalCenter: parent.verticalCenter
- }
- }
+ iconSource: Qaterial.Icons.plus
+ radius: 40
+ leftPadding: 5
+ rightPadding: 5
+ padding: 16
+ text: qsTr("Add asset")
onClicked: enable_coin_modal.open()
}
}
diff --git a/atomic_defi_design/qml/Portfolio/SmartChartView.qml b/atomic_defi_design/qml/Portfolio/SmartChartView.qml
index 3895505df5..72c433c438 100644
--- a/atomic_defi_design/qml/Portfolio/SmartChartView.qml
+++ b/atomic_defi_design/qml/Portfolio/SmartChartView.qml
@@ -10,6 +10,7 @@ import Qaterial 1.0 as Qaterial
import "../Components"
import "../Constants"
+import App 1.0
// Portfolio
Item {
@@ -23,7 +24,7 @@ Item {
property bool ticker_supported: false
readonly property bool is_fetching: chart.loadProgress < 100
readonly property string chartTheme: Style.dark_theme ? "dark" : "light"
- property color backgroundColor: theme.chartTradingLineBackgroundColor
+ property color backgroundColor: DexTheme.chartTradingLineBackgroundColor
property var ticker: api_wallet_page.ticker
function loadChart() {
@@ -99,7 +100,7 @@ Item {
}
- `.arg(theme.backgroundColor).arg(theme.chartTradingLineColor).arg(theme.chartTradingLineBackgroundColor))
+ `.arg(DexTheme.backgroundColor).arg(DexTheme.chartTradingLineColor).arg(DexTheme.chartTradingLineBackgroundColor))
}
width: price_graph_bg.width
diff --git a/atomic_defi_design/qml/Portfolio/TableDex.qml b/atomic_defi_design/qml/Portfolio/TableDex.qml
index aa090b6d6d..181510b6f7 100644
--- a/atomic_defi_design/qml/Portfolio/TableDex.qml
+++ b/atomic_defi_design/qml/Portfolio/TableDex.qml
@@ -13,8 +13,11 @@ import AtomicDEX.WalletChartsCategories 1.0
import "../Components"
import "../Constants"
+import App 1.0
Item {
+ property alias innerList: list
+
width: parent.width
height: 150+(list.count*65)
visible: true
@@ -23,10 +26,12 @@ Item {
anchors.margins: 15
anchors.leftMargin: 40
anchors.rightMargin: 40
- Rectangle {
+ DexRectangle {
width: parent.width
height: 60
- color: Qt.darker(theme.backgroundColor, 0.8)
+ //color: Qt.darker(DexTheme.backgroundColor, 0.8)
+ color: 'transparent'
+ border.width: 0
RowLayout {
anchors.fill: parent
Item {
@@ -138,11 +143,11 @@ Item {
scrollbar_visible: false
delegate: AnimatedRectangle {
- color: Qt.lighter(
- mouse_area.containsMouse ? theme.hightlightColor : index % 2 !== 0 ? Qt.darker(theme.backgroundColor, 0.8) : "transparent",
- mouse_area.containsMouse ? Style.hoverLightMultiplier : 1.0)
+ color: mouse_area.containsMouse ? DexTheme.buttonColorHovered : index % 2 === 0 ? DexTheme.hoverColor : 'transparent'
width: list.width
height: 65
+ opacity: mouse_area.containsMouse ? .6 : 1
+ colorAnimation: false
AnimatedRectangle {
id: main_color
color: Style.getCoinColor(ticker)
@@ -203,7 +208,7 @@ Item {
id: coin_name
text_value: name
bottomPadding: 20
- font: theme.textType.body2
+ font: DexTypo.body2
anchors.verticalCenter: parent.verticalCenter
}
DefaultText {
@@ -211,9 +216,22 @@ Item {
anchors.bottom: coin_name.bottom
text: model.type
- font: theme.textType.overLine
+ font: DexTypo.overLine
opacity: .7
color: Style.getCoinTypeColor(model.type)
+
+ DefaultText
+ {
+ enabled: name === "Tokel"
+ visible: enabled
+ anchors.left: parent.right
+ anchors.leftMargin: 5
+
+ text: "IDO"
+ font: DexTypo.overLine
+ opacity: .7
+ color: DexTheme.redColor
+ }
}
}
Item {
@@ -225,13 +243,13 @@ Item {
}
DefaultText {
id: balance_value
- font: theme.textType.body2
+ font: DexTypo.body2
text_value: General.formatCrypto(
"", balance, ticker,
main_currency_balance,
API.app.settings_pg.current_currency)
- color: Qt.darker(theme.foregroundColor, 0.8)
+ color: Qt.darker(DexTheme.foregroundColor, 0.8)
anchors.verticalCenter: parent.verticalCenter
privacy: true
}
@@ -246,14 +264,14 @@ Item {
}
DefaultText {
id: change_24h_value
- font: theme.textType.body2
+ font: DexTypo.body2
text_value: {
const v = parseFloat(change_24h)
return v === 0 ? '-' : General.formatPercent(
v)
}
anchors.horizontalCenter: parent.horizontalCenter
- color: Style.getValueColor(change_24h)
+ color: DexTheme.getValueColor(change_24h)
anchors.verticalCenter: parent.verticalCenter
}
@@ -278,7 +296,7 @@ Item {
function refresh() {
updateChart(chart, historical,
- Style.getValueColor(change_24h))
+ DexTheme.getValueColor(change_24h))
}
property bool dark_theme: Style.dark_theme
@@ -296,13 +314,13 @@ Item {
id: price_value
anchors.right: parent.right
anchors.rightMargin: 10
- font: theme.textType.body2
+ font: DexTypo.body2
text_value: General.formatFiat(
'',
main_currency_price_for_one_unit,
API.app.settings_pg.current_currency)
- color: theme.colorThemeDarkLight
+ color: DexTheme.colorThemeDarkLight
anchors.verticalCenter: parent.verticalCenter
}
DefaultImage {
@@ -327,7 +345,7 @@ Item {
width: parent.width-2
height: parent.height-2
color: 'transparent'
- border.color: theme.foregroundColor
+ border.color: DexTheme.foregroundColor
opacity: .15
radius: 4
}
@@ -335,9 +353,10 @@ Item {
anchors.centerIn: parent
spacing: 10
opacity: .5
- Qaterial.ColorIcon {
+ Qaterial.Icon {
anchors.verticalCenter: parent.verticalCenter
- source: Qaterial.Icons.plusBox
+ icon: Qaterial.Icons.plusBox
+ color: DexTheme.foregroundColor
}
DexLabel {
anchors.verticalCenter: parent.verticalCenter
diff --git a/atomic_defi_design/qml/Screens/Dashboard.qml b/atomic_defi_design/qml/Screens/Dashboard.qml
index 3485e70021..2c2df092b6 100644
--- a/atomic_defi_design/qml/Screens/Dashboard.qml
+++ b/atomic_defi_design/qml/Screens/Dashboard.qml
@@ -5,6 +5,7 @@ import QtQuick.Controls 2.15
import QtGraphicalEffects 1.0
import "../Components"
import "../Constants"
+import App 1.0
import "../Dashboard"
import "../Portfolio"
@@ -14,7 +15,8 @@ import "../Settings"
import "../Support"
import "../Sidebar"
import "../Fiat"
-import "../Settings" as SettingsPage
+import "../Settings"
+as SettingsPage
Item {
@@ -37,22 +39,27 @@ Item {
readonly property int idx_exchange_orders: 1
readonly property int idx_exchange_history: 2
- property var current_ticker
+ property
+ var current_ticker
- property alias notifications_modal: notifications_modal
Layout.fillWidth: true
function openLogsFolder() {
Qt.openUrlExternally(General.os_file_prefix + API.app.settings_pg.get_log_folder())
}
- readonly property var api_wallet_page: API.app.wallet_pg
- readonly property var current_ticker_infos: api_wallet_page.ticker_infos
+ readonly property
+ var api_wallet_page: API.app.wallet_pg
+ readonly property
+ var current_ticker_infos: api_wallet_page.ticker_infos
readonly property bool can_change_ticker: !api_wallet_page.tx_fetching_busy
readonly property alias loader: loader
readonly property alias current_component: loader.item
property int current_page: idx_dashboard_portfolio
+ onCurrent_pageChanged: {
+ app.deepPage = current_page * 10
+ }
readonly property bool is_dex_banned: !API.app.ip_checker.ip_authorized
@@ -61,10 +68,13 @@ Item {
return app.current_page === idx_dashboard
}
- property var notifications_list: ([])
+ property
+ var notifications_list: ([])
- readonly property var portfolio_mdl: API.app.portfolio_pg.portfolio_mdl
- property var portfolio_coins: portfolio_mdl.portfolio_proxy_mdl
+ readonly property
+ var portfolio_mdl: API.app.portfolio_pg.portfolio_mdl
+ property
+ var portfolio_coins: portfolio_mdl.portfolio_proxy_mdl
function resetCoinFilter() {
portfolio_coins.setFilterFixedString("")
@@ -83,23 +93,24 @@ Item {
// Force restart modal: opened when the user has more coins enabled than specified in its configuration
ForceRestartModal {
- reason: qsTr("The current number of enabled coins does not match your configuration specification. Your assets configuration will be reset.")
+ reasonMsg: qsTr("The current number of enabled coins does not match your configuration specification. Your assets configuration will be reset.")
Component.onCompleted: {
- if (API.app.portfolio_pg.portfolio_mdl.length > atomic_settings2.value("MaximumNbCoinsEnabled"))
- {
+ if (API.app.portfolio_pg.portfolio_mdl.length > atomic_settings2.value("MaximumNbCoinsEnabled")) {
open()
- task_before_restart = () => { API.app.settings_pg.reset_coin_cfg() }
+ onTimerEnded = () => {
+ API.app.settings_pg.reset_coin_cfg()
+ }
}
}
}
// Right side
AnimatedRectangle {
- color: theme.backgroundColorDeep
+ color: DexTheme.backgroundColorDeep
width: parent.width - sidebar.width
- height: window.isOsx? parent.height : parent.height-40
- y: !window.isOsx? 40 : 0
+ height: parent.height
x: sidebar.width
+ border.color: 'transparent'
// Modals
ModalLoader {
@@ -190,17 +201,27 @@ Item {
transformOrigin: Item.Center
sourceComponent: {
- switch(current_page) {
- case idx_dashboard_portfolio: return portfolio
- case idx_dashboard_wallet: return wallet
- case idx_dashboard_exchange: return exchange
- case idx_dashboard_addressbook: return addressbook
- case idx_dashboard_news: return news
- case idx_dashboard_dapps: return dapps
- case idx_dashboard_settings: return settings
- case idx_dashboard_support: return support
- case idx_dashboard_fiat_ramp: return fiat_ramp
- default: return undefined
+ switch (current_page) {
+ case idx_dashboard_portfolio:
+ return portfolio
+ case idx_dashboard_wallet:
+ return wallet
+ case idx_dashboard_exchange:
+ return exchange
+ case idx_dashboard_addressbook:
+ return addressbook
+ case idx_dashboard_news:
+ return news
+ case idx_dashboard_dapps:
+ return dapps
+ case idx_dashboard_settings:
+ return settings
+ case idx_dashboard_support:
+ return support
+ case idx_dashboard_fiat_ramp:
+ return fiat_ramp
+ default:
+ return undefined
}
}
}
@@ -210,7 +231,7 @@ Item {
anchors.fill: parent
- DefaultBusyIndicator {
+ DexBusyIndicator {
anchors.centerIn: parent
running: !loader.visible
}
@@ -220,41 +241,7 @@ Item {
// Sidebar, left side
Sidebar {
id: sidebar
-
- }
-
- // Unread notifications count
- AnimatedRectangle {
- radius: 1337
- width: count_text.height * 1.5
- height: width
- z: 1
-
- x: sidebar.app_logo.x + sidebar.app_logo.width - 20
- y: sidebar.app_logo.y
- color: Qt.lighter(notifications_list.length > 0 ? Style.colorRed : theme.backgroundColor, notifications_modal_button.containsMouse ? Style.hoverLightMultiplier : 1)
-
- DefaultText {
- id: count_text
- anchors.centerIn: parent
- text_value: notifications_list.length
- font.pixelSize: Style.textSizeSmall1
- font.weight: Font.Medium
- color: notifications_list.length > 0 ? theme.foregroundColor : Qt.darker(theme.foregroundColor)
- }
- }
-
- // Notifications panel button
- DefaultMouseArea {
- id: notifications_modal_button
- x: sidebar.app_logo.x
- y: sidebar.app_logo.y
- width: sidebar.app_logo.width
- height: sidebar.app_logo.height
-
- hoverEnabled: true
-
- onClicked: notifications_modal.open()
+ y: -30
}
DropShadow {
@@ -263,21 +250,13 @@ Item {
cached: false
horizontalOffset: 0
verticalOffset: 0
- radius: theme.sidebarShadowRadius
+ radius: DexTheme.sidebarShadowRadius
samples: 32
spread: 0
- color: theme.colorSidebarDropShadow
+ color: DexTheme.colorSidebarDropShadow
smooth: true
}
- Rectangle {
- anchors.fill: parent
- color: '#000'
- visible: notifications_modal.visible
- anchors.leftMargin: sidebar.width
- opacity: .6
- }
-
ModalLoader {
id: add_custom_coin_modal
sourceComponent: AddCustomCoinModal {}
@@ -298,12 +277,8 @@ Item {
sourceComponent: RestartModal {}
}
- NotificationsModal {
- id: notifications_modal
- }
-
function getStatusColor(status) {
- switch(status) {
+ switch (status) {
case "matching":
return Style.colorYellow
case "matched":
@@ -311,15 +286,15 @@ Item {
case "refunding":
return Style.colorOrange
case "successful":
- return Style.colorGreen
+ return DexTheme.greenColor
case "failed":
default:
- return Style.colorRed
+ return DexTheme.redColor
}
}
- function getStatusText(status, short_text=false) {
- switch(status) {
+ function getStatusText(status, short_text = false) {
+ switch (status) {
case "matching":
return short_text ? qsTr("Matching") : qsTr("Order Matching")
case "matched":
@@ -338,7 +313,7 @@ Item {
}
function isSwapDone(status) {
- switch(status) {
+ switch (status) {
case "matching":
case "matched":
case "ongoing":
@@ -352,7 +327,7 @@ Item {
}
function getStatusStep(status) {
- switch(status) {
+ switch (status) {
case "matching":
return "0/3"
case "matched":
@@ -370,12 +345,12 @@ Item {
}
}
- function getStatusTextWithPrefix(status, short_text=false) {
+ function getStatusTextWithPrefix(status, short_text = false) {
return getStatusStep(status) + " " + getStatusText(status, short_text)
}
function getEventText(event_name) {
- switch(event_name) {
+ switch (event_name) {
case "Started":
return qsTr("Started")
case "Negotiated":
@@ -424,4 +399,4 @@ Item {
return qsTr(event_name)
}
}
-}
+}
\ No newline at end of file
diff --git a/atomic_defi_design/qml/Screens/FirstLaunch.qml b/atomic_defi_design/qml/Screens/FirstLaunch.qml
index 5577040b33..b257c14558 100644
--- a/atomic_defi_design/qml/Screens/FirstLaunch.qml
+++ b/atomic_defi_design/qml/Screens/FirstLaunch.qml
@@ -1,57 +1,189 @@
import QtQuick 2.15
import QtQuick.Layouts 1.15
import QtQuick.Controls 2.15
+import QtGraphicalEffects 1.12
+
+import Qaterial 1.0 as Qaterial
+
+import QtQuick.Window 2.15
import "../Components"
import "../Constants"
+import App 1.0
import "../Settings"
SetupPage {
// Override
- property var onClickedNewUser: () => {}
- property var onClickedRecoverSeed: () => {}
- property var onClickedWallet: () => {}
+ id: _setup
+ property
+ var onClickedNewUser: () => {}
+ property
+ var onClickedRecoverSeed: () => {}
+ property
+ var onClickedWallet: () => {}
- Component.onCompleted: updateWallets()
// Local
function updateWallets() {
wallets = API.app.wallet_mgr.get_wallets()
}
- property var wallets: ([])
+ function onClickedLogin(password) {
+ if (API.app.wallet_mgr.login(password, selected_wallet_name)) {
+ console.log("Success: Login")
+ app.currentWalletName = selected_wallet_name
+ return true
+ } else {
+ console.log("Failed: Login")
+ return false
+ }
+ }
+ property
+ var wallets: ([])
- image_path: General.image_path + Style.sidebar_atomicdex_logo
+ image_path: (bottomDrawer.y === 0 && bottomDrawer.visible) ? "" : "file:///" + atomic_logo_path + "/" + DexTheme.bigSidebarLogo
image_margin: 30
+ Drawer {
+ id: bottomDrawer
+ width: parent.width
+ height: parent.height
+ edge: Qt.BottomEdge
+ dim: false //
+ modal: false
+ background: Item {
+ DexRectangle {
+ id: _drawerBG
+ anchors.fill: parent
+ radius: 0
+ border.width: 0
+ color: 'black'
+ opacity: .8
+ }
+ Column {
+ anchors.bottom: parent.bottom
+ anchors.bottomMargin: 250
+ anchors.horizontalCenter: parent.horizontalCenter
+ spacing: 20
+ Image {
+ /*width: 200
+ height: 130*/
+ source: "file:///" + atomic_logo_path + "/" + DexTheme.bigSidebarLogo
+ anchors.horizontalCenter: parent.horizontalCenter
+ }
+ DexLabel {
+ anchors.horizontalCenter: parent.horizontalCenter
+ text: "%1 wallet".arg(selected_wallet_name)
+ color: DexTheme.foregroundColorLightColor4
+ font: DexTypo.body1
+ topPadding: 10
+ }
+ Connections {
+ target: bottomDrawer
+ function onVisibleChanged() {
+ _inputPassword.field.text = ""
+ }
+ }
+
+ DexAppPasswordField {
+ id: _inputPassword
+ height: 50
+ width: 300
+ anchors.horizontalCenter: parent.horizontalCenter
+ field.onAccepted: {
+ if (_keyChecker.isValid()) {
+ if (onClickedLogin(field.text)) {
+ bottomDrawer.close()
+ app.current_page = idx_initial_loading
+ } else {
+ error = true
+ }
+ } else {
+ error = true
+ }
+ }
+ }
+
+ DexKeyChecker {
+ id: _passwordChecker
+ visible: false
+ field: _inputPassword.field
+ }
+
+ DexButton {
+ radius: width
+ width: 150
+ text: qsTr("connect")
+ opacity: enabled ? 1 : 0.6
+ enabled: _passwordChecker.isValid()
+ anchors.horizontalCenter: parent.horizontalCenter
+ onClicked: {
+ _inputPassword.field.accepted()
+ }
+ }
+
+ DexKeyChecker {
+ id: _keyChecker
+ field: _inputPassword.field
+ visible: false
+ }
+ }
+ Qaterial.AppBarButton {
+ anchors.bottom: parent.bottom
+ anchors.bottomMargin: 60
+ anchors.horizontalCenter: parent.horizontalCenter
+ width: 80
+ icon.width: 40
+ icon.height: 40
+ icon.source: Qaterial.Icons.close
+ onClicked: bottomDrawer.close()
+ }
+ }
+
+ }
content: ColumnLayout {
id: content_column
width: 400
spacing: Style.rowSpacing
- DefaultText {
- text_value: qsTr("Welcome")
+ opacity: (bottomDrawer.y === 0 && bottomDrawer.visible) ? .3 : 1
+ RowLayout {
+ Layout.fillWidth: true
+ DexLabel {
+ font: DexTypo.head6
+ text_value: qsTr("Welcome")
+ Layout.fillWidth: true
+ Layout.alignment: Qt.AlignVCenter
+ }
+ DexLanguage {
+ Layout.preferredWidth: 55
+ Layout.alignment: Qt.AlignVCenter
+ }
}
- HorizontalLine {
+ Item {
Layout.fillWidth: true
}
- RowLayout {
+ DexAppButton {
Layout.fillWidth: true
- spacing: Style.buttonSpacing
-
- DexButton {
- Layout.fillWidth: true
- text: qsTr("New Wallet")
- textScale: API.app.settings_pg.lang=="fr"? 0.82 : 0.99
- onClicked: onClickedNewUser()
- }
+ horizontalAlignment: Qt.AlignLeft
+ Layout.minimumWidth: 350
+ leftPadding: 20
+ text: qsTr("New Wallet")
+ Layout.preferredHeight: 50
+ radius: 8
+ //backgroundColor: DexTheme.accentColor
+ onClicked: onClickedNewUser()
+ }
- DexButton {
- Layout.fillWidth: true
- text: qsTr("Recover Wallet")
- textScale: API.app.settings_pg.lang=="fr"? 0.82 : 0.99
- onClicked: onClickedRecoverSeed()
- }
+ DexAppButton {
+ text: qsTr("Import wallet")
+ horizontalAlignment: Qt.AlignLeft
+ //backgroundColor: DexTheme.accentColor
+ leftPadding: 20
+ radius: 8
+ Layout.fillWidth: true
+ Layout.preferredHeight: 50
+ onClicked: onClickedRecoverSeed()
}
// Wallets
@@ -60,61 +192,145 @@ SetupPage {
visible: wallets.length > 0
- // Name
- DefaultText {
+ DexLabel {
text_value: qsTr("My Wallets")
font.pixelSize: Style.textSizeSmall2
+ Layout.alignment: Qt.AlignHCenter
+ }
+ Item {
+ height: 15
+ Layout.fillWidth: true
+ Rectangle {
+ height: 2
+ width: parent.width
+ color: DexTheme.accentColor
+ Rectangle {
+ anchors.centerIn: parent
+ width: 9
+ height: 9
+ radius: 6
+ color: DexTheme.accentColor
+ }
+ }
}
- InnerBackground {
+ DexRectangle {
id: bg
width: content_column.width
readonly property int row_height: 40
Layout.minimumHeight: row_height
Layout.preferredHeight: row_height * Math.min(wallets.length, 3)
-
- content: DefaultListView {
+ color: "transparent"
+ DefaultListView {
id: list
implicitHeight: bg.Layout.preferredHeight
model: wallets
- delegate: GradientRectangle {
- start_color: Style.applyOpacity(Style.colorWalletsHighlightGradient, mouse_area.containsMouse ? "80" : "00")
- end_color: Style.applyOpacity(Style.colorWalletsHighlightGradient)
-
+ delegate: ClipRRect {
+ radius: 5
width: bg.width
height: bg.row_height
+ DexRectangle {
+
+ color: "transparent"
+ border.width: 0
- // Click area
- DefaultMouseArea {
- id: mouse_area
anchors.fill: parent
- hoverEnabled: true
- onClicked: {
- selected_wallet_name = model.modelData
- onClickedWallet()
+
+ Rectangle {
+ height: parent.height
+ width: mouse_area.containsMouse ? parent.width : 0
+ opacity: .4
+ Behavior on width {
+ NumberAnimation {
+ duration: 250
+ }
+ }
+ color: DexTheme.buttonColorHovered
+ visible: mouse_area.containsMouse
+ }
+ DefaultMouseArea {
+ id: mouse_area
+ anchors.fill: parent
+ hoverEnabled: true
+ onClicked: {
+ selected_wallet_name = model.modelData
+ bottomDrawer.open()
+ }
}
- }
- // Name
- DefaultText {
- anchors.left: parent.left
- anchors.leftMargin: 40
+ Qaterial.ColorIcon {
+ anchors.verticalCenter: parent.verticalCenter
+ color: DexTheme.foregroundColor
+ source: Qaterial.Icons.account
+ iconSize: 16
+ x: 20
+ }
+ DefaultText {
+ anchors.left: parent.left
+ anchors.leftMargin: 45
- text_value: model.modelData
- anchors.verticalCenter: parent.verticalCenter
- font.pixelSize: Style.textSizeSmall2
+ text_value: model.modelData
+ anchors.verticalCenter: parent.verticalCenter
+ font.pixelSize: Style.textSizeSmall2
+ }
}
+ Item {
+ anchors.right: parent.right
+ anchors.margins: 10
+ height: parent.height
+ width: 30
+ Qaterial.ColorIcon {
+ source: Qaterial.Icons.delete_
+ iconSize: 18
+ anchors.centerIn: parent
+ opacity: .8
+ color: _deleteArea.containsMouse ? DexTheme.redColor : DexTheme.foregroundColor
+ }
+ DexMouseArea {
+ id: _deleteArea
+ hoverEnabled: true
+ anchors.fill: parent
+ onClicked: {
+ let wallet_name = model.modelData
+ let dialog = app.getText({
+ "title": qsTr("Delete") + " %1 ".arg(wallet_name) + ("wallet?"),
+ text: qsTr("Enter password to confirm deletion of") + " %1 ".arg(wallet_name) + qsTr("wallet"),
+ standardButtons: Dialog.Yes | Dialog.Cancel,
+ warning: true,
+ width: 300,
+ iconColor: DexTheme.redColor,
+ isPassword: true,
+ placeholderText: qsTr("Type password"),
+ yesButtonText: qsTr("Delete"),
+ cancelButtonText: qsTr("Cancel"),
+ onAccepted: function(text) {
+ if (API.app.wallet_mgr.confirm_password(wallet_name, text)) {
+ API.app.wallet_mgr.delete_wallet(wallet_name);
+ app.showText({
+ title: qsTr("Wallet status"),
+ text: "%1 ".arg(wallet_name) + qsTr("wallet deleted successfully"),
+ standardButtons: Dialog.Ok
+ })
+ _setup.wallets = API.app.wallet_mgr.get_wallets()
+ } else {
+ app.showText({
+ title: qsTr("Wallet status"),
+ text: "%1 ".arg(wallet_name) + qsTr("wallet password entered is incorrect"),
+ iconSource: Qaterial.Icons.alert,
+ iconColor: DexTheme.redColor,
+ warning: true,
+ standardButtons: Dialog.Ok
+ })
+ }
+ dialog.close()
+ dialog.destroy()
+ }
- HorizontalLine {
- visible: index !== wallets.length -1
- width: parent.width - 4
-
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.bottom: parent.bottom
- anchors.bottomMargin: -height/2
- light: true
+ })
+ }
+ }
}
}
}
@@ -127,13 +343,38 @@ SetupPage {
light: true
}
- Languages {
- Layout.alignment: Qt.AlignHCenter
- show_label: false
+ }
+ Component.onCompleted: {
+ updateWallets()
+ }
+ Connections {
+ target: app
+ function onCan_open_loginChanged() {
+ console.log("LOGIN STATE changed")
+ if (app.can_open_login) {
+ bottomDrawer.open()
+ app.can_open_login = false
+ }
}
}
+ GaussianBlur {
+ anchors.fill: _setup
+ visible: false
+ source: _setup
+ radius: 21
+ deviation: 2
+ }
+ RecursiveBlur {
+ visible: bottomDrawer.y === 0 && bottomDrawer.visible
+ anchors.fill: _setup
+ source: _setup
+ radius: 2
+ loops: 120
+ }
- bottom_content: LinksRow {}
-}
+ bottom_content: LinksRow {
+ visible: !(bottomDrawer.y === 0 && bottomDrawer.visible)
+ }
+}
\ No newline at end of file
diff --git a/atomic_defi_design/qml/Screens/InitialLoading.qml b/atomic_defi_design/qml/Screens/InitialLoading.qml
index dbb14c772b..0548b3bb6d 100644
--- a/atomic_defi_design/qml/Screens/InitialLoading.qml
+++ b/atomic_defi_design/qml/Screens/InitialLoading.qml
@@ -4,41 +4,47 @@ import QtQuick.Controls 2.15
import "../Components"
import "../Constants"
+import App 1.0
import "../Wallet"
import "../Exchange"
import "../Sidebar"
SetupPage {
// Override
- property var onLoaded: () => {}
+ property
+ var onLoaded: () => {}
readonly property string current_status: API.app.wallet_mgr.initial_loading_status
onCurrent_statusChanged: {
- if(current_status === "complete")
+ if (current_status === "complete")
onLoaded()
}
- image_path: General.image_path + Style.sidebar_atomicdex_logo
+ image_path: "file:///" + atomic_logo_path + "/" + DexTheme.bigSidebarLogo
image_margin: 30
+ backgroundColor: 'transparent'
+ borderColor: 'transparent'
content: ColumnLayout {
+
+ DefaultBusyIndicator {
+ Layout.preferredHeight: 100
+ Layout.preferredWidth: 100
+ Layout.alignment: Qt.AlignHCenter
+ Layout.leftMargin: -15
+ Layout.rightMargin: Layout.leftMargin * 0.75
+ scale: 0.8
+ }
+
DefaultText {
text_value: qsTr("Loading, please wait")
Layout.bottomMargin: 10
}
- RowLayout {
- DefaultBusyIndicator {
- Layout.alignment: Qt.AlignHCenter
- Layout.leftMargin: -15
- Layout.rightMargin: Layout.leftMargin*0.75
- scale: 0.5
- }
-
- DefaultText {
- text_value: (current_status === "initializing_mm2" ? qsTr("Initializing MM2") :
- current_status === "enabling_coins" ? qsTr("Enabling assets") : qsTr("Getting ready")) + "..."
- }
+ DefaultText {
+ Layout.alignment: Qt.AlignHCenter
+ text_value: (current_status === "initializing_mm2" ? qsTr("Initializing MM2") :
+ current_status === "enabling_coins" ? qsTr("Enabling assets") : qsTr("Getting ready")) + "..."
}
}
-}
+}
\ No newline at end of file
diff --git a/atomic_defi_design/qml/Screens/Login.qml b/atomic_defi_design/qml/Screens/Login.qml
index 6f6f5722ad..d79887ed74 100644
--- a/atomic_defi_design/qml/Screens/Login.qml
+++ b/atomic_defi_design/qml/Screens/Login.qml
@@ -2,15 +2,18 @@ import QtQuick 2.15
import QtQuick.Layouts 1.15
import QtQuick.Controls 2.15
+import Qaterial 1.0 as Qaterial
+
import "../Components"
import "../Constants"
+import App 1.0
SetupPage {
id: login
// Override
- property var onClickedBack: () => {}
- property var postLoginSuccess: () => {}
+ signal clickedBack()
+ signal postLoginSuccess()
// Local
function reset() {
@@ -18,12 +21,12 @@ SetupPage {
}
function onClickedLogin(password) {
- if(API.app.wallet_mgr.login(password, selected_wallet_name)) {
+ if (API.app.wallet_mgr.login(password, selected_wallet_name)) {
console.log("Success: Login")
+ app.currentWalletName = selected_wallet_name
postLoginSuccess()
return true
- }
- else {
+ } else {
console.log("Failed: Login")
text_error = qsTr("Incorrect Password")
return false
@@ -44,48 +47,178 @@ SetupPage {
}
function trySubmit() {
- if(!submit_button.enabled) return
+ if (!submit_button.enabled) return
- if(onClickedLogin(input_password.field.text))
+ if (onClickedLogin(input_password.field.text))
reset()
}
width: 400
- DexLabel {
- text_value: qsTr("Wallet Name") + ": " + selected_wallet_name
+ RowLayout {
+ Layout.fillWidth: true
+ spacing: 10
+ Qaterial.AppBarButton {
+ icon.source: Qaterial.Icons.arrowLeft
+ Layout.alignment: Qt.AlignVCenter
+ onClicked: {
+ reset()
+ onClickedBack()
+ }
+ }
+
+ DexLabel {
+ font: DexTypo.head6
+ text_value: qsTr("Login")
+ Layout.alignment: Qt.AlignVCenter
+ }
+
}
- HorizontalLine {
+ Item {
Layout.fillWidth: true
+ Layout.preferredHeight: 5
}
+ DexAppTextField {
+ Layout.fillWidth: true
+ Layout.preferredHeight: 50
+ background.border.width: 1
+ background.radius: 25
+ enabled: false
+ opacity: enabled ? 1 : .5
+ background.border.color: field.focus ? DexTheme.accentColor : Style.colorBorder
+ field.font: DexTypo.head6
+ field.horizontalAlignment: Qt.AlignLeft
+ field.leftPadding: 75
+ field.text: selected_wallet_name
+
+ DexRectangle {
+ x: 5
+ height: 40
+ width: 60
+ radius: 20
+ color: DexTheme.accentColor
+ anchors.verticalCenter: parent.verticalCenter
+ Qaterial.ColorIcon {
+ anchors.centerIn: parent
+ iconSize: 19
+ source: Qaterial.Icons.account
+ color: DexTheme.surfaceColor
+ }
+
+ }
+ }
+
+ Item {
+ Layout.fillWidth: true
+ Layout.preferredHeight: 5
+ opacity: .8
+
+ }
+
+ DexAppTextField {
+ id: _inputPassword
+ Layout.fillWidth: true
+ Layout.preferredHeight: 50
+ background.border.width: 1
+ background.radius: 25
+ background.border.color: field.focus ? DexTheme.accentColor : Style.colorBorder
+ field.echoMode: TextField.Password
+ field.font: field.echoMode === TextField.Password ? field.text === "" ? DexTypo.body1 : DexTypo.head5 : DexTypo.head6
+ field.horizontalAlignment: Qt.AlignLeft
+ field.leftPadding: 75
+ field.placeholderText: qsTr("Type password")
+ field.onAccepted: trySubmit()
+ DexRectangle {
+ x: 5
+ height: 40
+ width: 60
+ radius: 20
+ color: DexTheme.accentColor
+ anchors.verticalCenter: parent.verticalCenter
+ Qaterial.ColorIcon {
+ anchors.centerIn: parent
+ iconSize: 19
+ source: Qaterial.Icons.keyVariant
+ color: DexTheme.surfaceColor
+ }
+
+ }
+ Qaterial.AppBarButton {
+ opacity: .8
+ icon {
+ source: _inputPassword.field.echoMode === TextField.Password ? Qaterial.Icons.eyeOutline : Qaterial.Icons.eyeOffOutline
+ color: DexTheme.accentColor
+ }
+ anchors {
+ verticalCenter: parent.verticalCenter
+ right: parent.right
+ rightMargin: 10
+ }
+ onClicked: {
+ if (_inputPassword.field.echoMode === TextField.Password) {
+ _inputPassword.field.echoMode = TextField.Normal
+ } else {
+ _inputPassword.field.echoMode = TextField.Password
+ }
+ }
+ }
+ }
PasswordForm {
id: input_password
confirm: false
+ visible: false
+ field.text: _inputPassword.field.text
field.onAccepted: trySubmit()
}
+ Item {
+ Layout.fillWidth: true
+ Layout.preferredHeight: 10
+ }
RowLayout {
+ Layout.preferredWidth: 400
spacing: Style.buttonSpacing
- DefaultButton {
+ Item {
+ Layout.fillWidth: true
+ Layout.preferredHeight: 10
+ }
+
+ DexButton {
id: _back
text: qsTr("Back")
- Layout.fillWidth: true
- onClicked: {
- reset()
- onClickedBack()
- }
+ visible: false
+
}
- PrimaryButton {
+ DexAppButton {
id: submit_button
- Layout.fillWidth: true
- implicitHeight: _back.implicitHeight
text: qsTr("Login")
- onClicked: trySubmit()
enabled: input_password.isValid()
+ onClicked: trySubmit()
+ radius: 20
+ backgroundColor: DexTheme.accentColor
+ Layout.preferredWidth: _nextRow.implicitWidth + 40
+ Layout.preferredHeight: 45
+ label.color: 'transparent'
+ Row {
+ id: _nextRow
+ anchors.centerIn: parent
+ spacing: 10
+ opacity: submit_button.enabled ? 1 : .6
+ DexLabel {
+ text: qsTr("Connect")
+ font: DexTypo.button
+ anchors.verticalCenter: parent.verticalCenter
+ }
+ Qaterial.ColorIcon {
+ anchors.verticalCenter: parent.verticalCenter
+ source: Qaterial.Icons.arrowRight
+ iconSize: 14
+ }
+ }
}
}
@@ -95,4 +228,4 @@ SetupPage {
visible: text !== ''
}
}
-}
+}
\ No newline at end of file
diff --git a/atomic_defi_design/qml/Screens/NewUser.qml b/atomic_defi_design/qml/Screens/NewUser.qml
index 120e43a35e..d993c89ddf 100644
--- a/atomic_defi_design/qml/Screens/NewUser.qml
+++ b/atomic_defi_design/qml/Screens/NewUser.qml
@@ -2,21 +2,25 @@ import QtQuick 2.15
import QtQuick.Layouts 1.15
import QtQuick.Controls 2.15
+import Qaterial 1.0 as Qaterial
+
import "../Components"
import "../Constants"
+import App 1.0
SetupPage {
id: new_user
// Override
- property var onClickedBack: () => {}
- property var postCreateSuccess: () => {}
+ signal clickedBack()
+ signal postCreateSuccess()
property string current_mnemonic
property string text_error
property string guess_text_error
property bool form_is_filled: false
+ property int currentStep: 0
property int current_word_idx: 0
property int guess_count: 1
@@ -32,7 +36,7 @@ SetupPage {
function setRandomGuessWord() {
const prev_idx = current_word_idx
- while(current_word_idx === prev_idx)
+ while (current_word_idx === prev_idx)
current_word_idx = General.getRandomInt(0, getWords().length - 1)
}
@@ -41,25 +45,24 @@ SetupPage {
}
function submitGuess(field) {
- if(validGuessField(field)) {
+ if (validGuessField(field)) {
// Check if it's correct
- if(field.text === getWords()[current_word_idx]) {
- if(isFinalGuess()) {
- return true
- }
- else {
+ if (field.text === getWords()[current_word_idx]) {
+ if (isFinalGuess()) {
+ return [true, true]
+ } else {
++guess_count
setRandomGuessWord()
}
field.text = ""
guess_text_error = ""
- }
- else {
+ return [true, false]
+ } else {
guess_text_error = qsTr("Wrong word, please check again")
}
}
- return false
+ return [false, false]
}
function isFinalGuess() {
@@ -76,15 +79,53 @@ SetupPage {
guess_count = 1
}
+ function shuffle(array) {
+ var currentIndex = array.length,
+ randomIndex;
+
+ // While there remain elements to shuffle...
+ while (0 !== currentIndex) {
+
+ // Pick a remaining element...
+ randomIndex = Math.floor(Math.random() * currentIndex);
+ currentIndex--;
+
+ // And swap it with the current element.
+ [array[currentIndex], array[randomIndex]] = [
+ array[randomIndex], array[currentIndex]
+ ];
+ }
+
+ return array;
+ }
+
+ function getRandom4x(list, keep) {
+
+ // remove keep
+ const index = list.indexOf(keep);
+ if (index > -1) {
+ list.splice(index, 1);
+ }
+
+ // randomlise
+ let randomList = shuffle(list)
+
+ // set keeped word
+ let newList = [randomList[0], randomList[1], randomList[2], keep]
+
+ // randomlise again
+ let finalList = shuffle(newList)
+
+ // return final word list
+ return finalList
+ }
+
function onClickedCreate(password, generated_seed, wallet_name) {
- if(API.app.wallet_mgr.create(password, generated_seed, wallet_name)) {
- console.log("Success: Create wallet")
+ if (API.app.wallet_mgr.create(password, generated_seed, wallet_name)) {
selected_wallet_name = wallet_name
postCreateSuccess()
return true
- }
- else {
- console.log("Failed: Create wallet")
+ } else {
text_error = qsTr("Failed to create a wallet")
return false
}
@@ -95,30 +136,64 @@ SetupPage {
//image_path: General.image_path + (form_is_filled ? "settings-seed.svg" : "setup-welcome-wallet.svg")
content: ColumnLayout {
- width: 600
spacing: Style.rowSpacing
+ RowLayout {
+ Layout.fillWidth: true
+ spacing: 10
+ Qaterial.AppBarButton {
+ icon.source: Qaterial.Icons.arrowLeft
+ foregroundColor: DexTheme.foregroundColor
+ Layout.alignment: Qt.AlignVCenter
+ onClicked: {
+ if (currentStep === 0) {
+ reset()
+ clickedBack()
+ } else {
+ if (currentStep == 2) {
+ currentStep = 0
+ _inputPassword.field.text = ""
+ _inputPasswordConfirm.field.text = ""
+ } else {
+ input_seed_word.field.text = ""
+ currentStep--
+ }
+
+
+ }
+ }
+ }
+
+ DexLabel {
+ font: DexTypo.head6
+ text_value: if (currentStep === 0) {
+ qsTr("New Wallet")
+ } else if (currentStep === 1) {
+ qsTr("Confirm Seed")
+ } else if (currentStep === 2) {
+ qsTr("Choose Password")
+ }
+ Layout.alignment: Qt.AlignVCenter
+ }
- DefaultText {
- text_value: qsTr("New Wallet")
}
- HorizontalLine {
+ Item {
Layout.fillWidth: true
}
function reset() {
new_user.reset()
input_wallet_name.reset()
- input_confirm_seed.reset()
- input_password.reset()
+ _inputPassword.field.text = ""
input_seed_word.field.text = ""
+ input_generated_seed.text = ""
}
function completeForm() {
- if(!continue_button.enabled) return
+ if (!continue_button.enabled) return
text_error = General.checkIfWalletExists(input_wallet_name.field.text)
- if(text_error !== "") return
+ if (text_error !== "") return
input_seed_word.field.text = ""
guess_text_error = ""
@@ -130,45 +205,70 @@ SetupPage {
function tryGuess() {
// Open EULA if it's the final one
- if(submitGuess(input_seed_word.field)) eula_modal.open()
+ let sub = submitGuess(input_seed_word.field)
+ if (sub[0] == true && sub[1] == true) {
+ currentStep++
+ } else if (sub[0] == true && sub[1] == false) {
+ input_seed_word.field.text = ""
+ } else {
+ input_seed_word.field.text = ""
+ input_seed_word.error = true
+ setRandomGuessWord()
+ mmo.model = getRandom4x(current_mnemonic.split(" "), getWords()[current_word_idx])
+ }
}
ModalLoader {
id: eula_modal
sourceComponent: EulaModal {
onConfirm: () => {
- if(onClickedCreate(input_password.field.text,
- input_generated_seed.field.text,
- input_wallet_name.field.text)) reset()
+ if (onClickedCreate(_inputPassword.field.text,
+ input_generated_seed.text,
+ input_wallet_name.field.text)) reset()
}
}
}
-
- // First page, fill the form
ColumnLayout {
- visible: !form_is_filled
+ visible: currentStep === 0
+ Layout.preferredWidth: 450
spacing: Style.rowSpacing
- WalletNameField {
+ DexAppTextField {
id: input_wallet_name
+ Layout.fillWidth: true
+ Layout.preferredHeight: 50
+ opacity: enabled ? 1 : .5
+ background.border.width: 1
+ background.radius: 25
field.onAccepted: completeForm()
- }
+ field.font: DexTypo.head6
+ field.horizontalAlignment: Qt.AlignLeft
+ field.leftPadding: 75
+ field.placeholderText: "Wallet Name"
+ field.onTextChanged: text_error = ""
+
+ DexRectangle {
+ x: 5
+ height: 40
+ width: 60
+ radius: 20
+ color: DexTheme.accentColor
+ anchors.verticalCenter: parent.verticalCenter
+ Qaterial.ColorIcon {
+ anchors.centerIn: parent
+ iconSize: 19
+ source: Qaterial.Icons.wallet
+ color: DexTheme.surfaceColor
+ }
- TextAreaWithTitle {
- id: input_generated_seed
- title: qsTr("Generated Seed")
- field.text: current_mnemonic
- field.readOnly: true
- copyable: true
- onReturn: completeForm
+ }
}
-
- FloatingBackground {
+ DexRectangle {
Layout.topMargin: 10
Layout.bottomMargin: Layout.topMargin
Layout.fillWidth: true
- color: Style.colorRed3
+ color: DexTheme.redColor
height: warning_texts.height + 20
Column {
@@ -179,14 +279,15 @@ SetupPage {
spacing: 10
- DefaultText {
+ DexLabel {
width: parent.width - 40
horizontalAlignment: Text.AlignHCenter
anchors.horizontalCenter: parent.horizontalCenter
text_value: qsTr("Important: Back up your seed phrase before proceeding!")
+ color: Style.colorWhite4
}
- DefaultText {
+ DexLabel {
width: parent.width - 40
horizontalAlignment: Text.AlignHCenter
anchors.horizontalCenter: parent.horizontalCenter
@@ -196,49 +297,115 @@ SetupPage {
}
}
}
-
- TextAreaWithTitle {
- id: input_confirm_seed
- title: qsTr("Confirm Seed")
- field.placeholderText: qsTr("Enter the generated seed here")
- onReturn: completeForm
+ TextField {
+ id: input_generated_seed
+ visible: false
+ text: current_mnemonic
+ }
+ Column {
+ Layout.fillWidth: true
+ spacing: 5
+ RowLayout {
+ width: parent.width
+ DexLabel {
+ text: qsTr("Generated Seed")
+ font: DexTypo.body1
+ Layout.fillWidth: true
+ Layout.alignment: Qt.AlignVCenter
+ }
+ Qaterial.AppBarButton {
+ icon.source: Qaterial.Icons.contentCopy
+ Layout.alignment: Qt.AlignVCenter
+ onClicked: {
+ input_generated_seed.selectAll()
+ input_generated_seed.copy()
+ toast.show(qsTr("Copied to Clipboard"), General.time_toast_basic_info, "", false)
+ }
+ }
+ }
+ Item {
+ width: parent.width
+ height: _insideFlow.height
+ Grid {
+ id: _insideFlow
+ width: parent.width
+ spacing: 10
+ Repeater {
+ model: current_mnemonic.split(" ")
+ delegate: DexRectangle {
+ width: (_insideFlow.width - 30) / 4
+ height: _insideLabel.implicitHeight + 15
+ color: DexTheme.accentColor
+ opacity: .8
+ DexLabel {
+ id: _insideLabel
+ text: (index + 1) + ". " + modelData
+ font: DexTypo.body2
+ color: DexTheme.backgroundColor
+ anchors.centerIn: parent
+ }
+ }
+ }
+ }
+ }
}
- PasswordForm {
- id: input_password
-
- field.onAccepted: completeForm()
- confirm_field.onAccepted: completeForm()
+ Item {
+ Layout.fillWidth: true
+ Layout.preferredHeight: 10
}
RowLayout {
+ Layout.preferredWidth: 400
spacing: Style.buttonSpacing
- DefaultButton {
+ Item {
Layout.fillWidth: true
- text: qsTr("Back")
+ Layout.preferredHeight: 10
+ }
+ DexAppButton {
+ id: nextButton
+ enabled: input_wallet_name.field.text !== ""
onClicked: {
- reset()
- onClickedBack()
+ text_error = General.checkIfWalletExists(input_wallet_name.field.text)
+ if (text_error !== "") {
+ input_wallet_name.error = true
+ return
+ }
+
+ currentStep++
+ input_seed_word.field.text = ""
+ guess_count = 1
+ setRandomGuessWord()
+ }
+ radius: 20
+ opacity: enabled ? 1 : .4
+ Layout.preferredWidth: _nextRow.implicitWidth + 40
+ Layout.preferredHeight: 45
+ label.color: 'transparent'
+ Row {
+ id: _nextRow
+ anchors.centerIn: parent
+ spacing: 10
+ DexLabel {
+ text: qsTr("Next")
+ font: DexTypo.button
+ color: nextButton.foregroundColor
+ anchors.verticalCenter: parent.verticalCenter
+ }
+ Qaterial.ColorIcon {
+ anchors.verticalCenter: parent.verticalCenter
+ color: nextButton.foregroundColor
+ source: Qaterial.Icons.arrowRight
+ iconSize: 14
+ }
}
- }
-
- PrimaryButton {
- id: continue_button
- Layout.fillWidth: true
- text: qsTr("Continue")
- onClicked: completeForm()
- enabled: // Fields are not empty
- input_wallet_name.field.acceptableInput === true &&
- input_password.isValid() &&
- // Correct confirm fields
- input_generated_seed.field.text === input_confirm_seed.field.text
}
}
DefaultText {
text_value: text_error
- color: Style.colorRed
+ color: DexTheme.redColor
visible: text !== ''
}
}
@@ -246,13 +413,13 @@ SetupPage {
// Second page, write the seed word
ColumnLayout {
- visible: form_is_filled
+ visible: currentStep === 1
FloatingBackground {
Layout.topMargin: 10
Layout.bottomMargin: Layout.topMargin
Layout.fillWidth: true
- height: 160
+ height: 140
Column {
id: warning_texts_2
@@ -260,54 +427,214 @@ SetupPage {
anchors.centerIn: parent
width: parent.width
- spacing: 30
+ spacing: 5
- DefaultText {
+ DexLabel {
width: parent.width - 40
anchors.horizontalCenter: parent.horizontalCenter
+ font {
+ bold: true
+ }
text_value: qsTr("Let's double check your seed phrase")
}
-
- DefaultText {
+ DexLabel {
width: parent.width - 40
anchors.horizontalCenter: parent.horizontalCenter
text_value: qsTr("Your seed phrase is important - that's why we like to make sure it's correct. We'll ask you three different questions about your seed phrase to make sure you'll be able to easily restore your wallet whenever you want.")
font.pixelSize: Style.textSizeSmall4
- color: Style.colorWhite4
+ color: DexTheme.foregroundColorLightColor2
+ }
+ }
+ }
+
+ Column {
+ Layout.fillWidth: true
+ spacing: 5
+ Item {
+ width: parent.width - 10
+ height: _insideFlow2.height
+ Grid {
+ id: _insideFlow2
+ width: parent.width
+ spacing: 10
+ horizontalItemAlignment: Grid.AlignHCenter
+ Repeater {
+ id: mmo
+ model: getRandom4x(current_mnemonic.split(" "), getWords()[current_word_idx])
+ delegate: DexAppButton {
+ width: (_insideFlow2.width - 30) / 4
+ text: modelData ?? ""
+ onClicked: {
+ input_seed_word.field.text = modelData
+ tryGuess()
+ }
+ }
+ }
}
}
}
+ Item {
+ Layout.fillWidth: true
+ Layout.preferredHeight: 5
+ }
- TextFieldWithTitle {
+ DexAppTextField {
id: input_seed_word
- title: qsTr("What's the %n. word in your seed phrase?", "", current_word_idx + 1)
+ Layout.fillWidth: true
+ Layout.preferredHeight: 50
+ opacity: enabled ? 1 : .5
+ background.border.width: 1
+ background.radius: 25
+ field.font: DexTypo.head6
+ field.horizontalAlignment: Qt.AlignLeft
+ field.leftPadding: 75
field.placeholderText: qsTr("Enter the %n. word", "", current_word_idx + 1)
- field.validator: RegExpValidator { regExp: /[a-z]+/ }
+ field.validator: RegExpValidator {
+ regExp: /[a-z]+/
+ }
field.onAccepted: tryGuess()
+
+ DexRectangle {
+ x: 5
+ height: 40
+ width: 60
+ radius: 20
+ color: DexTheme.accentColor
+ anchors.verticalCenter: parent.verticalCenter
+ DexLabel {
+ anchors.centerIn: parent
+ font: DexTypo.head6
+ color: DexTheme.backgroundColor
+ text: current_word_idx + 1
+ }
+
+ }
+ }
+
+ Item {
+ Layout.fillWidth: true
+ Layout.preferredHeight: 10
}
RowLayout {
- DefaultButton {
- Layout.fillWidth: true
- text: qsTr("Go back and check again")
- onClicked: form_is_filled = false
- }
+ Layout.preferredWidth: 400
+ spacing: Style.buttonSpacing
- PrimaryButton {
- id: submit_button
+ Item {
Layout.fillWidth: true
- text: qsTr("Continue")
- onClicked: tryGuess()
+ Layout.preferredHeight: 10
+ }
+ DexAppButton {
+ id: checkForNext
enabled: validGuessField(input_seed_word.field)
+ opacity: enabled ? 1 : .4
+ onClicked: tryGuess()
+ radius: 20
+ Layout.preferredWidth: _nextRow3.implicitWidth + 40
+ Layout.preferredHeight: 45
+ label.color: 'transparent'
+ Row {
+ id: _nextRow3
+ anchors.centerIn: parent
+ spacing: 10
+ DexLabel {
+ text: qsTr("Check")
+ font: DexTypo.button
+ color: checkForNext.foregroundColor
+ anchors.verticalCenter: parent.verticalCenter
+ }
+ Qaterial.ColorIcon {
+ anchors.verticalCenter: parent.verticalCenter
+ color: checkForNext.foregroundColor
+ source: Qaterial.Icons.check
+ iconSize: 14
+ }
+ }
}
}
DefaultText {
text_value: guess_text_error
- color: Style.colorRed
+ color: DexTheme.redColor
+ visible: input_seed_word.error
+ DexVisibleBehavior on visible {}
+ }
+ }
+
+ ColumnLayout {
+ visible: currentStep === 2
+ Layout.preferredWidth: 450
+ spacing: Style.rowSpacing
+
+ DexAppPasswordField {
+ id: _inputPassword
+ Layout.fillWidth: true
+ Layout.preferredHeight: 50
+ field.onAccepted: _keyChecker.isValid() ? eula_modal.open() : undefined
+ }
+
+ DexKeyChecker {
+ id: _keyChecker
+ field: _inputPassword.field
+ double_validation: true
+ Layout.leftMargin: 20
+ match_password: _inputPasswordConfirm.field.text
+ }
+
+ DexAppPasswordField {
+ id: _inputPasswordConfirm
+ Layout.fillWidth: true
+ Layout.preferredHeight: 50
+ field.onAccepted: _keyChecker.isValid() ? eula_modal.open() : undefined
+ }
+
+ Item {
+ Layout.fillWidth: true
+ }
+
+ RowLayout {
+ Layout.preferredWidth: 400
+
+ Item {
+ Layout.fillWidth: true
+ Layout.preferredHeight: 10
+ }
+
+ DexAppButton {
+ id: finalRegisterButton
+ enabled: _keyChecker.isValid()
+ opacity: enabled ? 1 : .4
+ onClicked: eula_modal.open()
+ radius: 20
+ Layout.preferredWidth: _nextRow2.implicitWidth + 40
+ Layout.preferredHeight: 45
+ label.color: 'transparent'
+ Row {
+ id: _nextRow2
+ anchors.centerIn: parent
+ spacing: 10
+ DexLabel {
+ text: qsTr("Continue")
+ font: DexTypo.button
+ color: finalRegisterButton.foregroundColor
+ anchors.verticalCenter: parent.verticalCenter
+ }
+ Qaterial.ColorIcon {
+ anchors.verticalCenter: parent.verticalCenter
+ source: Qaterial.Icons.arrowRight
+ color: finalRegisterButton.foregroundColor
+ iconSize: 14
+ }
+ }
+ }
+ }
+
+ DefaultText {
+ text_value: text_error
+ color: DexTheme.redColor
visible: text !== ''
}
}
}
-}
+}
\ No newline at end of file
diff --git a/atomic_defi_design/qml/Screens/RecoverSeed.qml b/atomic_defi_design/qml/Screens/RecoverSeed.qml
index a79afec582..6c178353af 100644
--- a/atomic_defi_design/qml/Screens/RecoverSeed.qml
+++ b/atomic_defi_design/qml/Screens/RecoverSeed.qml
@@ -2,14 +2,18 @@ import QtQuick 2.15
import QtQuick.Layouts 1.15
import QtQuick.Controls 2.15
+import Qaterial 1.0 as Qaterial
+
import "../Components"
import "../Constants"
+import App 1.0
SetupPage {
id: recover_seed
// Override
- property var onClickedBack: () => {}
- property var postConfirmSuccess: () => {}
+ signal clickedBack()
+ signal postConfirmSuccess()
+ property int currentStep: 0
// Local
function reset() {
@@ -17,15 +21,12 @@ SetupPage {
}
function onClickedConfirm(password, seed, wallet_name) {
- if(API.app.wallet_mgr.create(password, seed, wallet_name)) {
- console.log("Success: Recover seed")
+ if (API.app.wallet_mgr.create(password, seed, wallet_name)) {
selected_wallet_name = wallet_name
postConfirmSuccess()
return true
- }
- else {
- console.log("Failed: Recover seed")
- text_error = qsTr("Failed to recover the seed")
+ } else {
+ text_error = qsTr("Failed to Import the wallet")
return false
}
}
@@ -38,130 +39,313 @@ SetupPage {
// image_path: General.image_path + "setup-wallet-restore-2.svg"
content: ColumnLayout {
- width: 400
spacing: Style.rowSpacing
+ RowLayout {
+ Layout.fillWidth: true
+ spacing: 10
+ Qaterial.AppBarButton {
+ icon.source: Qaterial.Icons.arrowLeft
+ foregroundColor: DexTheme.foregroundColor
+ Layout.alignment: Qt.AlignVCenter
+ onClicked: {
+ if (currentStep === 0) {
+ reset()
+ clickedBack()
+ } else {
+ if (text_error !== "") {
+ text_error = ""
+ }
+ currentStep--
+ }
+ }
+ }
- DefaultText {
- text_value: qsTr("Recover Wallet")
- }
+ DexLabel {
+ font: DexTypo.head6
+ Layout.fillWidth: true
+ rightPadding: 20
+ wrapMode: Label.Wrap
+ text_value: if (currentStep === 0) {
+ qsTr("Import wallet - Setup")
+ } else if (currentStep === 1) {
+ qsTr("Import wallet - Choose password")
+ }
+ Layout.alignment: Qt.AlignVCenter
+ }
- HorizontalLine {
- Layout.fillWidth: true
}
function reset() {
recover_seed.reset()
input_wallet_name.reset()
- input_seed.reset()
- input_seed_hidden.reset()
- input_password.reset()
- input_seed.visible = false
+ _seedField.field.text = ""
+ _inputPassword.field.text = ""
}
function trySubmit() {
- if(!submit_button.enabled) return
+ if (!submit_button.enabled) return
text_error = General.checkIfWalletExists(input_wallet_name.field.text)
- if(text_error !== "") return
+ if (text_error !== "") return
eula_modal.open()
}
+ function tryPassLevel1() {
+ if (input_wallet_name.field.text == "") {
+ input_wallet_name.error = true
+ }
+
+ if (_seedField.isValid() && input_wallet_name.field.text !== "") {
+ let checkWalletName = General.checkIfWalletExists(input_wallet_name.field.text)
+ if( checkWalletName === "" ) {
+ _seedField.error = false
+ _inputPassword.field.text = ""
+ _inputPasswordConfirm.field.text = ""
+ currentStep++
+ }
+ else {
+ input_wallet_name.error = true
+ text_error = checkWalletName
+ }
+ } else {
+ _seedField.error = true
+ }
+ }
+
ModalLoader {
id: eula_modal
sourceComponent: EulaModal {
onConfirm: () => {
- if(onClickedConfirm(input_password.field.text, input_seed.field.text, input_wallet_name.field.text))
- reset()
+ if (onClickedConfirm(_inputPassword.field.text, _seedField.field.text, input_wallet_name.field.text))
+ reset()
}
}
}
+ ColumnLayout {
+ visible: currentStep === 0
+ Layout.preferredWidth: 450
+ spacing: Style.rowSpacing
- WalletNameField {
- id: input_wallet_name
- field.onAccepted: trySubmit()
- }
+ DexAppTextField {
+ id: input_wallet_name
+ Layout.fillWidth: true
+ Layout.preferredHeight: 50
+ opacity: enabled ? 1 : .5
+ background.border.width: 1
+ background.radius: 25
+ field.font: DexTypo.head6
+ field.horizontalAlignment: Qt.AlignLeft
+ field.leftPadding: 75
+ field.placeholderText: qsTr("Wallet Name")
+ field.onAccepted: tryPassLevel1()
+ field.onTextChanged: text_error = ""
+ DexRectangle {
+ x: 5
+ height: 40
+ width: 60
+ radius: 20
+ color: DexTheme.accentColor
+ anchors.verticalCenter: parent.verticalCenter
+ Qaterial.ColorIcon {
+ anchors.centerIn: parent
+ iconSize: 19
+ source: Qaterial.Icons.wallet
+ color: DexTheme.surfaceColor
+ }
- TextFieldWithTitle {
- id: input_seed_hidden
- visible: !input_seed.visible
- title: qsTr("Seed")
- field.placeholderText: qsTr("Enter the seed")
- field.onTextChanged: {
- input_seed.field.text = field.text
+ }
}
- hidable: true
- hiding: true
- hide_button.use_default_behaviour: false
- hide_button_area.onClicked: {
- input_seed.visible = true
- // input_seed.field.focus = true // This puts the cursor to left, not good
+
+ DexLabel {
+ text: qsTr("Enter seed")
+ font: DexTypo.body1
}
- field.onAccepted: trySubmit()
- }
+ DexAppPasswordField {
+ id: _seedField
+ Layout.fillWidth: true
+ Layout.preferredHeight: 50
+ leftIcon: Qaterial.Icons.fileKey
+ field.placeholderText: qsTr('Enter seed')
+ field.onAccepted: tryPassLevel1()
+ field.onTextChanged: {
+ field.text = field.text.replace("\n", "")
+ field.cursorPosition = field.length
+ }
+
+ function isValid() {
+ if (!allow_custom_seed.checked) {
+ _seedField.field.text = _seedField.field.text.trim().toLowerCase()
+ }
+ _seedField.field.text = _seedField.field.text.replace(/[^\w\s]/gi, '')
+ return allow_custom_seed.checked || API.app.wallet_mgr.mnemonic_validate(_seedField.field.text)
+ }
+ }
- TextAreaWithTitle {
- id: input_seed
- visible: false
- title: qsTr("Seed")
- field.placeholderText: qsTr("Enter the seed")
- field.onTextChanged: {
- input_seed_hidden.field.text = field.text
+ DexLabel {
+ id: _seedError
+ visible: _seedField.error
+ text: qsTr("BIP39 seed validation failed, try again or select 'Allow custom seed'")
+ color: DexTheme.redColor
+ Layout.preferredWidth: parent.width - 40
+ wrapMode: DexLabel.Wrap
+ font: DexTypo.body2
}
- hidable: true
- hiding: false
- hide_button.use_default_behaviour: false
- hide_button_area.onClicked: {
- visible = false
- // input_seed_hidden.field.focus = true // This puts the cursor to left, not good
+ DexCheckBox {
+ id: allow_custom_seed
+ text: qsTr("Allow custom seed")
+ onToggled: {
+ if (allow_custom_seed.checked) {
+ let dialog = app.getText({
+ title: qsTr("Allow custom seed "),
+ text: qsTr("Custom seed phrases might be less secure and easier to crack than a generated BIP39 compliant seed phrase or private key (WIF). To confirm you understand the risk and know what you are doing, type 'I understand' in the box below."),
+ placeholderText: qsTr("I understand"),
+ standardButtons: Dialog.Yes | Dialog.Cancel,
+ validator: (text) => {
+ return text === qsTr("I understand")
+ },
+ yesButtonText: qsTr("Enable"),
+ onAccepted: function() {
+ allow_custom_seed.checked = true
+ dialog.close()
+ },
+ onRejected: function() {
+ allow_custom_seed.checked = false
+ }
+ })
+ } else {
+ allow_custom_seed.checked = false
+ }
+ }
}
- onReturn: trySubmit
- }
- DefaultCheckBox {
- id: allow_custom_seed
- text: qsTr("Allow custom seed")
- }
+ Item {
+ Layout.fillWidth: true
+ Layout.preferredHeight: 10
+ }
- PasswordForm {
- id: input_password
+ RowLayout {
+ Layout.preferredWidth: 400
+ spacing: Style.buttonSpacing
- field.onAccepted: trySubmit()
- confirm_field.onAccepted: trySubmit()
+ Item {
+ Layout.fillWidth: true
+ Layout.preferredHeight: 10
+ }
+ DexAppButton {
+ id: nextButton
+ enabled: input_wallet_name.field.text !== "" && _seedField.field.text !== ""
+ onClicked: tryPassLevel1()
+ radius: 20
+ opacity: enabled ? 1 : .4
+ Layout.preferredWidth: _nextRow.implicitWidth + 40
+ Layout.preferredHeight: 45
+ label.color: 'transparent'
+ Row {
+ id: _nextRow
+ anchors.centerIn: parent
+ spacing: 10
+ DexLabel {
+ text: qsTr("Next")
+ font: DexTypo.button
+ color: nextButton.foregroundColor
+ anchors.verticalCenter: parent.verticalCenter
+ }
+ Qaterial.ColorIcon {
+ anchors.verticalCenter: parent.verticalCenter
+ color: nextButton.foregroundColor
+ source: Qaterial.Icons.arrowRight
+ iconSize: 14
+ }
+ }
+ }
+ }
+
+ DefaultText {
+ text_value: text_error
+ color: Style.colorRed
+ visible: text !== ''
+ }
}
- RowLayout {
- spacing: Style.buttonSpacing
- DefaultButton {
+ ColumnLayout {
+ visible: currentStep === 1
+ Layout.preferredWidth: 460
+ Layout.rightMargin: 5
+ spacing: Style.rowSpacing
+ DexAppPasswordField {
+ id: _inputPassword
Layout.fillWidth: true
- text: qsTr("Back")
- onClicked: {
- reset()
- onClickedBack()
- }
+ Layout.preferredHeight: 50
+ field.onAccepted: trySubmit()
+ }
+
+ DexKeyChecker {
+ id: _keyChecker
+ double_validation: true
+ field: _inputPassword.field
+ match_password: _inputPasswordConfirm.field.text
+ Layout.leftMargin: 20
}
- PrimaryButton {
- id: submit_button
+ DexAppPasswordField {
+ id: _inputPasswordConfirm
+ Layout.fillWidth: true
+ Layout.preferredHeight: 50
+ field.onAccepted: trySubmit()
+ }
+
+ Item {
Layout.fillWidth: true
- text: qsTr("Confirm")
- onClicked: trySubmit()
- enabled: // Fields are not empty
- input_wallet_name.field.acceptableInput === true &&
- input_seed.field.text !== '' &&
- input_password.isValid() &&
- (allow_custom_seed.checked || API.app.wallet_mgr.mnemonic_validate(input_seed.field.text))
}
- }
- DefaultText {
- text_value: text_error
- color: Style.colorRed
- visible: text !== ''
+ RowLayout {
+ Layout.preferredWidth: 400
+ Item {
+ Layout.fillWidth: true
+ Layout.preferredHeight: 10
+ }
+
+ DexAppButton {
+ id: submit_button
+ enabled: _keyChecker.isValid()
+ opacity: enabled ? 1 : .4
+ onClicked: {
+ trySubmit()
+ }
+ radius: 20
+ Layout.preferredWidth: _nextRow2.implicitWidth + 40
+ Layout.preferredHeight: 45
+ label.color: 'transparent'
+ Row {
+ id: _nextRow2
+ anchors.centerIn: parent
+ spacing: 10
+ DexLabel {
+ text: qsTr("Continue")
+ font: DexTypo.button
+ color: submit_button.foregroundColor
+ anchors.verticalCenter: parent.verticalCenter
+ }
+ Qaterial.ColorIcon {
+ anchors.verticalCenter: parent.verticalCenter
+ source: Qaterial.Icons.arrowRight
+ color: submit_button.foregroundColor
+ iconSize: 14
+ }
+ }
+ }
+ }
+
+ DefaultText {
+ text_value: text_error
+ color: Style.colorRed
+ visible: text !== ''
+ }
}
}
-}
+}
\ No newline at end of file
diff --git a/atomic_defi_design/qml/Settings/AddCustomCoinModal.qml b/atomic_defi_design/qml/Settings/AddCustomCoinModal.qml
index d144f13996..9ae0d79247 100644
--- a/atomic_defi_design/qml/Settings/AddCustomCoinModal.qml
+++ b/atomic_defi_design/qml/Settings/AddCustomCoinModal.qml
@@ -7,6 +7,7 @@ import AtomicDEX.CoinType 1.0
import "../Components"
import "../Constants"
+import App 1.0
BasicModal {
id: root
diff --git a/atomic_defi_design/qml/Settings/CamouflagePasswordModal.qml b/atomic_defi_design/qml/Settings/CamouflagePasswordModal.qml
index 885d75569a..e998ee8d9e 100644
--- a/atomic_defi_design/qml/Settings/CamouflagePasswordModal.qml
+++ b/atomic_defi_design/qml/Settings/CamouflagePasswordModal.qml
@@ -4,11 +4,12 @@ import QtQuick.Controls 2.15
import "../Components"
import "../Constants"
+import App 1.0
BasicModal {
id: root
- width: 1100
+ width: 800
onClosed: {
input_password.reset()
@@ -37,14 +38,14 @@ BasicModal {
anchors.horizontalCenter: parent.horizontalCenter
text_value: qsTr("Camouflage Password is a secret password for emergency situations.")
- font.pixelSize: Style.textSize2
+ font: DexTypo.head6
}
DefaultText {
width: parent.width - 40
horizontalAlignment: Text.AlignHCenter
anchors.horizontalCenter: parent.horizontalCenter
-
+ font: DexTypo.subtitle2
text_value: qsTr("Using it to login will display your balance lower than it actually is.")
}
@@ -52,7 +53,7 @@ BasicModal {
width: parent.width - 40
horizontalAlignment: Text.AlignHCenter
anchors.horizontalCenter: parent.horizontalCenter
-
+ font: DexTypo.subtitle2
text_value: qsTr("Here you enter the suffix and at login you need to enter {real_password}{suffix}")
}
}
@@ -67,15 +68,21 @@ BasicModal {
// Buttons
footer: [
- DefaultButton {
+ DexAppButton {
text: qsTr("Cancel")
- Layout.fillWidth: true
+ leftPadding: 40
+ rightPadding: 40
+ radius: 20
onClicked: root.close()
},
-
- PrimaryButton {
- text: qsTr("Save")
+ Item {
Layout.fillWidth: true
+ },
+ DexAppOutlineButton {
+ text: qsTr("Save")
+ leftPadding: 40
+ rightPadding: 40
+ radius: 20
enabled: input_password.isValid()
onClicked: {
API.app.wallet_mgr.set_emergency_password(input_password.field.text)
diff --git a/atomic_defi_design/qml/Settings/Combo_fiat.qml b/atomic_defi_design/qml/Settings/Combo_fiat.qml
index 16a4a20445..8154bfc7c8 100644
--- a/atomic_defi_design/qml/Settings/Combo_fiat.qml
+++ b/atomic_defi_design/qml/Settings/Combo_fiat.qml
@@ -12,6 +12,7 @@ import Qaterial 1.0 as Qaterial
// Project Imports
import "../Components"
import "../Constants"
+import App 1.0
ComboBoxWithTitle {
@@ -62,7 +63,8 @@ ComboBoxWithTitle {
delegate: DefaultText {
text: modelData
- color: fiats_mouse_area.containsMouse ? Style.colorText : Style.colorText2
+ color: DexTheme.foregroundColor
+ opacity: fiats_mouse_area.containsMouse ? .7 : 1
DefaultMouseArea {
id: fiats_mouse_area
diff --git a/atomic_defi_design/qml/Settings/DeleteWalletModal.qml b/atomic_defi_design/qml/Settings/DeleteWalletModal.qml
index 40e1f2f81f..8de6a1281f 100644
--- a/atomic_defi_design/qml/Settings/DeleteWalletModal.qml
+++ b/atomic_defi_design/qml/Settings/DeleteWalletModal.qml
@@ -4,6 +4,7 @@ import QtQuick.Controls 2.15
import "../Components"
import "../Constants"
+import App 1.0
BasicModal {
id: root
diff --git a/atomic_defi_design/qml/Settings/Languages.qml b/atomic_defi_design/qml/Settings/Languages.qml
index 02718f91a9..d407634bd2 100644
--- a/atomic_defi_design/qml/Settings/Languages.qml
+++ b/atomic_defi_design/qml/Settings/Languages.qml
@@ -5,44 +5,45 @@ import QtQuick.Controls 2.15
import QtGraphicalEffects 1.0
import "../Components"
import "../Constants"
+import App 1.0
ColumnLayout {
property alias show_label: label.visible
RowLayout {
Layout.alignment: Qt.AlignVCenter
- spacing: 20
- DefaultText {
+ spacing: 5
+ DexLabel {
id: label
visible: false
Layout.alignment: Qt.AlignVCenter
+ font: DexTypo.subtitle1
text_value: qsTr("Language") + ":"
- font.pixelSize: Style.textSizeSmall2
}
Grid {
Layout.alignment: Qt.AlignVCenter
+ Layout.fillWidth: true
clip: true
columns: 8
spacing: 10
- layoutDirection: Qt.LeftToRight
-
Repeater {
model: API.app.settings_pg.get_available_langs()
- delegate: AnimatedRectangle {
- width: image.sourceSize.width - 4 // Current icons have too much space around them
- height: image.sourceSize.height - 2
-
- color: API.app.settings_pg.lang === model.modelData ? Style.colorTheme11 : mouse_area.containsMouse ? Style.colorTheme4 : Style.applyOpacity(Style.colorTheme4)
+ delegate: ClipRRect {
+ width: 30 // Current icons have too much space around them
+ height: 30
+ radius: 15
+ //color: API.app.settings_pg.lang === model.modelData ? Style.colorTheme11 : mouse_area.containsMouse ? Style.colorTheme4 : Style.applyOpacity(Style.colorTheme4)
DefaultImage {
id: image
anchors.centerIn: parent
source: General.image_path + "lang/" + model.modelData + ".png"
- width: Style.textSize2
+ width: 40
+ height: 40
// Click area
DefaultMouseArea {
id: mouse_area
diff --git a/atomic_defi_design/qml/Settings/RecoverSeedModal.qml b/atomic_defi_design/qml/Settings/RecoverSeedModal.qml
index ddcc06c479..cd8fa089e1 100644
--- a/atomic_defi_design/qml/Settings/RecoverSeedModal.qml
+++ b/atomic_defi_design/qml/Settings/RecoverSeedModal.qml
@@ -6,6 +6,7 @@ import Qaterial 1.0 as Qaterial
import "../Components"
import "../Constants"
+import App 1.0
BasicModal {
id: root
@@ -135,7 +136,7 @@ BasicModal {
DefaultText {
Layout.leftMargin: 5
Layout.preferredWidth: 100
- text: "atomicDex"
+ text: API.app_name
font.pixelSize: Style.textSizeSmall5
}
@@ -220,16 +221,16 @@ BasicModal {
Component.onDestruction: portfolio_model.portfolio_proxy_mdl.setFilterFixedString("")
}
- DefaultListView {
+ DexListView {
id: coins_list
visible: false
enabled: false
Layout.fillWidth: true
- Layout.preferredHeight: 600
+ Layout.fillHeight: true
model: portfolio_mdl.portfolio_proxy_mdl
-
+
delegate: DefaultRectangle {
height: seed_container.height
width: seed_container.width
diff --git a/atomic_defi_design/qml/Settings/SettingModal.qml b/atomic_defi_design/qml/Settings/SettingModal.qml
index 100f5b36ae..daec67acfd 100644
--- a/atomic_defi_design/qml/Settings/SettingModal.qml
+++ b/atomic_defi_design/qml/Settings/SettingModal.qml
@@ -8,18 +8,40 @@ import QtQml 2.12
import QtQuick.Window 2.12
import QtQuick.Controls.Universal 2.12
+//! 3rdParty Imports
import Qaterial 1.0 as Qaterial
-// Project Imports
+//! Project Imports
import "../Components"
-import "../Constants"
+import "../Constants" as Constants
+import App 1.0
-Qaterial.Dialog {
+Qaterial.Dialog
+{
+ property alias selectedMenuIndex: menu_list.currentIndex
function disconnect() {
- API.app.disconnect()
- onDisconnect()
+ let dialog = app.showText({
+ "title": qsTr("Confirm Logout"),
+ text: qsTr("Are you sure you want to log out?") ,
+ standardButtons: Dialog.Yes | Dialog.Cancel,
+ warning: true,
+ width: 300,
+ iconSource: Qaterial.Icons.logout,
+ iconColor: DexTheme.accentColor,
+ yesButtonText: qsTr("Yes"),
+ cancelButtonText: qsTr("Cancel"),
+ onAccepted: function(text) {
+ app.notifications_list = []
+ app.currentWalletName = ""
+ API.app.disconnect()
+ onDisconnect()
+ dialog.close()
+ dialog.destroy()
+ }
+ })
+
}
readonly property string mm2_version: API.app.settings_pg.get_mm2_version()
@@ -29,7 +51,7 @@ Qaterial.Dialog {
id: setting_modal
- width: 850
+ width: 950
height: 650
anchors.centerIn: parent
dim: true
@@ -39,50 +61,44 @@ Qaterial.Dialog {
Overlay.modal: Item {
Rectangle {
anchors.fill: parent
- color: theme.surfaceColor
+ color: 'black'
opacity: .7
}
}
- background: FloatingBackground {
- color: theme.dexBoxBackgroundColor
- radius: 3
+ background: DexRectangle {
+ color: DexTheme.backgroundColor
+ border.width: 0
+ radius: 16
}
- padding: 0
- topPadding: 0
- bottomPadding: 0
+ padding: 20
+ topPadding: 30
+ bottomPadding: 30
Item {
width: parent.width
height: 60
- Qaterial.AppBarButton {
+ DexIconButton {
anchors.right: parent.right
- anchors.rightMargin: 10
- foregroundColor: theme.foregroundColor
- icon.source: Qaterial.Icons.close
+ anchors.rightMargin: 30
+ iconSize: 30
+ icon: Qaterial.Icons.close
anchors.verticalCenter: parent.verticalCenter
onClicked: setting_modal.close()
}
Row {
anchors.verticalCenter: parent.verticalCenter
- leftPadding: 20
- DexLabel {
- anchors.verticalCenter: parent.verticalCenter
- text: "Settings"
- font: theme.textType.head6
- }
+ leftPadding: 60
DexLabel {
+ id: settingLabel
anchors.verticalCenter: parent.verticalCenter
- text: " - "+qsTr(menu_list.model[menu_list.currentIndex])
- opacity: .5
- font: theme.textType.head6
+ text: qsTr("Settings")
+ font: Qt.font({
+ pixelSize: 20 ,
+ letterSpacing: 0.15,
+ family: DexTypo.fontFamily,
+ weight: Font.Normal
+ })
}
}
- Rectangle {
- anchors.bottom: parent.bottom
- color: theme.foregroundColor
- opacity: .10
- width: parent.width
- height: 1.5
- }
Qaterial.DebugRectangle {
anchors.fill: parent
@@ -97,37 +113,59 @@ Qaterial.Dialog {
anchors.fill: parent
Item {
Layout.fillHeight: true
- Layout.preferredWidth: 240
+ Layout.preferredWidth: 280
ListView {
id: menu_list
- anchors.fill: parent
+ height: parent.height
+ width: 200
+ anchors.horizontalCenter: parent.horizontalCenter
anchors.topMargin: 10
- spacing: 10
+ spacing: 5
currentIndex: 0
- model: [qsTr("General"),qsTr("Language"),qsTr("User Interface"),qsTr("Security"),qsTr("About"),qsTr("Version")]
- highlight: Item {
- width: menu_list.width-20
- x: 10
- height: 45
- Rectangle {
- anchors.fill: parent
- height: 45
- radius: 5
- color: theme.hightlightColor
+ model: [qsTr("General"),qsTr("Language"),qsTr("User Interface"),qsTr("Security"),qsTr("About & Version")]
+ delegate: DexRectangle {
+ width: parent.width
+ height: 60
+ radius: 22
+ border.width: 0
+ gradient: Gradient {
+ orientation: Qt.Horizontal
+ GradientStop {
+ position: 0.0
+ color: delegateMouseArea.containsMouse ? DexTheme.buttonColorEnabled : menu_list.currentIndex === index ? DexTheme.buttonColorHovered : 'transparent'
+ }
+ GradientStop {
+ position: 1
+ color: 'transparent'
+ }
}
- }
- delegate: DexSelectableButton {
- selected: false
- text: modelData
- onClicked: menu_list.currentIndex = index
+ DexLabel {
+ anchors.verticalCenter: parent.verticalCenter
+ text: modelData
+ width: parent.width
+ leftPadding: 20
+ font: Qt.font({
+ pixelSize: 17 ,
+ letterSpacing: 0.15,
+ family: DexTypo.fontFamily,
+ weight: Font.Normal
+ })
+ }
+
+ DexMouseArea {
+ id: delegateMouseArea
+ hoverEnabled: true
+ anchors.fill: parent
+ onClicked: menu_list.currentIndex = index
+ }
}
}
}
Rectangle {
Layout.fillHeight: true
- width: 2
- color: theme.foregroundColor
+ width: 1
+ color: DexTheme.foregroundColor
opacity: .10
}
Item {
@@ -149,6 +187,7 @@ Qaterial.Dialog {
DexLabel {
Layout.alignment: Qt.AlignVCenter
Layout.fillWidth: true
+ font: DexTypo.subtitle1
text: qsTr("Enable Desktop Notifications")
}
DefaultSwitch {
@@ -164,61 +203,48 @@ Qaterial.Dialog {
DexLabel {
Layout.alignment: Qt.AlignVCenter
Layout.fillWidth: true
+ font: DexTypo.subtitle1
text: qsTr("Maximum number of enabled coins")
}
DexComboBox {
id: enableable_coins_count_combo_box
+ Layout.preferredWidth: 100
+ radius: 20
model: [10, 20, 50, 75, 100, 150, 200]
currentIndex: model.indexOf(parseInt(atomic_settings2.value("MaximumNbCoinsEnabled")))
onCurrentIndexChanged: atomic_settings2.setValue("MaximumNbCoinsEnabled", model[currentIndex])
- delegate: ItemDelegate {
- width: enableable_coins_count_combo_box.width
- font.weight: enableable_coins_count_combo_box.currentIndex === index ? Font.DemiBold : Font.Normal
- highlighted: ListView.isCurrentItem
- enabled: parseInt(modelData) >= API.app.portfolio_pg.portfolio_mdl.length
- contentItem: DefaultText {
- color: enabled ? Style.colorWhite1 : Style.colorWhite8
- text: modelData
- }
- }
}
}
- RowLayout {
+
+ SettingsButton {
+ noBackground: true
width: parent.width-30
- anchors.horizontalCenter: parent.horizontalCenter
height: 50
- DexLabel {
- Layout.alignment: Qt.AlignVCenter
- Layout.fillWidth: true
- text: qsTr("Logs")
- }
- DexButton {
- text: qsTr("Open Folder")
- implicitHeight: 37
- onClicked: {
- openLogsFolder()
- }
- }
+ title: qsTr("Logs")
+ buttonText: qsTr("Open Folder")
+ onClicked: openLogsFolder()
}
- RowLayout {
+
+ SettingsButton {
width: parent.width-30
- anchors.horizontalCenter: parent.horizontalCenter
- height: 60
- DexLabel {
- Layout.alignment: Qt.AlignVCenter
- Layout.fillWidth: true
- text: qsTr("Reset assets configuration")
- }
- DexButton {
- text: qsTr("Reset")
- implicitHeight: 37
- onClicked: {
- restart_modal.open()
- restart_modal.item.task_before_restart = () => { API.app.settings_pg.reset_coin_cfg() }
- }
+ height: 50
+ title: qsTr("Reset assets configuration")
+ buttonText: qsTr("Reset")
+ onClicked: {
+ dialog = app.showText({
+ title: qsTr("Reset assets configuration"),
+ text: qsTr("This will reset your wallet config to default"),
+ standardButtons: Dialog.Yes | Dialog.Cancel,
+ yesButtonText: qsTr("Yes"),
+ cancelButtonText: qsTr("Cancel"),
+ onAccepted: function() {
+ restart_modal.open()
+ restart_modal.item.onTimerEnded = () => { API.app.settings_pg.reset_coin_cfg() }
+ }
+ })
+ dialog.close()
}
}
-
}
}
Item {
@@ -230,9 +256,10 @@ Qaterial.Dialog {
width: parent.width-30
anchors.horizontalCenter: parent.horizontalCenter
height: 30
+ spacing: 10
DexLabel {
Layout.alignment: Qt.AlignVCenter
- Layout.fillWidth: true
+ font: DexTypo.subtitle1
text: qsTr("Language") + ":"
}
Languages {
@@ -259,83 +286,53 @@ Qaterial.Dialog {
DexLabel {
Layout.alignment: Qt.AlignVCenter
Layout.fillWidth: true
- text: qsTr("Use QtTextRendering Or NativeTextRendering")
- }
- DefaultSwitch {
- id: render_switch
- property bool firstTime: true
- Layout.alignment: Qt.AlignHCenter
- Layout.leftMargin: combo_fiat.Layout.leftMargin
- Layout.rightMargin: Layout.leftMargin
- checked: parseInt(atomic_settings2.value("FontMode")) === 1
- }
- }
- RowLayout {
- width: parent.width-30
- anchors.horizontalCenter: parent.horizontalCenter
- height: 30
- DexLabel {
- Layout.alignment: Qt.AlignVCenter
- Layout.fillWidth: true
+ font: DexTypo.subtitle1
text: qsTr("Current Font")
}
- DexComboBox {
- id: dexFont
- editable: true
- Layout.alignment: Qt.AlignVCenter
- displayText: _font.fontFamily
- model: Qt.fontFamilies()
- Component.onCompleted: {
- let current = _font.fontFamily
- currentIndex = Qt.fontFamilies().indexOf(current)
- }
+ }
+ DexComboBox {
+ id: dexFont
+ editable: true
+ width: parent.width - 200
+ model: ["Ubuntu", "Montserrat", "Roboto"]
+ Component.onCompleted: {
+ let current = DexTypo.fontFamily
+ currentIndex = dexFont.model.indexOf(current)
}
}
RowLayout {
width: parent.width-30
anchors.horizontalCenter: parent.horizontalCenter
height: 30
+
DexLabel {
Layout.alignment: Qt.AlignVCenter
Layout.fillWidth: true
+ font: DexTypo.subtitle1
text: qsTr("Theme")
}
- DexComboBox {
- id: dexTheme
- Layout.alignment: Qt.AlignVCenter
- displayText: currentText.replace(".json","")
- model: API.qt_utilities.get_themes_list()
- Component.onCompleted: {
- let current = atomic_settings2.value("CurrentTheme")
- currentIndex = model.indexOf(current)
- }
+ }
+ DexComboBox {
+ id: dexTheme
+ width: parent.width - 200
+ displayText: currentText.replace(".json","")
+ model: API.qt_utilities.get_themes_list()
+ Component.onCompleted: {
+ let current = atomic_settings2.value("CurrentTheme")
+ currentIndex = model.indexOf(current)
}
}
- RowLayout {
+
+ SettingsButton {
width: parent.width-30
- anchors.horizontalCenter: parent.horizontalCenter
- height: 60
- DexLabel {
- Layout.alignment: Qt.AlignVCenter
- Layout.fillWidth: true
- text: qsTr("")
- }
- DexButton {
- text: qsTr("Apply Changes")
- implicitHeight: 37
- onClicked: {
- atomic_settings2.setValue("CurrentTheme", dexTheme.currentText)
- atomic_settings2.sync()
- app.load_theme(dexTheme.currentText.replace(".json",""))
- _font.fontFamily = dexFont.currentText
- let render_value = render_switch.checked? 1 : 0
- if(render_value == parseInt(atomic_settings2.value("FontMode"))){}
- else {
- atomic_settings2.setValue("FontMode", render_value)
- restart_modal.open()
- }
-
- }
+ height: 50
+ buttonText: qsTr("Apply Changes")
+ onClicked: {
+ atomic_settings2.setValue("CurrentTheme", dexTheme.currentText)
+ atomic_settings2.sync()
+ theme_manager.apply(dexTheme.currentText.replace(".json",""))
+ DexTypo.fontFamily = dexFont.currentText
+
}
}
}
@@ -345,16 +342,19 @@ Qaterial.Dialog {
anchors.fill: parent
topPadding: 10
spacing: 15
+
ModalLoader {
id: view_seed_modal
sourceComponent: RecoverSeedModal {}
}
+
ModalLoader {
id: eula_modal
sourceComponent: EulaModal {
close_only: true
}
}
+
ModalLoader {
id: camouflage_password_modal
sourceComponent: CamouflagePasswordModal {}
@@ -363,7 +363,6 @@ Qaterial.Dialog {
// Enabled 2FA option. (Disabled on Linux since the feature is not available on this platform yet)
RowLayout {
enabled: Qt.platform.os !== "linux" // Disable for Linux.
- Component.onCompleted: console.log(Qt.platform.os)
visible: enabled
width: parent.width-30
anchors.horizontalCenter: parent.horizontalCenter
@@ -371,10 +370,10 @@ Qaterial.Dialog {
DexLabel {
Layout.fillWidth: true
Layout.alignment: Qt.AlignVCenter
+ font: DexTypo.subtitle1
text: qsTr("Ask system's password before sending coins ? (2FA)")
}
DexSwitch {
- implicitHeight: 37
checked: parseInt(atomic_settings2.value("2FA")) === 1
onCheckedChanged: {
if (checked)
@@ -386,102 +385,59 @@ Qaterial.Dialog {
}
}
- RowLayout {
+ SettingsButton {
width: parent.width-30
- anchors.horizontalCenter: parent.horizontalCenter
- height: 60
- DexLabel {
- Layout.alignment: Qt.AlignVCenter
- Layout.fillWidth: true
- text: qsTr("View seed and private keys")
- }
- DexButton {
- text: qsTr("Show")
- implicitHeight: 37
- onClicked: view_seed_modal.open()
- }
+ height: 50
+ title: qsTr("View seed and private keys")
+ buttonText: qsTr("Show")
+ onClicked: view_seed_modal.open()
}
- RowLayout {
+ SettingsButton {
width: parent.width-30
- anchors.horizontalCenter: parent.horizontalCenter
- height: 60
- DexLabel {
- Layout.alignment: Qt.AlignVCenter
- Layout.fillWidth: true
- text: qsTr("Setup Camouflage Password")
- }
- DexButton {
- text: qsTr("Open")
- implicitHeight: 37
- onClicked: camouflage_password_modal.open()
- }
+ height: 50
+ title: qsTr("Setup Camouflage Password")
+ buttonText: qsTr("Open")
+ onClicked: camouflage_password_modal.open()
}
-
-
- RowLayout {
- width: parent.width-30
- anchors.horizontalCenter: parent.horizontalCenter
- height: 60
- DexLabel {
- Layout.alignment: Qt.AlignVCenter
- Layout.fillWidth: true
- //text:
- }
- DexButton {
- text: qsTr("Delete Wallet")
- implicitHeight: 37
- onClicked: {
- delete_wallet_modal.open()
- }
- }
- }
}
}
+
Item {
Column {
+ anchors.fill: parent
+ topPadding: 10
+ spacing: 15
ModalLoader {
id: delete_wallet_modal
sourceComponent: DeleteWalletModal {}
}
- anchors.fill: parent
- topPadding: 10
- spacing: 15
- RowLayout {
+
+ SettingsButton {
width: parent.width-30
- anchors.horizontalCenter: parent.horizontalCenter
- height: 60
- DexLabel {
- Layout.alignment: Qt.AlignVCenter
- Layout.fillWidth: true
- text: qsTr("Disclaimer and ToS")
- }
- DexButton {
- text: qsTr("Show")
- implicitHeight: 37
- onClicked: eula_modal.open()
- }
+ height: 50
+ title: qsTr("Disclaimer and ToS")
+ buttonText: qsTr("Show")
+ onClicked: eula_modal.open()
}
- }
- }
- Item {
- Column {
- anchors.fill: parent
- topPadding: 10
- spacing: 15
+
RowLayout {
width: parent.width-30
anchors.horizontalCenter: parent.horizontalCenter
height: 60
- DexLabel {
+ DexLabel
+ {
Layout.alignment: Qt.AlignVCenter
Layout.fillWidth: true
text: qsTr("Application version")
}
- DexLabel {
+ DexCopyableLabel
+ {
Layout.alignment: Qt.AlignVCenter
text: API.app.settings_pg.get_version()
+ onCopyNotificationTitle: qsTr("DEX Version")
+ onCopyNotificationMsg: qsTr("DEX Version copied to clipboard.")
}
}
RowLayout {
@@ -493,23 +449,30 @@ Qaterial.Dialog {
Layout.fillWidth: true
text: qsTr("MM2 version")
}
- DexLabel {
+ DexCopyableLabel
+ {
Layout.alignment: Qt.AlignVCenter
text: API.app.settings_pg.get_mm2_version()
+ onCopyNotificationTitle: qsTr("MM2 Version")
+ onCopyNotificationMsg: qsTr("MM2 Version copied to clipboard.")
}
}
RowLayout {
width: parent.width-30
anchors.horizontalCenter: parent.horizontalCenter
height: 60
- DexLabel {
+ DexLabel
+ {
Layout.alignment: Qt.AlignVCenter
Layout.fillWidth: true
text: qsTr("Qt version")
}
- DexLabel {
+ DexCopyableLabel
+ {
Layout.alignment: Qt.AlignVCenter
text: qtversion
+ onCopyNotificationTitle: qsTr("Qt Version")
+ onCopyNotificationMsg: qsTr("Qt Version copied to clipboard.")
}
}
}
@@ -517,81 +480,50 @@ Qaterial.Dialog {
}
}
}
-
- Qaterial.DebugRectangle {
- anchors.fill: parent
- visible: false
- }
}
Item {
width: parent.width
height: 50
anchors.bottom: parent.bottom
- DexSelectableButton {
- selected: true
- anchors.right: logout_button.left
- anchors.rightMargin: 10
- anchors.horizontalCenter: undefined
- anchors.verticalCenter: parent.verticalCenter
- text: ""
- height: 40
- width: _update_row.width+20
- Row {
- id: _update_row
- anchors.centerIn: parent
- Qaterial.ColorIcon {
- anchors.verticalCenter: parent.verticalCenter
- source: Qaterial.Icons.update
- }
- spacing: 10
- DexLabel {
- text: qsTr("Search Update")
- anchors.verticalCenter: parent.verticalCenter
- font: theme.textType.button
- }
- opacity: .6
- }
- onClicked: new_update_modal.open()
- }
- DexSelectableButton {
- id: logout_button
- selected: true
+ Row {
+ spacing: 10
anchors.right: parent.right
anchors.rightMargin: 10
- anchors.horizontalCenter: undefined
anchors.verticalCenter: parent.verticalCenter
- text: ""
- height: 40
- width: _logout_row.width+20
- Row {
- id: _logout_row
- anchors.centerIn: parent
- Qaterial.ColorIcon {
- anchors.verticalCenter: parent.verticalCenter
- source: Qaterial.Icons.logout
- }
- spacing: 10
- DexLabel {
- text: qsTr("Logout")
- anchors.verticalCenter: parent.verticalCenter
- font: theme.textType.button
- }
- opacity: .6
+
+ DexAppButton {
+ text: qsTr("Search Update")
+ height: 48
+ radius: 20
+ leftPadding: 20
+ rightPadding: 20
+ font: Qt.font({
+ pixelSize: 19,
+ letterSpacing: 0.15,
+ family: DexTypo.fontFamily,
+ weight: Font.Normal
+ })
+ onClicked: new_update_modal.open()
}
- onClicked: {
- disconnect()
- setting_modal.close()
+
+ DexAppButton {
+ text: qsTr("Logout")
+ color: containsMouse ? DexTheme.buttonColorHovered : 'transparent'
+ height: 48
+ radius: 20
+ font: Qt.font({
+ pixelSize: 19 ,
+ letterSpacing: 0.15,
+ family: DexTypo.fontFamily,
+ weight: Font.Normal
+ })
+ iconSource: Qaterial.Icons.logout
+ onClicked: {
+ disconnect()
+ setting_modal.close()
+ }
}
-
- }
-
- Rectangle {
- anchors.top: parent.top
- color: theme.foregroundColor
- opacity: .10
- width: parent.width
- height: 1.5
}
}
diff --git a/atomic_defi_design/qml/Settings/Settings.qml b/atomic_defi_design/qml/Settings/Settings.qml
index 9777bf1769..24240aaa19 100644
--- a/atomic_defi_design/qml/Settings/Settings.qml
+++ b/atomic_defi_design/qml/Settings/Settings.qml
@@ -9,6 +9,7 @@ import Qt.labs.settings 1.0
// Project Imports
import "../Components"
import "../Constants"
+import App 1.0
Item {
id: root
@@ -218,7 +219,7 @@ Item {
text: qsTr("Reset assets configuration")
onClicked: {
restart_modal.open()
- restart_modal.item.task_before_restart = () => { API.app.settings_pg.reset_coin_cfg() }
+ restart_modal.item.onTimerEnded = () => { API.app.settings_pg.reset_coin_cfg() }
}
}
diff --git a/atomic_defi_design/qml/Settings/SettingsButton.qml b/atomic_defi_design/qml/Settings/SettingsButton.qml
new file mode 100644
index 0000000000..30b7cb4470
--- /dev/null
+++ b/atomic_defi_design/qml/Settings/SettingsButton.qml
@@ -0,0 +1,52 @@
+import QtQuick 2.15
+import "../Components/"
+import App 1.0
+import Qaterial 1.0 as Qaterial
+
+Item {
+ id: control
+ property bool noBackground: false
+
+ signal clicked()
+
+ property string title
+ property string buttonText
+
+ anchors.horizontalCenter: parent.horizontalCenter
+
+ DexLabel {
+ anchors.verticalCenter: parent.verticalCenter
+ font: DexTypo.subtitle1
+ text: control.title // qsTr("Logs")
+ }
+
+ DexAppButton {
+ visible: control.noBackground
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.right: parent.right
+ text: control.buttonText
+ color: containsMouse ? DexTheme.buttonColorHovered : 'transparent'
+ height: 48
+ radius: 20
+ font: Qt.font({
+ pixelSize: 19 ,
+ letterSpacing: 0.15,
+ family: DexTypo.fontFamily,
+ underline: true,
+ weight: Font.Normal
+ })
+ iconSource: Qaterial.Icons.logout
+ onClicked: control.clicked()
+ }
+
+ DexAppOutlineButton {
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.right: parent.right
+ leftPadding: 20
+ rightPadding: 20
+ radius: 20
+ visible: !control.noBackground
+ text: control.buttonText //qsTr("Open Folder")
+ onClicked: control.clicked()
+ }
+}
\ No newline at end of file
diff --git a/atomic_defi_design/qml/Sidebar/Line.qml b/atomic_defi_design/qml/Sidebar/Line.qml
new file mode 100644
index 0000000000..f351ec3d1b
--- /dev/null
+++ b/atomic_defi_design/qml/Sidebar/Line.qml
@@ -0,0 +1,44 @@
+//! Qt Imports.
+import QtQuick 2.12
+
+//! Project Imports.
+import "../Components"
+import "../Constants"
+
+Item
+{
+ id: root
+
+ property alias label: _label
+
+ signal clicked()
+
+ height: Style.sidebarLineHeight
+
+ DexLabel
+ {
+ id: _label
+
+ anchors.left: parent.left
+ anchors.leftMargin: 70
+ anchors.verticalCenter: parent.verticalCenter
+
+ font: Qt.font({
+ pixelSize: 13 * DexTypo.fontDensity,
+ letterSpacing: 0.25,
+ family: DexTypo.fontFamily,
+ weight: Font.Normal
+ })
+ style: Text.Normal
+ color: _mouseArea.containsMouse ? Style.colorThemePassiveLight :
+ Style.colorThemePassive
+ }
+
+ DexMouseArea
+ {
+ id: _mouseArea
+ hoverEnabled: true
+ anchors.fill: parent
+ onClicked: root.clicked()
+ }
+}
diff --git a/atomic_defi_design/qml/Sidebar/Sidebar.qml b/atomic_defi_design/qml/Sidebar/Sidebar.qml
index d3f0a65c6a..3f840b5651 100644
--- a/atomic_defi_design/qml/Sidebar/Sidebar.qml
+++ b/atomic_defi_design/qml/Sidebar/Sidebar.qml
@@ -4,9 +4,12 @@ import QtQuick.Controls 2.15
import QtGraphicalEffects 1.0
-import "../Constants"
+import "../Constants" as Constants
+import App 1.0
import "../Components"
+import Qaterial 1.0 as Qaterial
+
Item {
id: sidebar
property bool expanded: dashboard.current_page===dashboard.idx_dashboard_exchange? false : true
@@ -20,43 +23,60 @@ Item {
}
}
- height: parent.height
+ height: parent.height+30
// Cursor
- AnimatedRectangle {
- id: cursor
- width: 185 - cursor_round_edge.radius
+
+ SidebarPanel {
+ id: left_rect
+ visible: true
+ width: parent.width
+ anchors.verticalCenter: parent.verticalCenter
+ height: 400
+ }
+
+ ClipRRect {
+ width: 185
+ height: DexTheme.sidebarHightLightHeight
+ radius: 1
anchors.right: parent.right
- height: Style.sidebarLineHeight + top_rect.radius*2
- transformOrigin: Item.Left
anchors.verticalCenter: cursor_round_edge.verticalCenter
- gradient: Gradient {
- orientation: Qt.Horizontal
-
- GradientStop {
- position: 0.0
- color: theme.navigationSideBarButtonGradient1
- }
- GradientStop {
- position: cursor_round_edge.radius / cursor.width
- color: theme.navigationSideBarButtonGradient1
- }
- GradientStop {
- position: 0.375
- color: theme.navigationSideBarButtonGradient2
- }
- GradientStop {
- position: 0.7292
- color: theme.navigationSideBarButtonGradient3
- }
- GradientStop {
- position: 1.0
- color: theme.navigationSideBarButtonGradient4
+ ClipRRect {
+ height: DexTheme.sidebarHightLightHeight
+ width: parent.width + 100
+ radius: 10
+ AnimatedRectangle {
+ id: cursor
+ width: 185
+ height: Constants.Style.sidebarLineHeight + top_rect.radius*2
+ opacity: .7
+ gradient: Gradient {
+ orientation: Qt.Horizontal
+
+ GradientStop {
+ position: 0.1255
+ color: DexTheme.navigationSideBarButtonGradient1
+ }
+ GradientStop {
+ position: 0.4283
+ color: DexTheme.navigationSideBarButtonGradient2
+ }
+ GradientStop {
+ position: 0.7143
+ color: DexTheme.navigationSideBarButtonGradient3
+ }
+ GradientStop {
+ position: 1
+ color: DexTheme.navigationSideBarButtonGradient4
+ }
+ }
}
}
+
}
+
// Top Rect
SidebarPanel {
id: top_rect
@@ -65,7 +85,6 @@ Item {
width: parent.width
anchors.top: parent.top
anchors.bottom: cursor_round_edge.top
-
}
// Bottom Rect
@@ -75,39 +94,16 @@ Item {
width: parent.width
anchors.top: cursor_round_edge.bottom
anchors.bottom: parent.bottom
-
- }
-
-
- // Left Rect
- SidebarPanel {
- id: left_rect
- anchors.left: top_rect.left
- anchors.top: top_rect.bottom
- anchors.bottom: bottom_rect.top
- anchors.right: cursor.left
- anchors.topMargin: -top_rect.border.width
- anchors.bottomMargin: anchors.topMargin
-
- border.width: 0
- radius: 0
-
- end_pos: top_rect.width*0.95 / width
}
-
// Cursor left edge
- AnimatedRectangle {
+ Item {
id: cursor_round_edge
- color: theme.navigationSideBarButtonGradient1
width: radius*2
-
+ opacity: 0
anchors.rightMargin: -width/2
- height: Style.sidebarLineHeight
- anchors.right: cursor.left
- visible: true
- radius: theme.rectangleRadius
-
+ height: Constants.Style.sidebarLineHeight
+ visible: false
y: {
switch(dashboard.current_page) {
case idx_dashboard_portfolio:
@@ -116,14 +112,14 @@ Item {
case idx_dashboard_addressbook:
case idx_dashboard_news:
case idx_dashboard_dapps:
- return sidebar_center.y + dashboard.current_page * Style.sidebarLineHeight
+ return sidebar_center.y + dashboard.current_page * Constants.Style.sidebarLineHeight
case idx_dashboard_settings:
case idx_dashboard_support:
- return sidebar_bottom.y + (dashboard.current_page - idx_dashboard_settings) * Style.sidebarLineHeight
+ return sidebar_bottom.y + (dashboard.current_page - idx_dashboard_settings) * Constants.Style.sidebarLineHeight
}
}
- Behavior on y { SmoothedAnimation { duration: Style.animationDuration; velocity: -1 } }
+ Behavior on y { SmoothedAnimation { duration: Constants.Style.animationDuration; velocity: -1 } }
}
// Content
@@ -134,7 +130,7 @@ Item {
DefaultImage {
id: app_logo
- source: expanded? "file:///"+ atomic_logo_path + "/"+ theme.bigSidebarLogo : "file:///"+atomic_logo_path + "/"+ theme.smallSidebarLogo
+ source: expanded? "file:///"+ atomic_logo_path + "/"+ DexTheme.bigSidebarLogo : "file:///"+atomic_logo_path + "/"+ DexTheme.smallSidebarLogo
anchors.horizontalCenter: parent.horizontalCenter
y: expanded? parent.width * 0.25 : parent.width * 0.40
transformOrigin: Item.Center
@@ -142,12 +138,12 @@ Item {
scale: expanded? 1 : .8
}
- Separator {
+ /* Separator {
anchors.bottom: version_text.top
anchors.bottomMargin: 6
width: parent.width-10
anchors.horizontalCenter: parent.horizontalCenter
- }
+ }*/
DexLabel {
id: version_text
@@ -157,9 +153,9 @@ Item {
width: parent.width-5
horizontalAlignment: DefaultText.AlignHCenter
wrapMode: DefaultText.Wrap
- text_value: General.version_string
- font: theme.textType.caption
- color: Style.colorThemeDarkLight
+ text_value: Constants.General.version_string
+ font: DexTypo.caption
+ color: Constants.Style.colorThemeDarkLight
}
SidebarCenter {
@@ -175,4 +171,14 @@ Item {
anchors.bottomMargin: parent.width * 0.25
}
}
+
+ DexRectangle {
+ anchors.right: parent.right
+ height: parent.height
+ width: 1
+ color: DexTheme.sideBarRightBorderColor
+ opacity: 1
+ border.width: 0
+ }
+
}
diff --git a/atomic_defi_design/qml/Sidebar/SidebarBottom.qml b/atomic_defi_design/qml/Sidebar/SidebarBottom.qml
index ccee298d7e..2d4f2dc97d 100644
--- a/atomic_defi_design/qml/Sidebar/SidebarBottom.qml
+++ b/atomic_defi_design/qml/Sidebar/SidebarBottom.qml
@@ -3,6 +3,7 @@ import QtQuick.Layouts 1.15
import QtQuick.Controls 2.15
import "../Constants"
+import App 1.0
ColumnLayout {
id: window_layout
@@ -31,6 +32,5 @@ ColumnLayout {
image: ""
Layout.fillWidth: true
separator: false
- checked: General.privacy_mode
}
}
diff --git a/atomic_defi_design/qml/Sidebar/SidebarCenter.qml b/atomic_defi_design/qml/Sidebar/SidebarCenter.qml
index 57bc90dd0e..80932d2070 100644
--- a/atomic_defi_design/qml/Sidebar/SidebarCenter.qml
+++ b/atomic_defi_design/qml/Sidebar/SidebarCenter.qml
@@ -5,6 +5,7 @@ import QtQuick.Controls 2.15
import Qaterial 1.0 as Qaterial
import "../Constants"
+import App 1.0
import "../Components"
ColumnLayout {
@@ -74,29 +75,18 @@ ColumnLayout {
text_value: sidebar.expanded ? qsTr("Fiat") : ""
image: General.image_path + "bill.svg"
Layout.fillWidth: true
- SidebarTooltip {
- text_value: qsTr("Fiat")
- }
- DefaultTooltip {
+ SidebarTooltip { text_value: qsTr("Fiat") }
+
+ DexTooltip
+ {
enabled: false
id: fiat_coming_soon
- text: qsTr("Coming soon !")
visible: parent.mouse_area.containsMouse
+ contentItem: DexRectangle
+ {
+ DexLabel { text: qsTr("Coming soon !"); anchors.centerIn: parent }
+ }
}
}
-
-// SidebarLine {
-// dashboard_index: idx_dashboard_news
-// text_value: qsTr("News")
-// image: General.image_path + "menu-news-white.svg"
-// Layout.fillWidth: true
-// }
-
-// SidebarLine {
-// dashboard_index: idx_dashboard_dapps
-// text_value: qsTr("Dapps")
-// image: General.image_path + "menu-dapp-white.svg"
-// Layout.fillWidth: true
-// }
}
diff --git a/atomic_defi_design/qml/Sidebar/SidebarLine.qml b/atomic_defi_design/qml/Sidebar/SidebarLine.qml
index 92ca76a277..0cb176e8ae 100644
--- a/atomic_defi_design/qml/Sidebar/SidebarLine.qml
+++ b/atomic_defi_design/qml/Sidebar/SidebarLine.qml
@@ -4,7 +4,8 @@ import QtQuick.Controls 2.15
import QtGraphicalEffects 1.0
import "../Components"
-import "../Constants"
+import "../Constants" as Constants
+import App 1.0
Item {
id: root
@@ -20,16 +21,17 @@ Item {
readonly property bool selected: dashboard.current_page === dashboard_index
function toggleDarkUI() {
- Style.dark_theme = !Style.dark_theme
+ Constants.Style.dark_theme = !Constants.Style.dark_theme
}
function togglePrivacyMode() {
- General.privacy_mode = !General.privacy_mode
+ Constants.General.privacy_mode = !Constants.General.privacy_mode
+ switch_input.checked = Constants.General.privacy_mode
}
- height: Style.sidebarLineHeight
+ height: Constants.Style.sidebarLineHeight
- DefaultSwitch {
+ DexSwitch {
id: switch_input
visible: dashboard_index === idx_dashboard_light_ui ||
dashboard_index === idx_dashboard_privacy_mode
@@ -44,12 +46,13 @@ Item {
height: txt.font.pixelSize * 1.4
anchors.left: parent.left
anchors.leftMargin: 30
- scale: 1.2
+ scale: 1
anchors.verticalCenter: parent.verticalCenter
visible: false
}
+
DropShadow {
- visible: selected
+ visible: false//selected
anchors.fill: img
source: img
cached: false
@@ -63,12 +66,13 @@ Item {
color: "#40000000"
smooth: true
}
+
DefaultColorOverlay {
id: img_color
visible: img.source != ""
anchors.fill: img
source: img
- color: txt.font.weight === Font.Medium ? Style.colorSidebarIconHighlighted : txt.color
+ color: txt.font.weight === Font.Medium ? DexTheme.foregroundColor : txt.color
}
DexLabel {
@@ -76,29 +80,30 @@ Item {
anchors.left: parent.left
anchors.leftMargin: 70
anchors.verticalCenter: parent.verticalCenter
- scale: Qt.platform.os==="windows"? 1.2 : API.app.settings_pg.lang=="fr"? 0.85 : 1
+ //scale: Qt.platform.os==="windows"? 1.2 : API.app.settings_pg.lang=="fr"? 0.85 : 1
font: Qt.font({
- pixelSize: 16*_font.fontDensity*_font.languageDensity,
- letterSpacing: 0.5,
- family: _font.fontFamily,
+ pixelSize: 13 * DexTypo.fontDensity,
+ letterSpacing: 0.25,
+ family: DexTypo.fontFamily,
weight: Font.Normal
})
- color: !section_enabled ? Style.colorTextDisabled :
- selected ? Style.colorSidebarSelectedText :
- mouse_area.containsMouse ? Style.colorThemePassiveLight :
- Style.colorThemePassive
+ style: Text.Normal
+ color: !section_enabled ? Constants.Style.colorTextDisabled :
+ selected ? Constants.Style.colorSidebarSelectedText :
+ mouse_area.containsMouse ? Constants.Style.colorThemePassiveLight :
+ Constants.Style.colorThemePassive
}
DropShadow {
- visible: selected
+ visible: false//selected
anchors.fill: txt
source: txt
cached: false
horizontalOffset: 0
- verticalOffset: 3
- radius: 3
+ verticalOffset: 1
+ radius: 0
samples: 4
spread: 0
- scale: Qt.platform.os==="windows"? 1.2 : API.app.settings_pg.lang=="fr"? 0.85 : 1
+ scale: txt.scale
color: "#40000000"
smooth: true
}
diff --git a/atomic_defi_design/qml/Sidebar/SidebarTooltip.qml b/atomic_defi_design/qml/Sidebar/SidebarTooltip.qml
index 59d2abb0c2..6c8f4354de 100644
--- a/atomic_defi_design/qml/Sidebar/SidebarTooltip.qml
+++ b/atomic_defi_design/qml/Sidebar/SidebarTooltip.qml
@@ -4,7 +4,7 @@ import QtQuick.Controls 2.15
import Qaterial 1.0 as Qaterial
-import "../Constants"
+import App 1.0
import "../Components"
Qaterial.ToolTip
@@ -13,7 +13,8 @@ Qaterial.ToolTip
property string text_value: ""
contentItem: DexLabel {
text: qsTr(_control.text_value)
- font: theme.textType.caption
+ font: DexTypo.caption
+ color: DexTheme.foregroundColor
padding: 5
}
visible: parent.mouse_area.containsMouse && !sidebar.expanded
diff --git a/atomic_defi_design/qml/Support/FAQLine.qml b/atomic_defi_design/qml/Support/FAQLine.qml
index 49dc29595e..6ca1d25975 100644
--- a/atomic_defi_design/qml/Support/FAQLine.qml
+++ b/atomic_defi_design/qml/Support/FAQLine.qml
@@ -5,8 +5,10 @@ import QtQuick.Controls 2.15
import QtGraphicalEffects 1.0
import "../Components"
import "../Constants"
+import App 1.0
TextWithTitle {
expandable: true
Layout.fillWidth: true
+ Layout.rightMargin: 10
}
diff --git a/atomic_defi_design/qml/Support/Support.qml b/atomic_defi_design/qml/Support/Support.qml
index 38f6e692ba..9780db96a5 100644
--- a/atomic_defi_design/qml/Support/Support.qml
+++ b/atomic_defi_design/qml/Support/Support.qml
@@ -6,18 +6,19 @@ import QtGraphicalEffects 1.0
import "../Components"
import "../Constants"
+import App 1.0
+
Item {
id: root
- DefaultFlickable {
+ DexFlickable {
id: layout_background
- anchors.fill: parent
- anchors.leftMargin: 20
- anchors.rightMargin: anchors.leftMargin
- anchors.bottomMargin: anchors.leftMargin
-
- contentWidth: width
+ width: parent.width - 20
+ height: parent.height - 20
+ y: 10
+ x: 20
+ contentWidth: width - 20
contentHeight: content_layout.height
ColumnLayout {
@@ -149,7 +150,7 @@ Network fees can vary greatly depending on your selected trading pair.").arg(API
FAQLine {
title: qsTr("Do you provide user support?")
- text: qsTr('Yes! %1 offers support through the Komodo Discord server . The team and the community are always happy to help!').arg(API.app_name)
+ text: qsTr('Yes! %1 offers support through the %1 Discord server . The team and the community are always happy to help!').arg(API.app_name).arg(API.app_discord_url)
}
FAQLine {
@@ -164,7 +165,7 @@ Network fees can vary greatly depending on your selected trading pair.").arg(API
FAQLine {
title: qsTr("Which devices can I use %1 on?").arg(API.app_name)
- text: qsTr('%1 is available for mobile on both Android and iPhone, and for desktop on Windows, Mac, and Linux operating systems.').arg(API.app_name)
+ text: qsTr('%1 is available for mobile on both Android and iPhone, and for desktop on Windows, Mac, and Linux operating systems.').arg(API.app_name).arg(API.app_website_url)
}
FAQLine {
diff --git a/atomic_defi_design/qml/Tests/ThemeTest.qml b/atomic_defi_design/qml/Tests/ThemeTest.qml
new file mode 100644
index 0000000000..f3358a2c71
--- /dev/null
+++ b/atomic_defi_design/qml/Tests/ThemeTest.qml
@@ -0,0 +1,311 @@
+import QtQuick 2.15
+import Qaterial 1.0 as Qaterial
+import App 1.0
+
+import "../Components/"
+
+Item {
+
+ id: root
+ property color backgroundColor: '#15182A'
+
+ Rectangle
+ {
+ id: rect
+ anchors.fill: parent
+ color: Qt.rgba(.0, .0, .0,.11)
+ }
+
+ function rgba255to1(n) {
+ return (parseInt(n)*1) / 255
+ }
+
+ Component.onCompleted: {
+ console.log(DexTheme.contentColorTop)
+ }
+
+
+ Flickable {
+
+ anchors.fill: parent
+ contentHeight: col.height
+ Column {
+ id: col
+ padding: 10
+ spacing: 20
+ DexAppButton {
+ width: 200
+ text: "Prepare"
+ }
+
+ DexAppOutlineButton {
+ width: 200
+ text: "Prepare"
+ }
+
+ DexAppButton {
+ text: "disabled"
+ enabled: false
+ }
+
+ DexAppTextField {
+ placeholderText: "Input"
+ }
+ DexSlider {
+
+ }
+ DexComboBox {
+ model: ["1233","DDSDD","DFDSS"]
+ }
+
+ DexRectangle {
+ width: 500
+ height: 250
+ }
+
+ DexLabel {
+ text: "Background Darker"
+ }
+ Row {
+ spacing: 10
+ Repeater {
+ model: [
+ {color: DexTheme.backgroundDarkColor0, name: "bg0"},
+ {color: DexTheme.backgroundDarkColor1, name: "bg1"},
+ {color: DexTheme.backgroundDarkColor2, name: "bg2"},
+ {color: DexTheme.backgroundDarkColor3, name: "bg3"},
+ {color: DexTheme.backgroundDarkColor4, name: "bg4"},
+ {color: DexTheme.backgroundDarkColor5, name: "bg5"},
+ {color: DexTheme.backgroundDarkColor6, name: "bg6"},
+ {color: DexTheme.backgroundDarkColor7, name: "bg7"},
+ {color: DexTheme.backgroundDarkColor8, name: "bg8"},
+ {color: DexTheme.backgroundDarkColor9, name: "bg9"}
+ ]
+ DexRectangle {
+ width: 80
+ height: 60
+ color: modelData['color']
+ DexLabel {
+ anchors.centerIn: parent
+ horizontalAlignment: Text.AlignHCenter
+ text: modelData['name']
+ color: "cyan"
+ }
+ }
+ }
+ }
+ DexLabel {
+ text: "Background Lighter"
+ }
+ Row {
+ spacing: 10
+ Repeater {
+ model: [
+ {color: DexTheme.backgroundLightColor0, name: "bg"},
+ {color: DexTheme.backgroundLightColor1, name: "bg1"},
+ {color: DexTheme.backgroundLightColor2, name: "bg2"},
+ {color: DexTheme.backgroundLightColor3, name: "bg3"},
+ {color: DexTheme.backgroundLightColor4, name: "bg4"},
+ {color: DexTheme.backgroundLightColor5, name: "bg5"}
+ ]
+ DexRectangle {
+ width: 80
+ height: 60
+ color: modelData['color']
+ DexLabel {
+ anchors.centerIn: parent
+ horizontalAlignment: Text.AlignHCenter
+ text: modelData['name']
+ color: "cyan"
+ }
+ }
+ }
+ }
+
+
+
+ DexLabel {
+ text: "Accent Darker"
+ }
+ Row {
+ spacing: 10
+ Repeater {
+ model: [
+ {color: DexTheme.accentDarkColor0, name: "bg0"},
+ {color: DexTheme.accentDarkColor1, name: "bg1"},
+ {color: DexTheme.accentDarkColor2, name: "bg2"},
+ {color: DexTheme.accentDarkColor3, name: "bg3"},
+ {color: DexTheme.accentDarkColor4, name: "bg4"},
+ {color: DexTheme.accentDarkColor5, name: "bg5"},
+ {color: DexTheme.accentDarkColor6, name: "bg6"},
+ {color: DexTheme.accentDarkColor7, name: "bg7"},
+ {color: DexTheme.accentDarkColor8, name: "bg8"},
+ {color: DexTheme.accentDarkColor9, name: "bg9"}
+ ]
+ DexRectangle {
+ width: 80
+ height: 60
+ color: modelData['color']
+ DexLabel {
+ anchors.centerIn: parent
+ horizontalAlignment: Text.AlignHCenter
+ text: modelData['name']
+ color: "cyan"
+ }
+ }
+ }
+ }
+
+ DexLabel {
+ text: "Accent Lighter"
+ }
+ Row {
+ spacing: 10
+ Repeater {
+ model: [
+ {color: DexTheme.accentLightColor0, name: "bg"},
+ {color: DexTheme.accentLightColor1, name: "bg1"},
+ {color: DexTheme.accentLightColor2, name: "bg2"},
+ {color: DexTheme.accentLightColor3, name: "bg3"},
+ {color: DexTheme.accentLightColor4, name: "bg4"},
+ {color: DexTheme.accentLightColor5, name: "bg5"}
+ ]
+ DexRectangle {
+ width: 80
+ height: 60
+ color: modelData['color']
+ DexLabel {
+ anchors.centerIn: parent
+ horizontalAlignment: Text.AlignHCenter
+ text: modelData['name']
+ color: "cyan"
+ }
+ }
+ }
+ }
+
+ DexLabel {
+ text: "Primary Darker"
+ }
+ Row {
+ spacing: 10
+ Repeater {
+ model: [
+ {color: DexTheme.primaryColorDarkColor0, name: "P 0"},
+ {color: DexTheme.primaryColorDarkColor1, name: "P 1"},
+ {color: DexTheme.primaryColorDarkColor2, name: "P 2"},
+ {color: DexTheme.primaryColorDarkColor3, name: "P 3"},
+ {color: DexTheme.primaryColorDarkColor4, name: "P 4"},
+ {color: DexTheme.primaryColorDarkColor5, name: "P 5"},
+ {color: DexTheme.primaryColorDarkColor6, name: "P 6"},
+ {color: DexTheme.primaryColorDarkColor7, name: "P 7"},
+ {color: DexTheme.primaryColorDarkColor8, name: "P 8"},
+ {color: DexTheme.primaryColorDarkColor9, name: "P 9"}
+ ]
+ DexRectangle {
+ width: 80
+ height: 60
+ color: modelData['color']
+ DexLabel {
+ anchors.centerIn: parent
+ horizontalAlignment: Text.AlignHCenter
+ text: modelData['name']
+ color: "cyan"
+ }
+ }
+ }
+ }
+
+ DexLabel {
+ text: "Primary Lighter"
+ }
+ Row {
+ spacing: 10
+ Repeater {
+ model: [
+ {color: DexTheme.primaryColorLightColor0, name: "P "},
+ {color: DexTheme.primaryColorLightColor1, name: "P 1"},
+ {color: DexTheme.primaryColorLightColor2, name: "P 2"},
+ {color: DexTheme.primaryColorLightColor3, name: "P 3"},
+ {color: DexTheme.primaryColorLightColor4, name: "P 4"},
+ {color: DexTheme.primaryColorLightColor5, name: "P 5"}
+ ]
+ DexRectangle {
+ width: 80
+ height: 60
+ color: modelData['color']
+ DexLabel {
+ anchors.centerIn: parent
+ horizontalAlignment: Text.AlignHCenter
+ text: modelData['name']
+ color: "cyan"
+ }
+ }
+ }
+ }
+
+ DexLabel {
+ text: "Foreground Darker"
+ }
+
+ Row {
+ spacing: 10
+ Repeater {
+ model: [
+ {color: DexTheme.foregroundColorDarkColor0, name: "F 0"},
+ {color: DexTheme.foregroundColorDarkColor1, name: "F 1"},
+ {color: DexTheme.foregroundColorDarkColor2, name: "F 2"},
+ {color: DexTheme.foregroundColorDarkColor3, name: "F 3"},
+ {color: DexTheme.foregroundColorDarkColor4, name: "F 4"},
+ {color: DexTheme.foregroundColorDarkColor5, name: "F 5"},
+ {color: DexTheme.foregroundColorDarkColor6, name: "F 6"},
+ {color: DexTheme.foregroundColorDarkColor7, name: "F 7"},
+ {color: DexTheme.foregroundColorDarkColor8, name: "F 8"},
+ {color: DexTheme.foregroundColorDarkColor9, name: "F 9"}
+ ]
+ DexRectangle {
+ width: 80
+ height: 60
+ color: modelData['color']
+ DexLabel {
+ anchors.centerIn: parent
+ horizontalAlignment: Text.AlignHCenter
+ text: modelData['name']
+ color: "cyan"
+ }
+ }
+ }
+ }
+
+ DexLabel {
+ text: "Foreground Lighter"
+ }
+ Row {
+ spacing: 10
+ Repeater {
+ model: [
+ {color: DexTheme.foregroundColorLightColor0, name: "F "},
+ {color: DexTheme.foregroundColorLightColor1, name: "F 1"},
+ {color: DexTheme.foregroundColorLightColor2, name: "F 2"},
+ {color: DexTheme.foregroundColorLightColor3, name: "F 3"},
+ {color: DexTheme.foregroundColorLightColor4, name: "F 4"},
+ {color: DexTheme.foregroundColorLightColor5, name: "F 5"}
+ ]
+ DexRectangle {
+ width: 80
+ height: 60
+ color: modelData['color']
+ DexLabel {
+ anchors.centerIn: parent
+ horizontalAlignment: Text.AlignHCenter
+ text: modelData['name']
+ color: "cyan"
+ }
+ }
+ }
+ }
+
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/atomic_defi_design/qml/Wallet/AddressBook.qml b/atomic_defi_design/qml/Wallet/AddressBook.qml
index adf3f3ab35..f14fb5096d 100644
--- a/atomic_defi_design/qml/Wallet/AddressBook.qml
+++ b/atomic_defi_design/qml/Wallet/AddressBook.qml
@@ -10,6 +10,7 @@ import Qaterial 1.0 as Qaterial
// Project Imports
import "../Components"
import "../Constants"
+import App 1.0
ColumnLayout {
id: root
@@ -17,84 +18,105 @@ ColumnLayout {
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: 100
+ Layout.preferredHeight: 80
- DefaultText { // Title
- anchors.left: parent.left
- anchors.leftMargin: 15
- anchors.top: parent.top
- anchors.topMargin: 10
+ DexLabel { // Title
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.left: parent.left
+ anchors.leftMargin: 10
text_value: qsTr("Address Book")
- font.weight: Font.Medium
- font.pixelSize: Style.textSize3
+ font: DexTypo.head6
}
- DefaultTextField { // Search input
- id: searchbar
- width: 400
- anchors.left: parent.left
- anchors.leftMargin: 20
- anchors.bottom: parent.bottom
- anchors.topMargin: 10
-
- Layout.fillWidth: true
- placeholderText: qsTr("Search a contact by name or tags")
- onTextChanged: addressbook_pg.model.proxy.search_exp = text
-
- Component.onDestruction: addressbook_pg.model.proxy.search_exp = ""
- }
-
- PrimaryButton { // New Contact Button
+ DexGradientAppButton {
+
anchors.right: parent.right
- anchors.rightMargin: 30
+ 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: 30
+ Layout.preferredHeight: 40
+ Layout.rightMargin: 10
+ Layout.leftMargin: 10
- HorizontalLine {
- anchors.top: parent.top
- width: parent.width
- color: Style.colorWhite5
- }
- DefaultText {
+ DexLabel {
id: header_name_column
anchors.left: parent.left
anchors.leftMargin: 20
anchors.verticalCenter: parent.verticalCenter
- color: Style.colorWhite4
+ font.bold: true
text: qsTr("Name")
}
- DefaultText {
+ DexLabel {
id: header_tags_column
anchors.left: header_name_column.right
anchors.leftMargin: 180
anchors.verticalCenter: parent.verticalCenter
- color: Style.colorWhite4
+ font.bold: true
text: qsTr("Tags (first 6)")
}
- DefaultText {
+ DexLabel {
anchors.right: parent.right
anchors.rightMargin: parent.width * 0.138
anchors.verticalCenter: parent.verticalCenter
- color: Style.colorWhite4
+ font.bold: true
text: qsTr("Actions")
}
@@ -111,6 +133,9 @@ ColumnLayout {
Layout.fillWidth: true
Layout.fillHeight: true
+ Layout.rightMargin: 10
+ Layout.leftMargin: 10
+
model: addressbook_pg.model.proxy
// Contact Card
@@ -119,7 +144,7 @@ ColumnLayout {
property var contact: modelData
- color: Qt.lighter(index % 2 == 0 ? Style.colorTheme6 : Style.colorTheme7, 1.0)
+ color: Qt.lighter(index % 2 == 0 ? DexTheme.backgroundColor : DexTheme.surfaceColor, 1.0)
width: root.width
height: 55
@@ -164,7 +189,7 @@ ColumnLayout {
outlined: false
text: modelData
icon.source: Qaterial.Icons.tag
- elide: Text.ElideRight
+ //elide: Text.ElideRight
onClicked: searchbar.text = modelData
}
diff --git a/atomic_defi_design/qml/Wallet/AddressBookAddContactAddressModal.qml b/atomic_defi_design/qml/Wallet/AddressBookAddContactAddressModal.qml
index 83fdeecee5..26f0e45df8 100644
--- a/atomic_defi_design/qml/Wallet/AddressBookAddContactAddressModal.qml
+++ b/atomic_defi_design/qml/Wallet/AddressBookAddContactAddressModal.qml
@@ -1,13 +1,16 @@
// 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"
// Contact address entry creation/edition modal
-BasicModal {
+BasicModal
+{
id: root
property var contactModel
@@ -24,25 +27,49 @@ BasicModal {
property string oldKey
property string oldValue
- width: 400
+ 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
+ }
- ModalContent {
+ width: 600
+
+ Component.onCompleted: API.app.wallet_pg.validate_address_data = {}
+ Component.onDestruction: API.app.wallet_pg.validate_address_data = {}
+
+ ModalContent
+ {
Layout.topMargin: 5
Layout.fillWidth: true
title: isEdition ? qsTr("Edit address entry") : qsTr("Create a new address")
// Wallet Type Selector
- DefaultButton {
- implicitWidth: parent.width
+ DexButton
+ {
+ Layout.alignment: Qt.AlignHCenter
+ Layout.fillWidth: true
- text: qsTr("Choose a wallet type, current: %1").arg(walletType === "" ? "NONE" : walletType)
+ text: qsTr("Selected wallet: %1").arg(walletType !== "" ? walletType : qsTr("NONE"))
onClicked: wallet_type_list_modal.open()
}
// Address Key Field
- DefaultTextField {
+ DefaultTextField
+ {
id: contact_new_address_key
Layout.topMargin: 5
@@ -50,24 +77,25 @@ BasicModal {
placeholderText: qsTr("Enter a name")
- onTextChanged: {
+ onTextChanged:
+ {
const max_length = 30
if (text.length > max_length)
text = text.substring(0, max_length)
}
// Error tooltip when key already exists.
- DefaultTooltip {
+ DefaultTooltip
+ {
id: key_already_exists_tooltip
visible: false
- contentItem: DefaultText {
- text_value: qsTr("This key already exists.")
- }
+ contentItem: DefaultText { text_value: qsTr("This key already exists.") }
}
}
// Address Value Field
- DefaultTextField {
+ DefaultTextField
+ {
id: contact_new_address_value
Layout.topMargin: 5
@@ -75,53 +103,112 @@ BasicModal {
placeholderText: qsTr("Enter the address")
- onTextChanged: {
+ onTextChanged:
+ {
const max_length = 50
if (text.length > max_length)
text = text.substring(0, max_length)
}
- }
- HorizontalLine {
- Layout.fillWidth: true
+ DexLabel
+ {
+ id: invalidAddressMsgLabel
+ anchors.top: parent.bottom
+ anchors.topMargin: 3
+ anchors.horizontalCenter: parent.horizontalCenter
+ color: DexTheme.redColor
+ wrapMode: DexLabel.Wrap
+ width: 550
+ }
}
- RowLayout {
- PrimaryButton {
- text: qsTr("Validate")
+ HorizontalLine { Layout.fillWidth: true; Layout.topMargin: 32 }
- onClicked: {
- 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
- }
- }
+ Item
+ {
+ width: root.width - 50
+ height: 40
- enabled: key.length > 0 && value.length > 0 && walletType !== ""
+ DexButton
+ {
+ id: validateButton
+ anchors.left: parent.left
+ 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 {
+ DexButton
+ {
+ anchors.right: parent.right
text: qsTr("Cancel")
-
onClicked: root.close()
}
+
+ DexButton
+ {
+ anchors.left: validateButton.right
+ anchors.leftMargin: 10
+ 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);
+ }
}
+ 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 {
+ ModalLoader
+ {
id: wallet_type_list_modal
property string selected_wallet_type: ""
diff --git a/atomic_defi_design/qml/Wallet/AddressBookEditContactModal.qml b/atomic_defi_design/qml/Wallet/AddressBookEditContactModal.qml
index 67fdda5562..0c0a2d0888 100644
--- a/atomic_defi_design/qml/Wallet/AddressBookEditContactModal.qml
+++ b/atomic_defi_design/qml/Wallet/AddressBookEditContactModal.qml
@@ -12,6 +12,7 @@ import Qaterial 1.0 as Qaterial
// Project Imports
import "../Components"
import "../Constants"
+import App 1.0
BasicModal {
id: root
@@ -92,8 +93,14 @@ BasicModal {
}
// Addresses Table
- TableView {
- id: wallet_info_table
+ TableView
+ {
+ id: walletInfoTable
+
+ property int _typeColWidth: 90
+ property int _keyColWidth: 100
+ property int _addressColWidth: 320
+ property int _actionsColWidth: 60
model: contactModel.proxy_filter
@@ -103,25 +110,28 @@ BasicModal {
backgroundVisible: false
frameVisible: false
- headerDelegate: RowLayout {
- Layout.preferredWidth: styleData.column === 0 ? 90 :
- styleData.column === 1 ? 100 :
- styleData.column === 2 ? 320 :
- 60
+ headerDelegate: RowLayout
+ {
+ Layout.preferredWidth: styleData.column === 0 ? walletInfoTable._typeColWidth :
+ styleData.column === 1 ? walletInfoTable._keyColWidth :
+ styleData.column === 2 ? walletInfoTable._addressColWidth :
+ walletInfoTable._actionsColWidth
- AnimatedRectangle {
+ Item
+ {
Layout.fillWidth: true
height: 20
- color: Style.colorRectangleBorderGradient1
+
- DefaultText {
- Layout.topMargin: 5
- Layout.leftMargin: 1
+ DefaultText
+ {
+ anchors.verticalCenter: parent.verticalCenter
text: styleData.value
}
- VerticalLine {
+ VerticalLine
+ {
visible: styleData.column !== 3
Layout.alignment: Qt.AlignRight
Layout.fillHeight: true
@@ -129,14 +139,15 @@ BasicModal {
}
}
- rowDelegate: DefaultRectangle {
- height: 37
- radius: 0
- color: styleData.selected ? Style.colorBlue : styleData.alternate ? Style.colorRectangle : Style.colorRectangleBorderGradient2
+ rowDelegate: DefaultRectangle
+ {
+ height: 37; radius: 0
+ color: styleData.selected ? DexTheme.accentLightColor4: styleData.alternate ? DexTheme.accentDarkColor4 : 'transparent'
}
- TableViewColumn { // Type Column
- width: 90
+ TableViewColumn // Type Column
+ {
+ width: walletInfoTable._typeColWidth
role: "address_type"
title: qsTr("Type")
@@ -144,22 +155,28 @@ BasicModal {
resizable: false
movable: false
- delegate: RowLayout {
- DefaultText {
+ delegate: RowLayout
+ {
+ DexLabel
+ {
+ Layout.preferredWidth: parent.width - 10
Layout.leftMargin: 3
text: styleData.row >= 0 ? styleData.value : ""
font.pixelSize: Style.textSizeSmall3
+ elide: Text.ElideRight
}
- VerticalLine {
+ VerticalLine
+ {
Layout.alignment: Qt.AlignRight
Layout.fillHeight: true
}
}
}
- TableViewColumn { // Key Column
- width: 100
+ TableViewColumn // Key Column
+ {
+ width: walletInfoTable._keyColWidth
role: "address_key"
title: qsTr("Key")
@@ -167,22 +184,28 @@ BasicModal {
resizable: false
movable: false
- delegate: RowLayout {
- DefaultText {
+ delegate: RowLayout
+ {
+ DefaultText
+ {
+ Layout.preferredWidth: parent.width - 10
Layout.leftMargin: 3
text: styleData.row >= 0 ? styleData.value : ""
font.pixelSize: Style.textSizeSmall3
+ elide: Text.ElideRight
}
- VerticalLine {
+ VerticalLine
+ {
Layout.alignment: Qt.AlignRight
Layout.fillHeight: true
}
}
}
- TableViewColumn { // Address Column
- width: 320
+ TableViewColumn
+ {
+ width: walletInfoTable._addressColWidth
role: "address_value"
title: qsTr("Address")
@@ -190,90 +213,111 @@ BasicModal {
resizable: false
movable: false
- delegate: RowLayout {
- DefaultText {
+ delegate: RowLayout
+ {
+ DexLabel
+ {
+ Layout.preferredWidth: parent.width - 10
Layout.leftMargin: 3
text: styleData.row >= 0 ? styleData.value : ""
font.pixelSize: Style.textSizeSmall3
- color: Style.colorText
+ elide: Text.ElideRight
}
- VerticalLine {
+ VerticalLine
+ {
Layout.alignment: Qt.AlignRight
Layout.fillHeight: true
}
}
}
- TableViewColumn { // Actions Column
- width: 80
+ TableViewColumn // Actions Column
+ {
+ width: walletInfoTable._actionsColWidth
title: qsTr("Actions")
resizable: false
movable: false
- delegate: Row {
+ delegate: Row
+ {
spacing: 0
- Qaterial.OutlineButton { // Edit Address Button
+ Qaterial.OutlineButton // Edit Address Button
+ {
implicitHeight: 35
implicitWidth: 35
outlined: false
- Qaterial.ColorIcon {
+ Qaterial.ColorIcon
+ {
anchors.centerIn: parent
source: Qaterial.Icons.leadPencil
- color: theme.foregroundColor
+ color: DexTheme.foregroundColor
opacity: .8
}
- 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()
+ 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
+ Qaterial.OutlineButton // Delete Button
+ {
implicitHeight: 35
implicitWidth: 35
outlined: false
- Qaterial.ColorIcon {
+ Qaterial.ColorIcon
+ {
anchors.centerIn: parent
source: Qaterial.Icons.trashCan
- color: theme.redColor
+ color: DexTheme.redColor
opacity: .8
}
- onClicked: contactModel.remove_address_entry(model.address_type, model.address_key)
+ onClicked:
+ {
+ removeAddressEntryModal.addressKey = model.address_key;
+ removeAddressEntryModal.addressType = model.address_type;
+ removeAddressEntryModal.contactModel = contactModel;
+ removeAddressEntryModal.open();
+ }
}
- Qaterial.OutlineButton { // Copy Clipboard Button
+ Qaterial.OutlineButton // Copy Clipboard Button
+ {
implicitHeight: 35
implicitWidth: 35
outlined: false
- Qaterial.ColorIcon {
+ Qaterial.ColorIcon
+ {
anchors.centerIn: parent
source: Qaterial.Icons.contentCopy
- color: theme.foregroundColor
+ color: DexTheme.foregroundColor
opacity: .8
}
onClicked: API.qt_utilities.copy_text_to_clipboard(model.address_value)
}
- Qaterial.OutlineButton { // Send Button
+ Qaterial.OutlineButton // Send Button
+ {
implicitHeight: 35
implicitWidth: 35
outlined: false
- Qaterial.ColorIcon {
+ Qaterial.ColorIcon
+ {
anchors.centerIn: parent
source: Qaterial.Icons.send
- color: theme.foregroundColor
+ color: DexTheme.foregroundColor
opacity: .8
}
@@ -336,26 +380,25 @@ BasicModal {
// Categories (Tags) List
Flow {
Layout.fillWidth: true
-
+ spacing: 10
Repeater {
id: category_repeater
model: contactModel.categories
- Qaterial.OutlineButton {
+ DexAppButton {
Layout.alignment: Qt.AlignLeft
Layout.leftMargin: 4
-
+ border.color: backgroundColor
+ iconSource: Qaterial.Icons.closeOctagon
text: modelData
- icon.source: Qaterial.Icons.closeOctagon
-
onClicked: contactModel.remove_category(modelData);
}
}
// Category adding form opening button
- Qaterial.OutlineButton {
+ DexAppButton {
Layout.leftMargin: 10
-
+ width: height
text: qsTr("+")
onClicked: add_category_modal.open()
@@ -485,6 +528,31 @@ BasicModal {
}
}
+ // Remove address entry modal
+ ModalLoader
+ {
+ id: removeAddressEntryModal
+
+ property var contactModel
+ property string addressKey
+ property string addressType
+
+ sourceComponent: BasicModal
+ {
+ width: 250
+ ModalContent
+ {
+ title: 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
diff --git a/atomic_defi_design/qml/Wallet/AddressBookNewContactCategoryModal.qml b/atomic_defi_design/qml/Wallet/AddressBookNewContactCategoryModal.qml
index e5f56ddd40..5b11b85e5b 100644
--- a/atomic_defi_design/qml/Wallet/AddressBookNewContactCategoryModal.qml
+++ b/atomic_defi_design/qml/Wallet/AddressBookNewContactCategoryModal.qml
@@ -4,6 +4,7 @@ import QtQuick.Controls 2.15
import "../Components"
import "../Constants"
+import App 1.0
//! New category form
BasicModal {
diff --git a/atomic_defi_design/qml/Wallet/AddressBookNewContactModal.qml b/atomic_defi_design/qml/Wallet/AddressBookNewContactModal.qml
index 0e05ff9d0d..8454d472c2 100644
--- a/atomic_defi_design/qml/Wallet/AddressBookNewContactModal.qml
+++ b/atomic_defi_design/qml/Wallet/AddressBookNewContactModal.qml
@@ -4,6 +4,7 @@ import QtQuick.Controls 2.15
import "../Components"
import "../Constants"
+import App 1.0
BasicModal {
id: root
diff --git a/atomic_defi_design/qml/Wallet/AddressBookSendWalletSelector.qml b/atomic_defi_design/qml/Wallet/AddressBookSendWalletSelector.qml
index 1e577a24de..55ecd7fc25 100644
--- a/atomic_defi_design/qml/Wallet/AddressBookSendWalletSelector.qml
+++ b/atomic_defi_design/qml/Wallet/AddressBookSendWalletSelector.qml
@@ -4,6 +4,7 @@ import QtQuick.Controls 2.15
import "../Components"
import "../Constants"
+import App 1.0
BasicModal {
id: root
@@ -18,9 +19,10 @@ BasicModal {
title: qsTr("Choose a valid ") + coin_type + qsTr(" coin")
Repeater {
- model: coin_type == "QRC20" ? API.app.portfolio_pg.global_cfg_mdl.all_qrc20_proxy :
- coin_type == "ERC20" ? API.app.portfolio_pg.global_cfg_mdl.all_erc20_proxy :
- API.app.portfolio_pg.global_cfg_mdl.all_smartchains_proxy
+ 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
diff --git a/atomic_defi_design/qml/Wallet/AddressBookWalletTypeList.qml b/atomic_defi_design/qml/Wallet/AddressBookWalletTypeList.qml
index 81803b65c1..30820647f7 100644
--- a/atomic_defi_design/qml/Wallet/AddressBookWalletTypeList.qml
+++ b/atomic_defi_design/qml/Wallet/AddressBookWalletTypeList.qml
@@ -8,35 +8,45 @@ import Qaterial 1.0 as Qaterial
import "../Components"
import "../Constants"
+import App 1.0
-Qaterial.Expandable {
- id: root
+Qaterial.Expandable
+{
+ id: _root
property string title
property string type_title
property string type: ""
+ property string typeIcon: type
property var model
- header: Qaterial.ItemDelegate {
+ header: Qaterial.ItemDelegate
+ {
id: _header
- onClicked: () => root.expanded = !root.expanded
-
icon.source: General.image_path + "arrow_down.svg"
+ DexLabel {
+ anchors.verticalCenter: parent.verticalCenter
+ text: title
+ leftPadding: 60
+ font.bold: true
+ }
- text: title
+ onClicked: () => _root.expanded = !_root.expanded
}
- delegate: Column {
- AddressBookWalletTypeListRow {
+ delegate: Column
+ {
+ AddressBookWalletTypeListRow
+ {
enabled: type !== ""
visible: type !== ""
- icon_source: General.coinTypeIcon(type)
+ icon_source: General.coinTypeIcon(typeIcon)
- width: root.width
+ width: _root.width
name: type_title
ticker: type_title
@@ -44,11 +54,13 @@ Qaterial.Expandable {
onClicked: onTypeSelect(type)
}
- Repeater {
- model: root.model
+ Repeater
+ {
+ model: _root.model
- delegate: AddressBookWalletTypeListRow {
- width: root.width
+ delegate: AddressBookWalletTypeListRow
+ {
+ width: _root.width
name: model.name
ticker: model.ticker
diff --git a/atomic_defi_design/qml/Wallet/AddressBookWalletTypeListModal.qml b/atomic_defi_design/qml/Wallet/AddressBookWalletTypeListModal.qml
index d34794677a..212373309b 100644
--- a/atomic_defi_design/qml/Wallet/AddressBookWalletTypeListModal.qml
+++ b/atomic_defi_design/qml/Wallet/AddressBookWalletTypeListModal.qml
@@ -5,42 +5,47 @@ import Qaterial 1.0 as Qaterial
import "../Components"
import "../Constants"
+import App 1.0
BasicModal {
- id: root
+ readonly property var glbCoinsCfgModel: API.app.portfolio_pg.global_cfg_mdl
+ property alias selected_wallet_type: wallet_list.selected_wallet_type
- readonly property var glb_coins_cfg_mdl: 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 resetModal()
+ {
+ _searchbar.text = ""
+ filterWallets(_searchbar.text)
}
- function filterWallets(text) {
- glb_coins_cfg_mdl.all_qrc20_proxy.setFilterFixedString(text)
- glb_coins_cfg_mdl.all_erc20_proxy.setFilterFixedString(text)
- glb_coins_cfg_mdl.all_smartchains_proxy.setFilterFixedString(text)
- glb_coins_cfg_mdl.all_utxo_proxy.setFilterFixedString(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
- qrc20_expandable.expanded = text !== ""
- erc20_expandable.expanded = text !== ""
- sc_expandable.expanded = text !== ""
- utxo_expandable.expanded = text !== ""
+ _qrc20Expandable.expanded = text !== ""
+ _erc20Expandable.expanded = text !== ""
+ _bep20Expandable.expanded = text !== ""
+ _scExpandable.expanded = text !== ""
+ _utxoExpandable.expanded = text !== ""
}
- function onTypeSelect(type_or_ticker) {
+ function onTypeSelect(type_or_ticker)
+ {
selected_wallet_type = type_or_ticker
close()
}
- onOpened: searchbar.forceActiveFocus()
- onClosed: resetModal()
-
width: 400
- ModalContent {
+ onOpened: _searchbar.forceActiveFocus()
+ onClosed: resetModal()
+
+ ModalContent
+ {
id: wallet_list
property string selected_wallet_type: ""
@@ -48,9 +53,10 @@ BasicModal {
title: qsTr("Select wallet type")
// Search input
- DefaultTextField {
+ DefaultTextField
+ {
Layout.rightMargin: 10
- id: searchbar
+ id: _searchbar
Layout.fillWidth: true
placeholderText: qsTr("Search")
@@ -58,43 +64,71 @@ BasicModal {
onTextChanged: filterWallets(text)
}
- AddressBookWalletTypeList {
- id: qrc20_expandable
+ AddressBookWalletTypeList
+ {
+ id: _qrc20Expandable
+
Layout.rightMargin: 10
Layout.fillWidth: true
+
title: "QRC-20 coins"
type_title: "QRC-20"
type: "QRC-20"
- model: glb_coins_cfg_mdl.all_qrc20_proxy
+
+ model: glbCoinsCfgModel.all_qrc20_proxy
}
- AddressBookWalletTypeList {
- id: erc20_expandable
+ AddressBookWalletTypeList
+ {
+ id: _erc20Expandable
Layout.rightMargin: 10
Layout.fillWidth: true
+
title: "ERC-20 coins"
type_title: "ERC-20"
type: "ERC-20"
- model: glb_coins_cfg_mdl.all_erc20_proxy
+
+ model: glbCoinsCfgModel.all_erc20_proxy
}
- AddressBookWalletTypeList {
- id: sc_expandable
+ 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: glb_coins_cfg_mdl.all_smartchains_proxy
+
+ model: glbCoinsCfgModel.all_smartchains_proxy
}
- AddressBookWalletTypeList {
- id: utxo_expandable
+ AddressBookWalletTypeList
+ {
+ id: _utxoExpandable
+
Layout.rightMargin: 10
Layout.fillWidth: true
+
title: "UTXO coins"
type_title: "UTXO"
- model: glb_coins_cfg_mdl.all_utxo_proxy
+
+ model: glbCoinsCfgModel.all_utxo_proxy
}
}
}
diff --git a/atomic_defi_design/qml/Wallet/AddressBookWalletTypeListRow.qml b/atomic_defi_design/qml/Wallet/AddressBookWalletTypeListRow.qml
index 0248f334a0..5b9c597a63 100644
--- a/atomic_defi_design/qml/Wallet/AddressBookWalletTypeListRow.qml
+++ b/atomic_defi_design/qml/Wallet/AddressBookWalletTypeListRow.qml
@@ -4,6 +4,7 @@ import QtQuick.Controls 2.15
import "../Components"
import "../Constants"
+import App 1.0
ItemDelegate {
property string ticker
@@ -24,7 +25,7 @@ ItemDelegate {
Layout.preferredHeight: 32
}
- DefaultText {
+ DexLabel {
Layout.topMargin: 10
text: " " + name + " (" + ticker + ")"
}
diff --git a/atomic_defi_design/qml/Wallet/AddressList.qml b/atomic_defi_design/qml/Wallet/AddressList.qml
index aba4bd4607..e97e4c3271 100644
--- a/atomic_defi_design/qml/Wallet/AddressList.qml
+++ b/atomic_defi_design/qml/Wallet/AddressList.qml
@@ -4,6 +4,7 @@ import QtQuick.Controls 2.15
import "../Components"
import "../Constants"
+import App 1.0
ColumnLayout {
property alias title: title.text
@@ -13,6 +14,7 @@ ColumnLayout {
TitleText {
id: title
+ opacity: .6
}
ListView {
@@ -26,7 +28,7 @@ ColumnLayout {
// Row
delegate: DefaultTextEdit {
text_value: model.modelData
- color: Style.modalValueColor
+ color: DexTheme.foregroundColor
privacy: true
}
}
diff --git a/atomic_defi_design/qml/Wallet/ClaimFaucetResultModal.qml b/atomic_defi_design/qml/Wallet/ClaimFaucetResultModal.qml
index d8b70ef8e5..f97d72388a 100644
--- a/atomic_defi_design/qml/Wallet/ClaimFaucetResultModal.qml
+++ b/atomic_defi_design/qml/Wallet/ClaimFaucetResultModal.qml
@@ -4,6 +4,7 @@ import QtQuick.Controls 2.15
import "../Components"
import "../Constants"
+import App 1.0
BasicModal {
readonly property var claiming_faucet_rpc_result: api_wallet_page.claiming_faucet_rpc_data
diff --git a/atomic_defi_design/qml/Wallet/ClaimRewardsModal.qml b/atomic_defi_design/qml/Wallet/ClaimRewardsModal.qml
index a2c0e13806..bb5679a153 100644
--- a/atomic_defi_design/qml/Wallet/ClaimRewardsModal.qml
+++ b/atomic_defi_design/qml/Wallet/ClaimRewardsModal.qml
@@ -4,6 +4,7 @@ import QtQuick.Controls 2.15
import "../Components"
import "../Constants"
+import App 1.0
BasicModal {
id: root
@@ -116,9 +117,8 @@ BasicModal {
visible: can_claim
Layout.fillWidth: true
- DefaultText {
+ DexLabel {
Layout.fillWidth: true
- color: can_confirm ? Style.colorText : Style.colorRed
text_value: !has_eligible_utxo ? ("❌ " + qsTr("No UTXOs eligible for claiming")) :
!positive_claim_amount ? ("❌ " + qsTr("Transaction fee is higher than the reward!")) :
@@ -174,7 +174,7 @@ BasicModal {
horizontalAlignment: utxo_header.horizontalAlignment
anchors.left: parent.left
- anchors.leftMargin: parent.width * 0.075
+ anchors.leftMargin: parent.width * 0.060
anchors.verticalCenter: parent.verticalCenter
}
@@ -190,7 +190,7 @@ BasicModal {
horizontalAlignment: Text.AlignLeft
anchors.left: parent.left
- anchors.leftMargin: parent.width * 0.175
+ anchors.leftMargin: parent.width * 0.225
anchors.verticalCenter: parent.verticalCenter
}
@@ -206,7 +206,7 @@ BasicModal {
horizontalAlignment: Text.AlignLeft
anchors.left: parent.left
- anchors.leftMargin: parent.width * 0.300
+ anchors.leftMargin: parent.width * 0.400
anchors.verticalCenter: parent.verticalCenter
}
@@ -222,7 +222,7 @@ BasicModal {
horizontalAlignment: Text.AlignLeft
anchors.left: parent.left
- anchors.leftMargin: parent.width * 0.450
+ anchors.leftMargin: parent.width * 0.550
anchors.verticalCenter: parent.verticalCenter
}
@@ -238,7 +238,7 @@ BasicModal {
horizontalAlignment: Text.AlignLeft
anchors.left: parent.left
- anchors.leftMargin: parent.width * 0.600
+ anchors.leftMargin: parent.width * 0.700
anchors.verticalCenter: parent.verticalCenter
}
@@ -254,7 +254,7 @@ BasicModal {
horizontalAlignment: Text.AlignLeft
anchors.left: parent.left
- anchors.leftMargin: parent.width * 0.750
+ anchors.leftMargin: parent.width * 0.820
anchors.verticalCenter: parent.verticalCenter
}
@@ -418,15 +418,24 @@ BasicModal {
// Buttons
footer: [
- DefaultButton {
+ DexAppButton {
text: qsTr("Cancel")
- Layout.fillWidth: true
+ leftPadding: 40
+ rightPadding: 40
+ radius: 18
onClicked: root.close()
},
- PrimaryButton {
- text: qsTr("Confirm")
+ Item {
Layout.fillWidth: true
+ },
+
+ DexAppOutlineButton {
+ text: qsTr("Confirm")
+ leftPadding: 40
+ rightPadding: 40
+ radius: 18
+ opacity: enabled ? containsMouse ? .7 : 1 : .5
onClicked: claimRewards()
enabled: can_confirm
}
diff --git a/atomic_defi_design/qml/Wallet/EnableCoinModal.qml b/atomic_defi_design/qml/Wallet/EnableCoinModal.qml
index 8684ef59f5..21da86adba 100644
--- a/atomic_defi_design/qml/Wallet/EnableCoinModal.qml
+++ b/atomic_defi_design/qml/Wallet/EnableCoinModal.qml
@@ -1,46 +1,52 @@
+//! Qt Imports
import QtQuick 2.15
import QtQuick.Layouts 1.15
import QtQuick.Controls 2.15
-import AtomicDEX.CoinType 1.0
+//! Project Imports
+import Qaterial 1.0 as Qaterial
+import AtomicDEX.CoinType 1.0
import "../Components"
import "../Constants"
+import App 1.0
BasicModal {
id: root
property var coin_cfg_model: API.app.portfolio_pg.global_cfg_mdl
- function setCheckState(checked) {
+ function setCheckState(checked)
+ {
coin_cfg_model.all_disabled_proxy.set_all_state(checked)
}
- function filterCoins(text) {
+ function filterCoins(text)
+ {
coin_cfg_model.all_disabled_proxy.setFilterFixedString(text === undefined ? input_coin_filter.text : text)
}
- width: 500
+ width: 600
- onOpened: {
- filterCoins()
- setCheckState(false)
- input_coin_filter.forceActiveFocus()
+ onOpened:
+ {
+ filterCoins("");
+ setCheckState(false);
+ coin_cfg_model.checked_nb = 0;
+ input_coin_filter.forceActiveFocus();
}
- onClosed: filterCoins("")
+ onClosed:
+ {
+ filterCoins("");
+ setCheckState(false);
+ coin_cfg_model.checked_nb = 0;
+ }
ModalContent {
title: qsTr("Enable assets")
- DefaultButton {
- Layout.fillWidth: true
- text: qsTr("Add a custom asset to the list")
- onClicked: {
- root.close()
- add_custom_coin_modal.open()
- }
- }
+ spacing: 0
HorizontalLine {
Layout.fillWidth: true
@@ -51,30 +57,24 @@ BasicModal {
id: input_coin_filter
Layout.fillWidth: true
+ Layout.preferredHeight: 40
placeholderText: qsTr("Search")
onTextChanged: filterCoins()
}
- DefaultCheckBox {
+ DexCheckBox {
+ id: _selectAllCheckBox
+
text: qsTr("Select all assets")
visible: list.visible
+ Layout.leftMargin: indicator.width - 5
+ checked: coin_cfg_model.checked_nb === setting_modal.enableable_coins_count - API.app.portfolio_pg.portfolio_mdl.length
- // Handle updates
- property bool updated_from_backend: false
- property int checked_count: coin_cfg_model.checked_nb
- property int target_parent_state: coin_cfg_model.all_disabled_proxy.length === checked_count ? Qt.Checked :
- checked_count > 0 ? Qt.PartiallyChecked : Qt.Unchecked
- onTarget_parent_stateChanged: {
- if(target_parent_state !== checkState) {
- updated_from_backend = true
- checkState = target_parent_state
- }
- }
- onCheckStateChanged: {
- // Avoid binding loop
- if(!updated_from_backend) setCheckState(checked)
- else updated_from_backend = false
+ DexMouseArea
+ {
+ anchors.fill: parent
+ onClicked: setCheckState(!parent.checked)
}
}
@@ -83,18 +83,20 @@ BasicModal {
visible: coin_cfg_model.all_disabled_proxy.length > 0
model: coin_cfg_model.all_disabled_proxy
- Layout.preferredHeight: 375
+ Layout.preferredHeight: 360
Layout.fillWidth: true
- delegate: DefaultCheckBox {
+ delegate: DexCheckBox {
text: " " + model.name + " (" + model.ticker + ")"
leftPadding: indicator.width
+ enabled: _selectAllCheckBox.checked ? checked : true
+
readonly property bool backend_checked: model.checked
- onBackend_checkedChanged: if(checked !== backend_checked) checked = backend_checked
+ onBackend_checkedChanged: if (checked !== backend_checked) checked = backend_checked
onCheckStateChanged: {
- if(checked !== backend_checked)
+ if (checked !== backend_checked)
{
var data_index = coin_cfg_model.all_disabled_proxy.index(index, 0)
if ((coin_cfg_model.all_disabled_proxy.setData(data_index, checked, Qt.UserRole + 11)) === false)
@@ -115,61 +117,94 @@ BasicModal {
}
CoinTypeTag {
+ id: typeTag
anchors.left: parent.right
anchors.verticalCenter: parent.verticalCenter
type: model.type
}
+
+ CoinTypeTag
+ {
+ anchors.left: typeTag.right
+ anchors.leftMargin: 3
+ anchors.verticalCenter: parent.verticalCenter
+ enabled: model.ticker === "TKL"
+ visible: enabled
+ type: "IDO"
+ }
}
}
// Info text
DefaultText {
visible: coin_cfg_model.all_disabled_proxy.length === 0
-
text_value: qsTr("All assets are already enabled!")
}
HorizontalLine {
Layout.fillWidth: true
}
-
- DefaultRectangle {
+
+ RowLayout {
Layout.fillWidth: true
- Layout.preferredHeight: 20
- border.width: 0
-
- DefaultText {
- anchors.centerIn: parent
- text: qsTr("You can still enable %1 assets. Selected: %2.")
- .arg(setting_modal.enableable_coins_count - API.app.portfolio_pg.portfolio_mdl.length)
- .arg(coin_cfg_model.checked_nb)
+ Layout.preferredHeight: 40
+
+ DexTransparentButton {
+ text: qsTr("Change assets limit")
+ topPadding: 5
+ bottomPadding: 5
+ Layout.preferredHeight: 35
+ onClicked: {
+ setting_modal.selectedMenuIndex = 0;
+ setting_modal.open()
+ }
+ }
+ Item {
+ Layout.fillWidth: true
+ }
+ DexTransparentButton {
+ text: qsTr("Add a custom asset to the list")
+ topPadding: 5
+ bottomPadding: 5
+ Layout.preferredHeight: 35
+ iconSource: Qaterial.Icons.plus
+ onClicked: {
+ root.close()
+ add_custom_coin_modal.open()
+ }
}
}
+ DexLabel
+ {
+ Layout.alignment: Qt.AlignHCenter
+ text: qsTr("You can still enable %1 assets. Selected: %2.")
+ .arg(setting_modal.enableable_coins_count - API.app.portfolio_pg.portfolio_mdl.length - coin_cfg_model.checked_nb)
+ .arg(coin_cfg_model.checked_nb)
+ }
// Buttons
footer: [
- DexButton {
- property var enableable_coins_count: setting_modal.enableable_coins_count;
- text: qsTr("Change assets limit")
- onClicked: setting_modal.open()
- textScale: API.app.settings_pg.lang=="fr"? 0.82 : 0.99
- onEnableable_coins_countChanged: setCheckState(false)
- },
- DexButton {
+ DexAppButton {
text: qsTr("Close")
- textScale: API.app.settings_pg.lang=="fr"? 0.82 : 0.99
- Layout.fillWidth: true
+ textScale: API.app.settings_pg.lang == "fr" ? 0.82 : 0.99
+ leftPadding: 40
+ rightPadding: 40
+ radius: 20
onClicked: root.close()
},
-
- DexButton {
+ Item {
+ Layout.fillWidth: true
+ },
+ DexAppOutlineButton {
visible: coin_cfg_model.length > 0
enabled: coin_cfg_model.checked_nb > 0
- textScale: API.app.settings_pg.lang=="fr"? 0.82 : 0.99
+ textScale: API.app.settings_pg.lang == "fr" ? 0.82 : 0.99
text: qsTr("Enable")
- Layout.fillWidth: true
+ leftPadding: 40
+ rightPadding: 40
+ radius: 20
onClicked: {
API.app.enable_coins(coin_cfg_model.get_checked_coins())
setCheckState(false)
diff --git a/atomic_defi_design/qml/Wallet/Main.qml b/atomic_defi_design/qml/Wallet/Main.qml
index 6201ad569c..70ce986286 100644
--- a/atomic_defi_design/qml/Wallet/Main.qml
+++ b/atomic_defi_design/qml/Wallet/Main.qml
@@ -11,6 +11,7 @@ import Qaterial 1.0 as Qaterial
// Project Imports
import "../Components"
import "../Constants"
+import App 1.0
import "../Exchange/Trade"
// Right side, main
@@ -44,7 +45,7 @@ Item {
Layout.fillWidth: true
Layout.leftMargin: layout_margin
Layout.rightMargin: layout_margin
-
+ color: DexTheme.contentColorTopBold
content: RowLayout {
width: balance_box.width
@@ -83,7 +84,69 @@ Item {
}
}
- // Wallet Balance
+ ColumnLayout {
+ visible: false //current_ticker_infos.segwit_supported
+ Layout.alignment: Qt.AlignHCenter
+ spacing: 3
+ DexLabel {
+ text_value: qsTr("Segwit")
+ Layout.alignment: Qt.AlignLeft
+ font.pixelSize: name.font.pixelSize
+ }
+ DefaultSwitch {
+ id: segwitSwitch
+ Layout.alignment: Qt.AlignVCenter
+ onToggled: {
+ if(parseFloat(current_ticker_infos.balance) > 0) {
+ Qaterial.DialogManager.showDialog({
+ title: qsTr("Confirmation"),
+ text: qsTr("Do you want to send your %1 funds to %2 wallet first?").arg(current_ticker_infos.is_segwit_on ? "segwit" : "legacy").arg(!current_ticker_infos.is_segwit_on ? "segwit" : "legacy"),
+ standardButtons: Dialog.Yes | Dialog.No,
+ onAccepted: function() {
+ var address = API.app.wallet_pg.switch_address_mode(!current_ticker_infos.is_segwit_on);
+ if (address != current_ticker_infos.address && address != "") {
+ send_modal.open()
+ send_modal.item.address_field.text = address
+ send_modal.item.max_mount.checked = true
+ send_modal.item.segwit = true
+ send_modal.item.segwit_callback = function () {
+ if(send_modal.item.segwit_success) {
+ API.app.wallet_pg.post_switch_address_mode(!current_ticker_infos.is_segwit_on)
+ Qaterial.DialogManager.showDialog({
+ title: qsTr("Success"),
+ text: qsTr("Your transaction is send, may take some time to arrive")
+ })
+ } else {
+ segwitSwitch.checked = current_ticker_infos.is_segwit_on
+ }
+ }
+ }
+ },
+ onRejected: function () {
+ app.segwit_on = true
+ API.app.wallet_pg.post_switch_address_mode(!current_ticker_infos.is_segwit_on)
+ }
+ })
+
+ } else {
+ app.segwit_on = true
+ API.app.wallet_pg.post_switch_address_mode(!current_ticker_infos.is_segwit_on)
+ }
+
+ }
+ }
+ }
+
+ Connections {
+ target: API.app.wallet_pg
+ function onTickerInfosChanged() {
+ if (segwitSwitch.checked != current_ticker_infos.is_segwit_on) {
+ segwitSwitch.checked = current_ticker_infos.is_segwit_on
+ }
+ }
+ }
+
+ // Wallet Balance
ColumnLayout {
Layout.alignment: Qt.AlignHCenter
spacing: balance_layout.spacing
@@ -146,7 +209,7 @@ Item {
}
Layout.alignment: Qt.AlignHCenter
font.pixelSize: name.font.pixelSize
- color: Style.getValueColor(current_ticker_infos.change_24h)
+ color: DexTheme.getValueColor(current_ticker_infos.change_24h)
}
}
@@ -185,10 +248,9 @@ Item {
Layout.alignment: Qt.AlignHCenter
spacing: 25
Item {
- Layout.fillWidth: true
- Layout.preferredWidth: 100
+ Layout.preferredWidth: send_button.width
Layout.preferredHeight: send_button.height
- DexButton {
+ DexAppButton {
id: send_button
enabled: API.app.wallet_pg.send_available
text: qsTr("Send")
@@ -197,13 +259,15 @@ Item {
if (API.app.wallet_pg.current_ticker_fees_coin_enabled) send_modal.open()
else enable_fees_coin_modal.open()
}
- width: parent.width
+ leftPadding: 40
+ rightPadding: 40
anchors.top: parent.top
font.pixelSize: Style.textSize
+ radius: 16
Arrow {
id: arrow_send
up: true
- color: Style.colorRed
+ color: DexTheme.arrowUpColor
anchors.verticalCenter: parent.verticalCenter
anchors.right: parent.right
anchors.rightMargin: 12
@@ -277,15 +341,16 @@ Item {
sourceComponent: CannotEnableCoinModal { coin_to_enable_ticker: API.app.wallet_pg.ticker_infos.fee_ticker }
}
- DexButton {
+ DexAppButton {
text: qsTr("Receive")
onClicked: receive_modal.open()
- Layout.fillWidth: true
font.pixelSize: send_button.font.pixelSize
-
+ leftPadding: 40
+ rightPadding: 40
+ radius: 16
Arrow {
up: false
- color: Style.colorGreen
+ color: DexTheme.arrowDownColor
anchors.verticalCenter: parent.verticalCenter
anchors.right: parent.right
anchors.rightMargin: arrow_send.anchors.rightMargin
@@ -297,35 +362,46 @@ Item {
sourceComponent: ReceiveModal {}
}
- DexButton {
+ DexAppButton {
visible: !is_dex_banned
text: qsTr("Swap")
onClicked: onClickedSwap()
- Layout.fillWidth: true
font.pixelSize: send_button.font.pixelSize
- Arrow {
- up: true
- color: Style.colorRed
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: parent.left
- anchors.leftMargin: arrow_send.anchors.rightMargin
- }
-
- Arrow {
- up: false
- color: Style.colorGreen
+ leftPadding: 40
+ rightPadding: 40
+ radius: 16
+ Row {
anchors.verticalCenter: parent.verticalCenter
anchors.right: parent.right
anchors.rightMargin: arrow_send.anchors.rightMargin
+ spacing: 3
+
+ Arrow {
+ up: true
+ color: DexTheme.arrowDownColor
+ anchors.verticalCenter: parent.verticalCenter
+ }
+
+ Arrow {
+ up: false
+ color: DexTheme.arrowUpColor
+ anchors.verticalCenter: parent.verticalCenter
+ }
}
+
+ }
+
+ Item {
+ Layout.fillWidth: true
}
- DexButton {
+ DexAppButton {
id: button_claim_rewards
text: qsTr("Claim Rewards")
- Layout.fillWidth: true
font.pixelSize: send_button.font.pixelSize
-
+ leftPadding: 30
+ rightPadding: 30
+ radius: 16
visible: current_ticker_infos.is_claimable && !API.app.is_pin_cfg_enabled()
enabled: parseFloat(current_ticker_infos.balance) > 0
onClicked: {
@@ -339,11 +415,11 @@ Item {
sourceComponent: ClaimRewardsModal {}
}
- // Faucet for RICK/MORTY coins
- DexButton {
+ DexAppButton {
id: button_claim_faucet
text: qsTr("Faucet")
- Layout.fillWidth: true
+ leftPadding: 20
+ rightPadding: 20
font.pixelSize: send_button.font.pixelSize
visible: enabled && current_ticker_infos.is_smartchain_test_coin
@@ -369,12 +445,14 @@ Item {
Layout.rightMargin: layout_margin
Layout.bottomMargin: -parent.spacing*0.5
implicitHeight: wallet.height*0.6
+ shadowOff: true
+ color: DexTheme.contentColorTop
content: Item {
property bool ticker_supported: false
readonly property bool is_fetching: chart.loadProgress < 100
- readonly property string chartTheme: Style.dark_theme ? "dark" : "light"
- property color backgroundColor: theme.chartTradingLineBackgroundColor
+ readonly property string chartTheme: DexTheme.theme ?? "dark"
+ property color backgroundColor: DexTheme.contentColorTop
property var ticker: api_wallet_page.ticker
function loadChart() {
@@ -441,7 +519,7 @@ Item {
"height": "100%",
"locale": "en",
"dateRange": "1D",
- "colorTheme": "${chartTheme}",
+ "colorTheme": "${DexTheme.theme ?? "dark"}",
"trendLineColor": "%2",
"underLineColor": "%3",
"isTransparent": true,
@@ -450,7 +528,7 @@ Item {
}
- `.arg(theme.backgroundColor).arg(theme.chartTradingLineColor).arg(theme.chartTradingLineBackgroundColor))
+ `.arg(DexTheme.theme === "dark" ? DexTheme.backgroundColor : DexTheme.contentColorTopBold).arg(DexTheme.chartTradingLineColor).arg(DexTheme.chartTradingLineBackgroundColor))
}
width: price_graph_bg.width
@@ -460,6 +538,13 @@ Item {
onChartThemeChanged: loadChart()
onBackgroundColorChanged: loadChart()
+ Connections {
+ target: DexTheme
+ function onBackgroundColorChanged() {
+ loadChart();
+ }
+ }
+
RowLayout {
visible: ticker_supported && !chart.visible
anchors.centerIn: parent
@@ -486,6 +571,7 @@ Item {
id: chart
anchors.fill: parent
anchors.margins: -1
+ backgroundColor: DexTheme.contentColorTop
visible: !is_fetching && ticker_supported
}
}
@@ -529,7 +615,7 @@ Item {
Layout.alignment: Qt.AlignHCenter
}
- InnerBackground {
+ DexRectangle {
id: transactions_bg
Layout.fillWidth: true
Layout.fillHeight: true
@@ -538,8 +624,10 @@ Item {
Layout.bottomMargin: !fetching_text_row.visible ? layout_margin : undefined
implicitHeight: wallet.height*0.54
-
- content: Item {
+ border.width: 0
+ gradient: DexTheme.portfolioPieGradient ? app.globalGradient : undefined
+ ClipRRect {
+ radius: parent.radius
width: transactions_bg.width
height: transactions_bg.height
diff --git a/atomic_defi_design/qml/Wallet/PriceGraph.qml b/atomic_defi_design/qml/Wallet/PriceGraph.qml
index be50d2c368..99a4e2d146 100644
--- a/atomic_defi_design/qml/Wallet/PriceGraph.qml
+++ b/atomic_defi_design/qml/Wallet/PriceGraph.qml
@@ -5,6 +5,7 @@ import QtQuick.Controls 2.15
import QtCharts 2.3
import "../Components"
import "../Constants"
+import App 1.0
// List
ChartView {
diff --git a/atomic_defi_design/qml/Wallet/ReceiveModal.qml b/atomic_defi_design/qml/Wallet/ReceiveModal.qml
index b8d6e5966e..266983f9d4 100644
--- a/atomic_defi_design/qml/Wallet/ReceiveModal.qml
+++ b/atomic_defi_design/qml/Wallet/ReceiveModal.qml
@@ -4,6 +4,7 @@ import QtQuick.Controls 2.15
import "../Components"
import "../Constants"
+import App 1.0
BasicModal {
id: root
@@ -24,6 +25,9 @@ BasicModal {
field.readOnly: true
field.wrapMode: TextEdit.NoWrap
copyable: true
+ onCopied: {
+ app.notifyCopy(qsTr("%1 address").arg(api_wallet_page.ticker), qsTr("copied to clipboard"))
+ }
}
Image {
@@ -37,9 +41,14 @@ BasicModal {
// Buttons
footer: [
- DefaultButton {
+ Item {
+ Layout.fillWidth: true
+ },
+ DexAppButton {
text: qsTr("Close")
- Layout.fillWidth: true
+ leftPadding: 40
+ rightPadding: 40
+ radius: 18
onClicked: root.close()
}
]
diff --git a/atomic_defi_design/qml/Wallet/SendModal.qml b/atomic_defi_design/qml/Wallet/SendModal.qml
index 0b38c5265a..34d09b9a1c 100644
--- a/atomic_defi_design/qml/Wallet/SendModal.qml
+++ b/atomic_defi_design/qml/Wallet/SendModal.qml
@@ -4,6 +4,7 @@ import QtQuick.Controls 2.15
import "../Components"
import "../Constants"
+import App 1.0
BasicModal {
id: root
@@ -12,8 +13,23 @@ BasicModal {
property alias address_field: input_address.field
property alias amount_field: input_amount.field
+ property alias max_mount: input_max_amount
+ property bool needFix: false
+ property bool errorView: false
+ property bool segwit: false
+ property bool segwit_success: false
+ property var segwit_callback
+ property var address_data
+
+
+ onClosed: {
+ if(segwit) {
+ segwit_callback()
+ }
+ segwit = false
+ reset()
+ }
- onClosed: reset()
closePolicy: Popup.NoAutoClose
// Local
@@ -27,6 +43,34 @@ BasicModal {
readonly property bool is_send_busy: api_wallet_page.is_send_busy
property var send_rpc_result: api_wallet_page.send_rpc_data
+ readonly property bool is_validate_address_busy: api_wallet_page.validate_address_busy
+ readonly property bool is_convert_address_busy: api_wallet_page.convert_address_busy
+ readonly property string address: api_wallet_page.converted_address
+ onIs_validate_address_busyChanged: {
+ console.log("Address busy changed to === %1".arg(is_validate_address_busy))
+ if(!is_validate_address_busy) {
+ address_data = api_wallet_page.validate_address_data
+ if (address_data.reason!=="") {
+ errorView = true
+ reason.text = address_data.reason
+ }else {
+ errorView = false
+ }
+ if(address_data.convertible) {
+ reason.text = address_data.reason
+ if(needFix!==true)
+ needFix = true
+ }
+ }
+ }
+ onIs_convert_address_busyChanged: {
+ if(!is_convert_address_busy){
+ if(needFix===true) {
+ needFix = false
+ input_address.field.text = api_wallet_page.converted_address
+ }
+ }
+ }
readonly property bool auth_succeeded: api_wallet_page.auth_succeeded
@@ -84,7 +128,9 @@ BasicModal {
reset()
showError(qsTr("Failed to Send"), General.prettifyJSON(broadcast_result))
}
- else root.currentIndex = 2
+ else {
+ root.currentIndex = 2
+ }
}
}
@@ -198,7 +244,6 @@ BasicModal {
function fieldAreFilled() {
return input_address.field.text != "" &&
(input_max_amount.checked || (input_amount.field.text != "" && input_amount.field.acceptableInput && parseFloat(input_amount.field.text) > 0)) &&
- input_address.field.acceptableInput &&
feesAreFilled()
}
@@ -215,22 +260,32 @@ BasicModal {
Layout.fillWidth: true
title: qsTr("Prepare to send ") + current_ticker_infos.name
-
+ spacing: 20
// Send address
RowLayout {
- spacing: Style.buttonSpacing
-
+ spacing: 20
+ Layout.preferredHeight: 60
AddressFieldWithTitle {
id: input_address
Layout.alignment: Qt.AlignLeft
title: qsTr("Recipient's address")
+ enabled: !root.segwit
+ Layout.fillHeight: true
field.placeholderText: qsTr("Enter address of the recipient")
field.enabled: !root.is_send_busy
+ field.onTextChanged: {
+ api_wallet_page.validate_address(field.text)
+ }
+
}
- DefaultButton {
- Layout.alignment: Qt.AlignRight | Qt.AlignBottom
+ DexAppButton {
+ Layout.alignment: Qt.AlignVCenter
+ Layout.preferredWidth: 150
text: qsTr("Address Book")
+ backgroundColor: DexTheme.contentColorTopBold
+ foregroundColor: DexTheme.foregroundColor
+ opacity: containsMouse ? .6 : 1
onClicked: contact_list.open()
enabled: !root.is_send_busy
}
@@ -239,37 +294,45 @@ BasicModal {
// ERC-20 Lowercase issue
RowLayout {
Layout.fillWidth: true
- visible: isERC20() && input_address.field.text != "" && hasErc20CaseIssue(input_address.field.text)
+ visible: errorView && input_address.field.text!=="" //isERC20() && input_address.field.text != "" && hasErc20CaseIssue(input_address.field.text)
DefaultText {
+ id: reason
+ Layout.fillWidth: true
+ wrapMode: Label.Wrap
Layout.alignment: Qt.AlignLeft
color: Style.colorRed
text_value: qsTr("The address has to be mixed case.")
}
DefaultButton {
- Layout.alignment: Qt.AlignRight
+ visible: needFix
+ Layout.preferredWidth: 70
+ Layout.alignment: Qt.AlignRight | Qt.AlignVCenter
text: qsTr("Fix")
- onClicked: input_address.field.text = API.app.to_eth_checksum_qt(input_address.field.text.toLowerCase())
+ onClicked: {
+ api_wallet_page.convert_address(input_address.field.text, address_data.to_address_format)
+ }
enabled: !root.is_send_busy
}
}
RowLayout {
- spacing: Style.buttonSpacing
+ spacing: 30
// Amount input
AmountField {
id: input_amount
-
+ Layout.preferredHeight: 60
field.visible: !input_max_amount.checked
- title: qsTr("Amount to send")
field.placeholderText: qsTr("Enter the amount to send")
field.enabled: !root.is_send_busy
}
- DefaultSwitch {
+ DexSwitch
+ {
id: input_max_amount
- Layout.alignment: Qt.AlignRight | Qt.AlignBottom
+ Layout.alignment: Qt.AlignVCenter
+ Layout.preferredWidth: 135
text: qsTr("MAX")
onCheckedChanged: input_amount.field.text = ""
enabled: !root.is_send_busy
@@ -277,7 +340,9 @@ BasicModal {
}
// Custom fees switch
- DefaultSwitch {
+ DexSwitch {
+ Layout.topMargin: 10
+ Layout.leftMargin: 5
id: custom_fees_switch
text: qsTr("Enable Custom Fees")
onCheckedChanged: input_custom_fees.field.text = ""
@@ -300,7 +365,8 @@ BasicModal {
id: input_custom_fees
title: qsTr("Custom Fee") + " [" + api_wallet_page.ticker + "]"
- field.placeholderText: qsTr("Enter the custom fee")
+ Layout.preferredHeight: 60
+ field.placeholderText: qsTr("Enter the custom fee") + " [" + api_wallet_page.ticker + "]"
field.enabled: !root.is_send_busy
}
@@ -354,20 +420,33 @@ BasicModal {
// Buttons
footer: [
- DefaultButton {
- text: qsTr("Close")
+ Item {
Layout.fillWidth: true
+ },
+ DexAppButton {
+ text: qsTr("Close")
+ leftPadding: 40
+ rightPadding: 40
+ radius: 18
onClicked: root.close()
},
-
- PrimaryButton {
- text: qsTr("Prepare")
+ Item {
Layout.fillWidth: true
+ },
+ DexAppOutlineButton {
+ text: qsTr("Prepare")
+ leftPadding: 40
+ rightPadding: 40
+ radius: 18
+ opacity: enabled ? 1 : .5
- enabled: fieldAreFilled() && hasFunds() && !hasErc20CaseIssue(input_address.field.text) && !root.is_send_busy
+ enabled: fieldAreFilled() && hasFunds() && !errorView && !root.is_send_busy
onClicked: prepareSendCoin(input_address.field.text, input_amount.field.text, custom_fees_switch.checked, input_custom_fees.field.text,
isSpecialToken(), input_custom_fees_gas.field.text, input_custom_fees_gas_price.field.text)
+ },
+ Item {
+ Layout.fillWidth: true
}
]
@@ -399,15 +478,15 @@ BasicModal {
// Amount
TextEditWithTitle {
title: qsTr("Amount")
- text: empty_data ? "" :
- General.formatCrypto("", input_amount.field.text, api_wallet_page.ticker, send_result.withdraw_answer.total_amount_fiat, API.app.settings_pg.current_currency)
+ text: empty_data ? "" : "%1 %2 (%3 %4)".arg(api_wallet_page.ticker).arg(input_amount.field.text).arg(API.app.settings_pg.current_fiat_sign).arg(send_result.withdraw_answer.total_amount_fiat)
+ //General.formatCrypto("", input_amount.field.text, api_wallet_page.ticker, send_result.withdraw_answer.total_amount_fiat, API.app.settings_pg.current_currency)
}
// Fees
TextEditWithTitle {
title: qsTr("Fees")
- text: empty_data ? "" :
- General.formatCrypto("", send_result.withdraw_answer.fee_details.amount, current_ticker_infos.fee_ticker, send_result.withdraw_answer.fee_details.amount_fiat, API.app.settings_pg.current_currency)
+ text: empty_data ? "" : "%1 %2 (%3 %4)".arg(current_ticker_infos.fee_ticker).arg(send_result.withdraw_answer.fee_details.amount).arg(API.app.settings_pg.current_fiat_sign).arg(send_result.withdraw_answer.fee_details.amount_fiat)
+ //General.formatCrypto("", send_result.withdraw_answer.fee_details.amount, current_ticker_infos.fee_ticker, send_result.withdraw_answer.fee_details.amount_fiat, API.app.settings_pg.current_fiat_sign)
}
// Date
@@ -423,18 +502,30 @@ BasicModal {
// Buttons
footer: [
- DefaultButton {
- text: qsTr("Back")
+ Item {
Layout.fillWidth: true
+ },
+ DexAppButton {
+ text: qsTr("Back")
+ leftPadding: 40
+ rightPadding: 40
+ radius: 18
onClicked: root.currentIndex = 0
enabled: !root.is_broadcast_busy
},
-
- PrimaryButton {
- text: qsTr("Send")
+ Item {
Layout.fillWidth: true
+ },
+ DexAppOutlineButton {
+ text: qsTr("Send")
onClicked: sendCoin()
+ leftPadding: 40
+ rightPadding: 40
+ radius: 18
enabled: !root.is_broadcast_busy
+ },
+ Item {
+ Layout.fillWidth: true
}
]
}
@@ -451,6 +542,9 @@ BasicModal {
custom_amount: input_amount.field.text
function onClose() {
+ if(root.segwit) {
+ root.segwit_success = true
+ }
root.close()
}
}
diff --git a/atomic_defi_design/qml/Wallet/SendModalContactList.qml b/atomic_defi_design/qml/Wallet/SendModalContactList.qml
index 123efb68e2..2cd6e3cdcc 100644
--- a/atomic_defi_design/qml/Wallet/SendModalContactList.qml
+++ b/atomic_defi_design/qml/Wallet/SendModalContactList.qml
@@ -6,6 +6,7 @@ import QtQuick.Controls 2.15
// Project Imports
import "../Components"
import "../Constants"
+import App 1.0
BasicModal {
id: root
@@ -31,6 +32,9 @@ BasicModal {
id: contact_list_bg
Layout.fillWidth: true
+ shadowOff: true
+ radius: 4
+ color: 'transparent'
content: DefaultListView { // Contact List
readonly property int rowHeight: 30 // Visual height of a row.
@@ -69,10 +73,9 @@ BasicModal {
}
implicitWidth: contact_list_bg.width
height: 30
- color: Style.colorOnlyIf(mouse_area.containsMouse, Style.colorTheme6)
- radius: contact_list_bg.radius
+ color: mouse_area.containsMouse ? DexTheme.buttonColorHovered : index % 2 === 0 ? DexTheme.contentColorTopBold : "transparent"
- DefaultMouseArea {
+ DexMouseArea {
id: mouse_area
anchors.fill: parent
hoverEnabled: true
@@ -139,12 +142,14 @@ BasicModal {
Layout.leftMargin: 5
Layout.preferredWidth: 210
text: qsTr("Name")
- color: Style.colorWhite4
+ color: DexTheme.foregroundColor
+ opacity: .7
}
DefaultText {
text: qsTr("Address")
- color: Style.colorWhite4
+ color: DexTheme.foregroundColor
+ opacity: .7
}
}
@@ -153,6 +158,9 @@ BasicModal {
id: address_list_bg
Layout.fillWidth: true
+ shadowOff: true
+ radius: 4
+ color: 'transparent'
content: DefaultListView { // Address List
readonly property int rowHeight: 30 // Visual height of a row.
@@ -162,10 +170,10 @@ BasicModal {
delegate: AnimatedRectangle { // Address Row
implicitWidth: address_list_bg.width
height: 30
- color: Style.colorOnlyIf(address_mouse_area.containsMouse, Style.colorTheme6)
+ color: address_mouse_area.containsMouse ? DexTheme.buttonColorHovered : index % 2 === 0 ? DexTheme.contentColorTopBold : "transparent"
radius: address_list_bg.radius
- DefaultMouseArea {
+ DexMouseArea {
id: address_mouse_area
anchors.fill: parent
hoverEnabled: true
@@ -191,27 +199,15 @@ BasicModal {
anchors.rightMargin: 10
text: model.address_value
elide: Qt.ElideRight
-
- VerticalLine {
- height: parent.parent.height
- width: 2
- anchors.verticalCenter: parent.verticalCenter
- anchors.right: parent.left
- anchors.rightMargin: 3
- }
- }
-
- HorizontalLine {
- width: parent.width
- height: 2
- anchors.bottom: parent.bottom
}
}
}
}
- DefaultButton {
- Layout.fillWidth: true
+ DexAppButton {
+ leftPadding: 20
+ rightPadding: 20
+ radius: 16
Layout.alignment: Qt.AlignBottom
text: qsTr("Back")
onClicked: currentIndex = 0
diff --git a/atomic_defi_design/qml/Wallet/SendResult.qml b/atomic_defi_design/qml/Wallet/SendResult.qml
index 4cabec397d..798b12e803 100644
--- a/atomic_defi_design/qml/Wallet/SendResult.qml
+++ b/atomic_defi_design/qml/Wallet/SendResult.qml
@@ -4,6 +4,7 @@ import QtQuick.Controls 2.15
import "../Components"
import "../Constants"
+import App 1.0
ModalContent {
property var result: ({ balance_change:"", fees: "", date: "", explorer_url: "" })
@@ -48,16 +49,29 @@ ModalContent {
// Buttons
footer: [
- DefaultButton {
- text: qsTr("Close")
+ Item {
Layout.fillWidth: true
+ },
+ DexButton {
+ text: qsTr("Close")
+ leftPadding: 40
+ rightPadding: 40
+ radius: 18
onClicked: onClose()
},
-
- PrimaryButton {
- text: qsTr("View on Explorer")
+ Item {
Layout.fillWidth: true
+ },
+ DexAppOutlineButton {
+ text: qsTr("View on Explorer")
+ leftPadding: 40
+ rightPadding: 40
+ radius: 18
onClicked: General.viewTxAtExplorer(api_wallet_page.ticker, tx_hash.text)
+ },
+ Item {
+ Layout.fillWidth: true
}
+
]
}
diff --git a/atomic_defi_design/qml/Wallet/Sidebar.qml b/atomic_defi_design/qml/Wallet/Sidebar.qml
index 381aef910f..759d2f9be3 100644
--- a/atomic_defi_design/qml/Wallet/Sidebar.qml
+++ b/atomic_defi_design/qml/Wallet/Sidebar.qml
@@ -2,9 +2,12 @@ import QtQuick 2.15
import QtQuick.Layouts 1.15
import QtQuick.Controls 2.15
+import Qaterial 1.0 as Qaterial
+
import QtGraphicalEffects 1.0
import "../Components"
-import "../Constants"
+import "../Constants" as Constants
+import App 1.0
// Coins bar at left side
Item {
@@ -19,7 +22,7 @@ Item {
Layout.alignment: Qt.AlignLeft
width: 175
Layout.fillHeight: true
- Layout.topMargin: !window.isOsx? -40 : 0
+ Layout.topMargin: - 40
// Background
SidebarPanel {
@@ -27,7 +30,7 @@ Item {
anchors.right: parent.right
width: sidebar.width + parent.width
- height: parent.height+40
+ height: parent.height
// Panel contents
Item {
@@ -36,177 +39,176 @@ Item {
height: parent.height
anchors.right: parent.right
- VerticalLine {
- anchors.left: parent.left
- anchors.top: parent.top
- anchors.bottom: parent.bottom
- anchors.bottomMargin: 1
- opacity: .3
- anchors.topMargin: anchors.bottomMargin
- color: theme.backgroundColorDeep
- }
-
- InnerBackground {
- id: search_row_bg
- anchors.top: parent.top
+ ColumnLayout {
+ anchors.fill: parent
anchors.topMargin: 30
- width: list_bg.width
- color: theme.backgroundColor
- anchors.horizontalCenter: list_bg.horizontalCenter
-
- content: RowLayout {
- id: search_row
-
- width: search_row_bg.width
-
- // Search button
- Item {
- Layout.alignment: Qt.AlignLeft
- Layout.leftMargin: search_button.width
- Layout.rightMargin: -Layout.leftMargin
- width: search_button.width
- height: search_button.height
- DefaultImage {
- id: search_button
-
- source: General.image_path + "exchange-search.svg"
-
- width: input_coin_filter.font.pixelSize; height: width
-
- visible: false
- }
- DefaultColorOverlay {
- id: search_button_overlay
+ anchors.bottomMargin: 30
+ anchors.leftMargin: 10
+ anchors.rightMargin: 20
+ spacing: 40
+ InnerBackground {
+ id: search_row_bg
+ Layout.preferredWidth: 145
+ radius: 14
+ Layout.alignment: Qt.AlignHCenter
+ color: DexTheme.contentColorTop
+ shadowOff: true
+
+ content: RowLayout {
+ id: search_row
+
+ width: search_row_bg.width
+
+ // Search button
+ Item {
+ Layout.alignment: Qt.AlignLeft
+ Layout.leftMargin: search_button.width
+ Layout.rightMargin: -Layout.leftMargin
+ width: search_button.width
+ height: search_button.height
+ DefaultImage {
+ id: search_button
+
+ source: Constants.General.image_path + "exchange-search.svg"
+
+ width: input_coin_filter.font.pixelSize; height: width
+
+ visible: false
+ }
+ DefaultColorOverlay {
+ id: search_button_overlay
- anchors.fill: search_button
- source: search_button
- color: theme.foregroundColor
+ anchors.fill: search_button
+ source: search_button
+ color: DexTheme.foregroundColor
+ }
}
- }
- // Search input
- DefaultTextField {
- id: input_coin_filter
+ // Search input
+ DefaultTextField {
+ id: input_coin_filter
- Connections {
- target: root
+ Connections {
+ target: root
- function onResetted() {
- if(input_coin_filter.text === "") resetCoinFilter()
- else input_coin_filter.text = ""
+ function onResetted() {
+ if(input_coin_filter.text === "") resetCoinFilter()
+ else input_coin_filter.text = ""
- //portfolio_coins.sort_by_name(true)
+ //portfolio_coins.sort_by_name(true)
+ }
}
- }
+ placeholderText: qsTr("Search coin")
+
+ onTextChanged: portfolio_coins.setFilterFixedString(text)
+ font.pixelSize: Constants.Style.textSizeSmall3
- onTextChanged: portfolio_coins.setFilterFixedString(text)
- font.pixelSize: Style.textSizeSmall3
+ background: null
- background: null
+ Layout.fillWidth: true
- Layout.fillWidth: true
+ Component.onDestruction: portfolio_coins.setFilterFixedString("")
+ }
}
}
- }
-
- // Add button
- PlusButton {
- id: add_coin_button
- onClicked: enable_coin_modal.open()
-
- anchors.bottom: parent.bottom
- anchors.bottomMargin: parent.width * 0.5 - height * 0.5
- anchors.horizontalCenter: parent.horizontalCenter
- }
-
- // Coins list
- InnerBackground {
- id: list_bg
- width: 145
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.verticalCenter: parent.verticalCenter
-
- content: DefaultListView {
- id: list
- implicitHeight: Math.min(contentItem.childrenRect.height, coins_bar.height - 250)
- model: portfolio_coins
-
- delegate: GradientRectangle {
- width: list_bg.width - list_bg.border.width*2 - 2
- height: 44
- radius: Style.rectangleCornerRadius
-
- start_color: Style.applyOpacity(Style.colorCoinListHighlightGradient)
- end_color: api_wallet_page.ticker === ticker ? theme.hightlightColor : mouse_area.containsMouse ? Style.colorWhite8 : start_color
-
- // Click area
- DefaultMouseArea {
- id: mouse_area
- anchors.fill: parent
- hoverEnabled: true
-
- acceptedButtons: Qt.LeftButton | Qt.RightButton
- onClicked: {
- if(!can_change_ticker) return
-
- if (mouse.button === Qt.RightButton) context_menu.popup()
- else api_wallet_page.ticker = ticker
- }
- onPressAndHold: {
- if(!can_change_ticker) return
-
- if (mouse.source === Qt.MouseEventNotSynthesized) context_menu.popup()
+ // Add button
+
+
+ // Coins list
+ InnerBackground {
+ id: list_bg
+ Layout.preferredWidth: 145
+ Layout.fillHeight: true
+ Layout.alignment: Qt.AlignHCenter
+ color: 'transparent'
+ shadowOff: true
+ content: DexListView {
+ id: list
+ height: list_bg.height
+ model: portfolio_coins
+ topMargin: 5
+ bottomMargin: 5
+ scrollbar_visible: false
+ DexRectangle {
+ anchors.bottom: parent.bottom
+ anchors.horizontalCenter: parent.horizontalCenter
+ width: parent.width + 4
+ height: 30
+ radius: 8
+ opacity: .5
+ visible: list.position < (.98 - list.scrollVert.visualSize) ? true : false
+ Qaterial.Icon {
+ anchors.centerIn: parent
+ color: DexTheme.foregroundColor
+ icon: Qaterial.Icons.arrowDownCircleOutline
}
}
- // Right click menu
- CoinMenu {
- id: context_menu
- }
-
- readonly property double side_margin: 16
-
- // Icon
- DefaultImage {
- id: icon
- anchors.left: parent.left
- anchors.leftMargin: side_margin - scrollbar_margin
-
- source: General.coinIcon(ticker)
- width: Style.textSizeSmall4*2
- anchors.verticalCenter: parent.verticalCenter
+ DexRectangle {
+ anchors.horizontalCenter: parent.horizontalCenter
+ width: parent.width + 4
+ height: 30
+ radius: 8
+ opacity: .5
+ visible: list.position > 0 ? true : false
+ Qaterial.Icon {
+ anchors.centerIn: parent
+ color: DexTheme.foregroundColor
+ icon: Qaterial.Icons.arrowUpCircleOutline
+ }
}
- ColumnLayout {
- anchors.verticalCenter: parent.verticalCenter
- anchors.right: parent.right
- anchors.rightMargin: side_margin + scrollbar_margin
+ reuseItems: true
- // Ticker
- DefaultText {
- Layout.alignment: Qt.AlignRight
- text_value: ticker
- font.pixelSize: text.length > 6 ? Style.textSizeSmall2 : Style.textSizeSmall4
- }
+ delegate: SidebarItemDelegate { }
+ }
+ }
- DefaultTooltip {
- visible: mouse_area.containsMouse
+ DexAppButton {
+ id: add_coin_button
+ onClicked: enable_coin_modal.open()
+ Layout.alignment: Qt.AlignHCenter
+ Layout.preferredWidth: 140
+ radius: 18
+ spacing: 2
+ font: Qt.font({
+ pixelSize: 9 * DexTypo.fontDensity,
+ letterSpacing: 1.25,
+ capitalization: Font.AllUppercase,
+ family: DexTypo.fontFamily,
+ weight: Font.Normal
+ })
+ text: qsTr("Add crypto")
+ iconSource: Qaterial.Icons.plus
+ leftPadding: 3
+ rightPadding: 3
- contentItem: ColumnLayout {
- DefaultText {
- text_value: name.replace(" (TESTCOIN)", "")
- font.pixelSize: Style.textSizeSmall4
- }
- }
- }
- }
- }
}
}
+
+ VerticalLine {
+ anchors.left: parent.left
+ anchors.top: parent.top
+ anchors.bottom: parent.bottom
+ anchors.bottomMargin: 1
+ opacity: .3
+ anchors.topMargin: anchors.bottomMargin
+ color: DexTheme.walletSidebarLeftBorderColor
+ }
+
+
}
}
+ DexRectangle {
+ anchors.right: parent.right
+ height: parent.height
+ width: 1
+ color: DexTheme.sideBarRightBorderColor
+ border.width: 0
+ }
+
DropShadow {
anchors.fill: background
source: background
@@ -216,7 +218,8 @@ Item {
radius: 32
samples: 32
spread: 0
- color: Style.colorWalletsSidebarDropShadow
+ visible: DexTheme.walletSidebarShadowVisibility
+ color: Constants.Style.colorWalletsSidebarDropShadow
smooth: true
}
}
diff --git a/atomic_defi_design/qml/Wallet/SidebarItemDelegate.qml b/atomic_defi_design/qml/Wallet/SidebarItemDelegate.qml
new file mode 100644
index 0000000000..80884cbd7e
--- /dev/null
+++ b/atomic_defi_design/qml/Wallet/SidebarItemDelegate.qml
@@ -0,0 +1,84 @@
+import QtQuick 2.15
+import QtQuick.Layouts 1.15
+import QtQuick.Controls 2.15
+
+import Qaterial 1.0 as Qaterial
+
+import QtGraphicalEffects 1.0
+import "../Components"
+import "../Constants" as Constants
+import App 1.0
+
+GradientRectangle {
+ width: list_bg.width - list_bg.border.width*2 - 6
+ height: 44
+ radius: Constants.Style.rectangleCornerRadius + 4
+
+ start_color: api_wallet_page.ticker === ticker ? DexTheme.buttonColorEnabled : mouse_area.containsMouse ? DexTheme.buttonColorHovered : 'transparent'
+ end_color: 'transparent'
+
+ // Click area
+ DefaultMouseArea {
+ id: mouse_area
+ anchors.fill: parent
+ hoverEnabled: true
+
+ acceptedButtons: Qt.LeftButton | Qt.RightButton
+ onClicked: {
+ if(!can_change_ticker) return
+
+ if (mouse.button === Qt.RightButton) context_menu.popup()
+ else api_wallet_page.ticker = ticker
+ }
+ onPressAndHold: {
+ if(!can_change_ticker) return
+
+ if (mouse.source === Qt.MouseEventNotSynthesized) context_menu.popup()
+ }
+ }
+
+ // Right click menu
+ CoinMenu {
+ id: context_menu
+ }
+
+ readonly property double side_margin: 16
+
+ // Icon
+ DefaultImage {
+ id: icon
+ anchors.left: parent.left
+ anchors.leftMargin: side_margin - scrollbar_margin
+
+ source: Constants.General.coinIcon(ticker)
+ width: Constants.Style.textSizeSmall4*2
+ anchors.verticalCenter: parent.verticalCenter
+ }
+
+ ColumnLayout {
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.left: parent.left
+ anchors.leftMargin: icon.width + 28
+
+ // Ticker
+ DexLabel {
+ Layout.alignment: Qt.AlignLeft
+ Layout.preferredWidth: 80
+ font: DexTypo.caption
+ wrapMode: DexLabel.WordWrap
+ text_value: ticker
+ color: DexTheme.foregroundColor
+ }
+
+ DefaultTooltip {
+ visible: mouse_area.containsMouse
+
+ contentItem: ColumnLayout {
+ DefaultText {
+ text_value: name.replace(" (TESTCOIN)", "")
+ font.pixelSize: Constants.Style.textSizeSmall4
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/atomic_defi_design/qml/Wallet/TransactionDetailsModal.qml b/atomic_defi_design/qml/Wallet/TransactionDetailsModal.qml
index 23783f683b..3acc4c2462 100644
--- a/atomic_defi_design/qml/Wallet/TransactionDetailsModal.qml
+++ b/atomic_defi_design/qml/Wallet/TransactionDetailsModal.qml
@@ -4,6 +4,7 @@ import QtQuick.Controls 2.15
import "../Components"
import "../Constants"
+import App 1.0
// Open Transaction Details Modal
BasicModal {
@@ -29,7 +30,7 @@ BasicModal {
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 ? Style.colorRed : Style.colorGreen
+ details.am_i_sender ? DexTheme.redColor : DexTheme.greenColor
privacy: true
}
@@ -39,7 +40,7 @@ BasicModal {
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 ? Style.colorRed : Style.colorGreen
+ parseFloat(details.fees) > 0 ? DexTheme.redColor : DexTheme.greenColor
privacy: true
}
@@ -72,18 +73,29 @@ BasicModal {
details.blockheight
}
- AddressList {
- title: qsTr("From")
- model: !details ? [] :
- details.from
- }
+ DexRectangle {
+ Layout.fillWidth: true
+ Layout.preferredHeight: addressColumn.height + 10
+ color: DexTheme.contentColorTop
+ Column {
+ id: addressColumn
+ width: parent.width - 10
+ anchors.centerIn: parent
+ AddressList {
+ width: parent.width
+ title: qsTr("From")
+ model: !details ? [] :
+ details.from
+ }
- AddressList {
- title: qsTr("To")
- model: !details ? [] :
- details.to
+ AddressList {
+ width: parent.width
+ title: qsTr("To")
+ model: !details ? [] :
+ details.to
+ }
+ }
}
-
// Notes
TextAreaWithTitle {
id: notes
@@ -106,33 +118,30 @@ BasicModal {
// Buttons
footer: [
- DefaultButton {
- text: qsTr("Close")
+ Item {
Layout.fillWidth: true
+ },
+ DexButton {
+ text: qsTr("Close")
+ leftPadding: 40
+ rightPadding: 40
+ radius: 18
onClicked: root.close()
},
-
- DangerButton {
- visible: !details ? false :
- !details.am_i_sender
-
- text: qsTr("Refund")
+ Item {
Layout.fillWidth: true
- onClicked: {
- const address = details.from[0]
- const amount = details.amount
- root.close()
- send_modal.open()
- send_modal.item.address_field.text = address
- send_modal.item.amount_field.text = amount
- }
},
-
- PrimaryButton {
+ DexAppOutlineButton {
text: qsTr("View on Explorer")
- Layout.fillWidth: true
+ leftPadding: 40
+ rightPadding: 40
+ radius: 18
onClicked: General.viewTxAtExplorer(api_wallet_page.ticker, details.tx_hash, false)
+ },
+ Item {
+ Layout.fillWidth: true
}
+
]
}
}
diff --git a/atomic_defi_design/qml/Wallet/Transactions.qml b/atomic_defi_design/qml/Wallet/Transactions.qml
index dfdb60bc20..fb20fe99da 100644
--- a/atomic_defi_design/qml/Wallet/Transactions.qml
+++ b/atomic_defi_design/qml/Wallet/Transactions.qml
@@ -4,6 +4,7 @@ import QtQuick.Controls 2.15
import "../Components"
import "../Constants"
+import App 1.0
DefaultListView {
id: list
@@ -16,14 +17,16 @@ DefaultListView {
}
// Row
- delegate: AnimatedRectangle {
+ delegate: DexRectangle {
id: rectangle
implicitWidth: list.width
height: row_height
+ radius: 0
+ border.width: 0
+ colorAnimation: false
+ color: mouse_area.containsMouse? DexTheme.buttonColorHovered : 'transparent'
- color: mouse_area.containsMouse? theme.hightlightColor : 'transparent'
-
- DefaultMouseArea {
+ DexMouseArea {
id: mouse_area
anchors.fill: parent
hoverEnabled: true
@@ -46,7 +49,7 @@ DefaultListView {
Arrow {
id: received_icon
up: am_i_sender ? true : false
- color: !am_i_sender ? Style.colorGreen : Style.colorRed
+ color: !am_i_sender ? DexTheme.arrowUpColor : DexTheme.arrowDownColor
anchors.verticalCenter: parent.verticalCenter
anchors.left: note_tag.right
anchors.leftMargin: 10
@@ -70,7 +73,7 @@ DefaultListView {
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left
anchors.leftMargin: parent.width * 0.2
- color: am_i_sender ? Style.colorRed : Style.colorGreen
+ color: am_i_sender ? DexTheme.redColor : DexTheme.greenColor
privacy: true
}
@@ -105,15 +108,5 @@ DefaultListView {
anchors.rightMargin: 20
privacy: true
}
-
- HorizontalLine {
- visible: index !== transactions_mdl.length -1
- width: parent.width - 4
-
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.bottom: parent.bottom
- anchors.bottomMargin: -height/2
- light: true
- }
}
}
diff --git a/atomic_defi_design/qml/Wallet/Wallet.qml b/atomic_defi_design/qml/Wallet/Wallet.qml
index 2df11fb69b..363664c0e9 100644
--- a/atomic_defi_design/qml/Wallet/Wallet.qml
+++ b/atomic_defi_design/qml/Wallet/Wallet.qml
@@ -5,6 +5,7 @@ import QtGraphicalEffects 1.0
import "../Components"
import "../Constants"
+import App 1.0
RowLayout
{
diff --git a/atomic_defi_design/qml/main.qml b/atomic_defi_design/qml/main.qml
index 9fb2cffcc9..101cd2f401 100644
--- a/atomic_defi_design/qml/main.qml
+++ b/atomic_defi_design/qml/main.qml
@@ -1,53 +1,385 @@
+//! Qt Imports
import QtQuick 2.15
import QtQuick.Controls 2.15
-import Qaterial 1.0 as Qaterial
import QtQuick.Controls.Universal 2.15
import QtQuick.Layouts 1.12
+import Qt.labs.settings 1.0
+
+//! 3rdParty Imports
+import Qaterial 1.0 as Qaterial
+//! Project Imports
+import App 1.0
import "Screens"
-import "Constants"
import "Components"
-DexWindow {
+DexWindow
+{
id: window
+
+ property alias application: app
+ property int previousX: 0
+ property int previousY: 0
+ property int real_visibility
+ property bool isOsx: Qt.platform.os == "osx"
+ property bool logged: false
+
title: API.app_name
visible: true
- property int previousX: 0
- property int previousY: 0
- property int real_visibility
- property bool isOsx: Qt.platform.os == "osx"
- minimumWidth: General.minimumWidth
- minimumHeight: General.minimumHeight
-
- Universal.theme: Style.dark_theme ? Universal.Dark : Universal.Light
- Universal.accent: Style.colorQtThemeAccent
- Universal.foreground: Style.colorQtThemeForeground
- Universal.background: Style.colorQtThemeBackground
-
- onVisibilityChanged: {
+
+ minimumWidth: General.minimumWidth
+ minimumHeight: General.minimumHeight
+
+ Universal.theme: Style.dark_theme ? Universal.Dark : Universal.Light
+ Universal.accent: Style.colorQtThemeAccent
+ Universal.foreground: Style.colorQtThemeForeground
+ Universal.background: Style.colorQtThemeBackground
+
+ background: DexRectangle
+ {
+ anchors.fill: parent
+ color: "transparent"
+ border.color: DexTheme.dexBoxBackgroundColor
+ border.width: 1
+ radius: 0
+ }
+
+ onVisibilityChanged:
+ {
// 3 is minimized, ignore that
- if(visibility !== 3)
+ if (visibility !== 3)
real_visibility = visibility
API.app.change_state(visibility)
}
+
+ DexWindowControl { visible: !isOsx }
- background: Item{}
-
- Rectangle {
- anchors.fill: parent
- color: "transparent"
- border.color: app.globalTheme.dexBoxBackgroundColor
- border.width: 0
- }
+ DexRectangle {
+ radius: 0
+ width: parent.width-2
+ height: 30
+ anchors.horizontalCenter: parent.horizontalCenter
+ color: DexTheme.surfaceColor
+ visible: isOsx
+ }
+ App {
+ id: app
+ anchors.fill: parent
+ anchors.topMargin: 30
+ anchors.margins: 2
+ }
+
+ DexPopup
+ {
+ id: userMenu
- App {
- id: app
- anchors.fill: parent
- anchors.margins: 2
- }
+ spacing: 8
+ padding: 2
+ backgroundColor: DexTheme.dexBoxBackgroundColor
+
+ contentItem: Item
+ {
+ implicitWidth: 130
+ implicitHeight: 30
+ Rectangle {
+ width: parent.width-10
+ height: parent.height-5
+ anchors.centerIn: parent
+ color: logout_area.containsMouse? DexTheme.contentColorTopBold : DexTheme.buttonColorHovered
+ Row {
+ anchors.centerIn: parent
+ Qaterial.Icon {
+ anchors.verticalCenter: parent.verticalCenter
+ icon: Qaterial.Icons.logout
+ color: DexTheme.foregroundColor
+ size: 11
+ }
+ spacing: 5
+ DexLabel {
+ anchors.verticalCenter: parent.verticalCenter
+ color: DexTheme.foregroundColor
+ text: qsTr('Logout')
+ }
+ }
+ DexMouseArea {
+ id: logout_area
+ hoverEnabled: true
+ anchors.fill: parent
+ onClicked: {
+ let dialog = app.showText({
+ "title": qsTr("Confirm Logout"),
+ text: qsTr("Are you sure you want to log out?") ,
+ standardButtons: Dialog.Yes | Dialog.Cancel,
+ warning: true,
+ width: 300,
+ iconSource: Qaterial.Icons.logout,
+ iconColor: DexTheme.accentColor,
+ yesButtonText: qsTr("Yes"),
+ cancelButtonText: qsTr("Cancel"),
+ onAccepted: function(text) {
+ app.notifications_list = []
+ userMenu.close()
+ app.currentWalletName = ""
+ API.app.disconnect()
+ app.onDisconnect()
+ dialog.close()
+ dialog.destroy()
+ },
+ onRejected: function() {
+ userMenu.close()
+ }
+ })
+ }
+ }
+ }
+ }
+ }
+
+ DexMacControl { visible: isOsx }
+ Row {
+ height: 30
+ leftPadding: 8
+ anchors.right: isOsx? parent.right : undefined
+ anchors.rightMargin: isOsx? 8 : 0
+ layoutDirection: isOsx? Qt.RightToLeft : Qt.LeftToRight
+ spacing: 5
+
+ Image {
+ source: "qrc:/atomic_defi_design/assets/images/dex-tray-icon.png"
+ width: 15
+ height: 15
+ smooth: true
+ antialiasing: true
+ visible: !_label.visible
+ anchors.verticalCenter: parent.verticalCenter
+ }
+ DexLabel {
+ text: atomic_app_name
+ font.family: 'Montserrat'
+ font.weight: Font.Medium
+ opacity: .5
+ leftPadding: 5
+ color: DexTheme.foregroundColor
+ visible: !_label.visible
+ anchors.verticalCenter: parent.verticalCenter
+ }
+
+ }
+ Item {
+ width: _row.width
+ height: 30
+ Behavior on x {
+ NumberAnimation {
+ duration: 200
+ }
+ }
+ anchors.right: parent.right
+ anchors.rightMargin: isOsx? 10 : 120
+
+ Row {
+ id: _row
+ anchors.verticalCenter: parent.verticalCenter
+ layoutDirection: Qt.RightToLeft
+ spacing: 6
+ DexLabel {
+ text: " | "
+ opacity: .1
+ font.family: 'Montserrat'
+ font.weight: Font.Medium
+ visible: _label.visible & !isOsx
+ color: DexTheme.foregroundColor
+ anchors.verticalCenter: parent.verticalCenter
+ leftPadding: 2
+ }
+ Rectangle {
+ width: __row.width + 10
+ height: __row.height + 5
+ anchors.verticalCenter: parent.verticalCenter
+ //visible: _label.visible
+ radius: 3
+ color: _area.containsMouse? DexTheme.dexBoxBackgroundColor : "transparent"
+ Row {
+ id: __row
+ anchors.centerIn: parent
+ layoutDirection: isOsx? Qt.RightToLeft : Qt.LeftToRight
+ spacing: 6
+ Qaterial.ColorIcon {
+ source: Qaterial.Icons.accountCircle
+ iconSize: 18
+ visible: _label.visible
+ color: DexTheme.foregroundColor
+ anchors.verticalCenter: parent.verticalCenter
+ }
+ DexLabel {
+ id: _label
+ text: API.app.wallet_mgr.wallet_default_name?? ""
+ font.family: 'Montserrat'
+ font.weight: Font.Medium
+ opacity: .7
+ visible: window.logged
+ color: DexTheme.foregroundColor
+ anchors.verticalCenter: parent.verticalCenter
+ }
+ Qaterial.ColorIcon {
+ source: Qaterial.Icons.menuDown
+ iconSize: 14
+ visible: _label.visible
+ color: DexTheme.foregroundColor
+ anchors.verticalCenter: parent.verticalCenter
+ }
+ }
+ DexMouseArea {
+ id: _area
+ anchors.fill: parent
+ onClicked: {
+ if(userMenu.visible){
+ userMenu.close()
+ }else {
+ userMenu.openAt(mapToItem(Overlay.overlay, width / 2, height), Item.Top)
+ }
+ }
+ }
+ }
+ DexLabel {
+ text: " | "
+ opacity: .1
+ font.family: 'Montserrat'
+ font.weight: Font.Medium
+ visible: _label.visible
+ color: DexTheme.foregroundColor
+ anchors.verticalCenter: parent.verticalCenter
+ leftPadding: 2
+ }
+ Row {
+ anchors.verticalCenter: parent.verticalCenter
+ spacing: 6
+
+ DexLabel {
+ leftPadding: 2
+ text: qsTr("Balance")
+ font.family: 'Montserrat'
+ font.weight: Font.Medium
+ opacity: .7
+ visible: _label.visible
+ color: DexTheme.foregroundColor
+ anchors.verticalCenter: parent.verticalCenter
+ }
+ DexLabel {
+ text: ":"
+ opacity: .7
+ font.family: 'Montserrat'
+ font.weight: Font.Medium
+ visible: _label.visible
+ color: DexTheme.foregroundColor
+ anchors.verticalCenter: parent.verticalCenter
+ }
+ DexLabel {
+ text_value: General.formatFiat("", API.app.portfolio_pg.balance_fiat_all,API.app.settings_pg.current_currency)
+ font.family: 'lato'
+ font.weight: Font.Medium
+ visible: _label.visible
+ color: DexTheme.accentColor
+ privacy: true
+ anchors.verticalCenter: parent.verticalCenter
+ DexMouseArea {
+ anchors.fill: parent
+ onClicked: {
+ const current_fiat = API.app.settings_pg.current_currency
+ const available_fiats = API.app.settings_pg.get_available_currencies()
+ const current_index = available_fiats.indexOf(
+ current_fiat)
+ const next_index = (current_index + 1)
+ % available_fiats.length
+ const next_fiat = available_fiats[next_index]
+ API.app.settings_pg.current_currency = next_fiat
+ }
+ }
+ }
+ }
+
+ DexLabel {
+ text: " | "
+ opacity: .1
+ font.family: 'Montserrat'
+ font.weight: Font.Medium
+ visible: _label.visible
+ color: DexTheme.foregroundColor
+ anchors.verticalCenter: parent.verticalCenter
+ leftPadding: 2
+ }
+ DexIconButton {
+ opacity: containsMouse? 1 : .8
+ anchors.verticalCenter: parent.verticalCenter
+ iconSize: 22
+ icon: Qaterial.Icons.bellOutline
+ visible: _label.visible
+ active: app.notification_modal.opened
+ AnimatedRectangle
+ {
+ z: 1
+ anchors.right: parent.right
+ anchors.rightMargin: -3
+ y: -3
+ radius: width/2
+ width: count_text.height * 1.4
+ height: width
+ visible: app.notifications_list !== undefined? app.notifications_list.length > 0 : false
+ color: DexTheme.redColor
+
+ DefaultText
+ {
+ id: count_text
+ anchors.centerIn: parent
+ text_value: _label.visible ? app.notifications_list.length ?? 0 : 0
+ font.pixelSize: 8
+ font.family: 'Lato'
+ color: DexTheme.foregroundColor
+ }
+ }
+ onClicked:
+ {
+ if (app.notification_modal.visible)
+ app.notification_modal.close()
+ else
+ app.notification_modal.openAt(mapToItem(Overlay.overlay, -165, 18), Item.Top)
+ }
+ }
+
+ DexLabel {
+ text: " | "
+ opacity: .1
+ font.family: 'Montserrat'
+ font.weight: Font.Medium
+ visible: _label.visible && DexTheme.theme !== "undefined"
+ color: DexTheme.foregroundColor
+ anchors.verticalCenter: parent.verticalCenter
+ leftPadding: 2
+ }
+
+ Settings {
+ id: atomic_settings0
+ fileName: atomic_cfg_file
+ }
- DexWindowControl { }
+ DexIconButton {
+ opacity: containsMouse ? 1 : .8
+ anchors.verticalCenter: parent.verticalCenter
+ iconSize: 22
+ icon: DexTheme.theme !== "dark" ? Qaterial.Icons.moonWaxingCrescent : Qaterial.Icons.whiteBalanceSunny
+ visible: _label.visible && DexTheme.theme !== "undefined"
+ active: app.notification_modal.opened
+ onClicked: {
+ let themeList = API.qt_utilities.get_themes_list()
+ if(DexTheme.theme === "light") {
+ app.themeManager.apply("Dark")
+ } else {
+ app.themeManager.apply("Light")
+ }
+ }
+ }
+ }
+ }
}
diff --git a/ci_tools_atomic_dex/ci_scripts/ATOMICDEXinstaller_script.iss b/ci_tools_atomic_dex/ci_scripts/ATOMICDEXinstaller_script.iss
new file mode 100644
index 0000000000..17d94e2837
--- /dev/null
+++ b/ci_tools_atomic_dex/ci_scripts/ATOMICDEXinstaller_script.iss
@@ -0,0 +1,56 @@
+; Script generated by the Inno Setup Script Wizard.
+; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
+
+#define MyAppName "AtomicDEX-Desktop"
+#define MyAppVersion "0.5.0"
+#define MyAppPublisher "Komodo Platform"
+#define MyAppURL "https://www.komodoplatform.com/"
+#define MyAppExeName "atomicdex-desktop.exe"
+#define MyUserName "smk"
+#define CommitHash "b2ce1cc"
+
+
+[Setup]
+; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications.
+; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
+AppId={{90029764-AA48-42FF-BC33-CF81815DF799}
+AppName={#MyAppName}
+AppVersion={#MyAppVersion}
+;AppVerName={#MyAppName} {#MyAppVersion}
+AppPublisher={#MyAppPublisher}
+AppPublisherURL={#MyAppURL}
+AppSupportURL={#MyAppURL}
+AppUpdatesURL={#MyAppURL}
+DefaultDirName={pf}\{#MyAppName}
+DisableProgramGroupPage=yes
+; Uncomment the following line to run in non administrative install mode (install for current user only.)
+;PrivilegesRequired=lowest
+;PrivilegesRequiredOverridesAllowed=dialog
+OutputDir=C:\Users\{#MyUserName}\Documents\temp
+OutputBaseFilename=atomicdex-desktop-{#MyAppVersion}-windows-installer
+SetupIconFile=C:\Users\{#MyUserName}\Downloads\atomicdex-desktop-windows-10-qt-5-15-2-{#CommitHash}.zip\bin\assets\logo\dex-logo.ico
+Compression=lzma
+SolidCompression=yes
+WizardStyle=modern
+
+[Languages]
+Name: "english"; MessagesFile: "compiler:Default.isl"
+Name: "french"; MessagesFile: "compiler:Languages\French.isl"
+Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl"
+Name: "turkish"; MessagesFile: "compiler:Languages\Turkish.isl"
+
+[Tasks]
+Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
+
+[Files]
+Source: "C:\Users\{#MyUserName}\Downloads\atomicdex-desktop-windows-10-qt-5-15-2-{#CommitHash}.zip\bin\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion
+Source: "C:\Users\{#MyUserName}\Downloads\atomicdex-desktop-windows-10-qt-5-15-2-{#CommitHash}.zip\bin\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
+; NOTE: Don't use "Flags: ignoreversion" on any shared system files
+
+[Icons]
+Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
+Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
+
+[Run]
+Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
+
diff --git a/ci_tools_atomic_dex/ci_scripts/DOGEDEXinstaller_script.iss b/ci_tools_atomic_dex/ci_scripts/DOGEDEXinstaller_script.iss
new file mode 100644
index 0000000000..a8a58e48a3
--- /dev/null
+++ b/ci_tools_atomic_dex/ci_scripts/DOGEDEXinstaller_script.iss
@@ -0,0 +1,55 @@
+; Script generated by the Inno Setup Script Wizard.
+; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
+
+#define MyAppName "DogeDEX-Desktop"
+#define MyAppVersion "0.5.0"
+#define MyAppPublisher "Komodo Platform"
+#define MyAppURL "https://github.com/KomodoPlatform/Dogedex-Desktop"
+#define MyAppExeName "DogeDEX.exe"
+#define MyUserName "smk"
+#define CommitHash "c79a13f"
+
+[Setup]
+; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications.
+; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
+AppId={{AD28848A-FE6D-4837-BADE-825AADB17C26}
+AppName={#MyAppName}
+AppVersion={#MyAppVersion}
+;AppVerName={#MyAppName} {#MyAppVersion}
+AppPublisher={#MyAppPublisher}
+AppPublisherURL={#MyAppURL}
+AppSupportURL={#MyAppURL}
+AppUpdatesURL={#MyAppURL}
+DefaultDirName={pf}\{#MyAppName}
+DisableProgramGroupPage=yes
+; Uncomment the following line to run in non administrative install mode (install for current user only.)
+;PrivilegesRequired=lowest
+;PrivilegesRequiredOverridesAllowed=dialog
+OutputDir=C:\Users\{#MyUserName}\Documents\temp
+OutputBaseFilename=dogedex-desktop-{#MyAppVersion}-windows-installer
+SetupIconFile=C:\Users\{#MyUserName}\Downloads\DogeDEX-windows-10-qt-5-15-2-{#CommitHash}.zip\bin\assets\logo\dex-logo.ico
+Compression=lzma
+SolidCompression=yes
+WizardStyle=modern
+
+[Languages]
+Name: "english"; MessagesFile: "compiler:Default.isl"
+Name: "french"; MessagesFile: "compiler:Languages\French.isl"
+Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl"
+Name: "turkish"; MessagesFile: "compiler:Languages\Turkish.isl"
+
+[Tasks]
+Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
+
+[Files]
+Source: "C:\Users\{#MyUserName}\Downloads\DogeDEX-windows-10-qt-5-15-2-{#CommitHash}.zip\bin\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion
+Source: "C:\Users\{#MyUserName}\Downloads\DogeDEX-windows-10-qt-5-15-2-{#CommitHash}.zip\bin\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
+; NOTE: Don't use "Flags: ignoreversion" on any shared system files
+
+[Icons]
+Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
+Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
+
+[Run]
+Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
+
diff --git a/ci_tools_atomic_dex/ci_scripts/GLEECDEXinstaller_script.iss b/ci_tools_atomic_dex/ci_scripts/GLEECDEXinstaller_script.iss
new file mode 100644
index 0000000000..9620861cdb
--- /dev/null
+++ b/ci_tools_atomic_dex/ci_scripts/GLEECDEXinstaller_script.iss
@@ -0,0 +1,55 @@
+; Script generated by the Inno Setup Script Wizard.
+; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
+
+#define MyAppName "GleecDEX-Desktop"
+#define MyAppVersion "0.5.0"
+#define MyAppPublisher "Komodo Platform"
+#define MyAppURL "https://github.com/KomodoPlatform/atomicDEX-Desktop"
+#define MyAppExeName "GleecDEX.exe"
+#define MyUserName "smk"
+#define CommitHash "cc57ab3"
+
+[Setup]
+; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications.
+; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
+AppId={{C0D15863-2E52-409B-BAD6-CF27A28B6717}
+AppName={#MyAppName}
+AppVersion={#MyAppVersion}
+;AppVerName={#MyAppName} {#MyAppVersion}
+AppPublisher={#MyAppPublisher}
+AppPublisherURL={#MyAppURL}
+AppSupportURL={#MyAppURL}
+AppUpdatesURL={#MyAppURL}
+DefaultDirName={pf}\{#MyAppName}
+DisableProgramGroupPage=yes
+; Uncomment the following line to run in non administrative install mode (install for current user only.)
+;PrivilegesRequired=lowest
+;PrivilegesRequiredOverridesAllowed=dialog
+OutputDir=C:\Users\{#MyUserName}\Documents\temp
+OutputBaseFilename=GleecDEX-{#MyAppVersion}-windows-installer
+SetupIconFile=C:\Users\{#MyUserName}\Downloads\GleecDEX-windows-10-qt-5-15-2-{#CommitHash}.zip\bin\assets\logo\dex-logo.ico
+Compression=lzma
+SolidCompression=yes
+WizardStyle=modern
+
+[Languages]
+Name: "english"; MessagesFile: "compiler:Default.isl"
+Name: "french"; MessagesFile: "compiler:Languages\French.isl"
+Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl"
+Name: "turkish"; MessagesFile: "compiler:Languages\Turkish.isl"
+
+[Tasks]
+Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
+
+[Files]
+Source: "C:\Users\{#MyUserName}\Downloads\GleecDEX-windows-10-qt-5-15-2-{#CommitHash}.zip\bin\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion
+Source: "C:\Users\{#MyUserName}\Downloads\GleecDEX-windows-10-qt-5-15-2-{#CommitHash}.zip\bin\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
+; NOTE: Don't use "Flags: ignoreversion" on any shared system files
+
+[Icons]
+Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
+Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
+
+[Run]
+Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
+
diff --git a/ci_tools_atomic_dex/ci_scripts/SMARTDEXinstaller_script.iss b/ci_tools_atomic_dex/ci_scripts/SMARTDEXinstaller_script.iss
new file mode 100644
index 0000000000..1f262661c6
--- /dev/null
+++ b/ci_tools_atomic_dex/ci_scripts/SMARTDEXinstaller_script.iss
@@ -0,0 +1,55 @@
+; Script generated by the Inno Setup Script Wizard.
+; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
+
+#define MyAppName "SmartDEX-Desktop"
+#define MyAppVersion "0.5.0"
+#define MyAppPublisher "Komodo Platform"
+#define MyAppURL "https://help.smartfi.com/hc/en-us"
+#define MyAppExeName "smartdex-desktop.exe"
+#define MyUserName "smk"
+#define CommitHash "b2ce1cc"
+
+[Setup]
+; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications.
+; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
+AppId={{90029764-AA48-42FF-BC33-CF81815DF799}
+AppName={#MyAppName}
+AppVersion={#MyAppVersion}
+;AppVerName={#MyAppName} {#MyAppVersion}
+AppPublisher={#MyAppPublisher}
+AppPublisherURL={#MyAppURL}
+AppSupportURL={#MyAppURL}
+AppUpdatesURL={#MyAppURL}
+DefaultDirName={pf}\{#MyAppName}
+DisableProgramGroupPage=yes
+; Uncomment the following line to run in non administrative install mode (install for current user only.)
+;PrivilegesRequired=lowest
+;PrivilegesRequiredOverridesAllowed=dialog
+OutputDir=C:\Users\{#MyUserName}\Documents\temp
+OutputBaseFilename=smartdex-desktop-{#MyAppVersion}-windows-installer
+SetupIconFile=C:\Users\{#MyUserName}\Downloads\smartdex-desktop-windows-10-qt-5-15-2-{#CommitHash}.zip\bin\assets\logo\dex-logo.ico
+Compression=lzma
+SolidCompression=yes
+WizardStyle=modern
+
+[Languages]
+Name: "english"; MessagesFile: "compiler:Default.isl"
+Name: "french"; MessagesFile: "compiler:Languages\French.isl"
+Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl"
+Name: "turkish"; MessagesFile: "compiler:Languages\Turkish.isl"
+
+[Tasks]
+Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
+
+[Files]
+Source: "C:\Users\{#MyUserName}\Downloads\smartdex-desktop-windows-10-qt-5-15-2-{#CommitHash}.zip\bin\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion
+Source: "C:\Users\{#MyUserName}\Downloads\smartdex-desktop-windows-10-qt-5-15-2-{#CommitHash}.zip\bin\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
+; NOTE: Don't use "Flags: ignoreversion" on any shared system files
+
+[Icons]
+Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
+Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
+
+[Run]
+Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
+
diff --git a/ci_tools_atomic_dex/ci_scripts/linux_script.sh b/ci_tools_atomic_dex/ci_scripts/linux_script.sh
index cc9b1a2014..3e4f0b8310 100755
--- a/ci_tools_atomic_dex/ci_scripts/linux_script.sh
+++ b/ci_tools_atomic_dex/ci_scripts/linux_script.sh
@@ -31,19 +31,19 @@ sudo apt-get install build-essential \
# get llvm
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
-sudo ./llvm.sh 11
+sudo ./llvm.sh 12
# set clang version
-sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-11 777
-sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-11 777
+sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-12 777
+sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-12 777
# set gnu compilers version
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 777
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 777
sudo apt-get update
sudo apt-get install libc++abi-11-dev libc++-11-dev -y
-export CXXFLAGS=-stdlib=libc++
-export LDFLAGS=-stdlib=libc++
-export CXX=clang++-11
-export CC=clang-11
+#export CXXFLAGS=-stdlib=libc++
+#export LDFLAGS=-stdlib=libc++
+export CXX=clang++-12
+export CC=clang-12
# get right cmake version
wget https://github.com/Kitware/CMake/releases/download/v3.19.0-rc3/cmake-3.19.0-rc3-Linux-x86_64.tar.gz
diff --git a/ci_tools_atomic_dex/ci_scripts/windows_script.ps1 b/ci_tools_atomic_dex/ci_scripts/windows_script.ps1
index 5d55630bd1..075c4d16fc 100644
--- a/ci_tools_atomic_dex/ci_scripts/windows_script.ps1
+++ b/ci_tools_atomic_dex/ci_scripts/windows_script.ps1
@@ -10,7 +10,7 @@ $ENV:PATH=$ENV:PATH+';'+($PWD | select -exp Path)+'\nim-1.2.6\bin;'+$ENV:UserPro
Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh')
scoop install llvm --global
scoop install ninja --global
-scoop install cmake@3.18.4 --global
+scoop install cmake@3.20.5 --global
scoop install git --global
scoop install 7zip --global
scoop cache rm 7zip
diff --git a/ci_tools_atomic_dex/linux_misc/Dockerfile b/ci_tools_atomic_dex/linux_misc/Dockerfile
new file mode 100644
index 0000000000..53aa1defb3
--- /dev/null
+++ b/ci_tools_atomic_dex/linux_misc/Dockerfile
@@ -0,0 +1,41 @@
+FROM ubuntu:18.04
+MAINTAINER smk
+ENV QT_VERSION=5.15.2
+ENV CMAKE_VERSION=3.20.5
+
+RUN apt-get -y update && \
+ apt-get -y upgrade && \
+ apt-get install software-properties-common -y && \
+ add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
+ apt-get -y install build-essential libgl1-mesa-dev ninja-build curl wget zstd lsb-release libpulse-dev libtool autoconf unzip libssl-dev libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb1-dev libxcb-keysyms1-dev libxcb-render-util0-dev libxcb-xinerama0 libgstreamer-plugins-base1.0-dev git zip unzip python3-pip python-pip wget gcc-9 g++-9 python-pyqt5 libssl-dev libxcursor-dev libxcomposite-dev libxdamage-dev libxrandr-dev libfontconfig1-dev libxss-dev libxtst-dev libpci-dev libcap-dev libsrtp0-dev libasound2-dev libnspr4-dev libnss3-dev ninja-build -y && \
+ apt-get clean && \
+ rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
+
+RUN wget https://apt.llvm.org/llvm.sh; chmod +x llvm.sh; ./llvm.sh 12; \
+ update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-12 777; \
+ update-alternatives --install /usr/bin/clang clang /usr/bin/clang-12 777; \
+ update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 777; \
+ update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 777; \
+ apt-get update; \
+ export CXX=clang++-12; \
+ export CC=clang-12;
+
+RUN wget https://github.com/Kitware/CMake/releases/download/v$CMAKE_VERSION/cmake-$CMAKE_VERSION-linux-x86_64.tar.gz; \
+ tar xvf cmake-$CMAKE_VERSION-linux-x86_64.tar.gz; curdir=$(pwd); \
+ export PATH=${PATH}:${curdir}/cmake-$CMAKE_VERSION-linux-x86_64/bin;
+
+RUN python3 -m pip install --upgrade pip; \
+ python3 -m pip install setuptools wheel; \
+ python3 -m pip install py7zr==0.16.1; \
+ python3 -m pip install aqtinstall==1.2.1; \
+ python3 -m aqt install -O /opt/Qt $QT_VERSION linux desktop -b https://qt-mirror.dannhauer.de/ -m qtcharts qtwidgets debug_info qtwebengine qtwebview;
+
+RUN git clone https://github.com/KomodoPlatform/libwally-core.git; \
+ cd libwally-core; ./tools/autogen.sh; ./configure --disable-shared; make -j2 install; cd ..;
+
+RUN export QT_INSTALL_CMAKE_PATH=/opt/Qt/$QT_VERSION/gcc_64/lib/cmake; \
+ export QT_ROOT=/opt/Qt/$QT_VERSION; \
+ export Qt5_DIR=/opt/Qt/$QT_VERSION/gcc_64/lib/cmake/Qt5; \
+ export PATH=/opt/Qt/$QT_VERSION/gcc_64/bin:$PATH
+
+CMD ["entrypoint"]
diff --git a/ci_tools_atomic_dex/vcpkg-custom-ports b/ci_tools_atomic_dex/vcpkg-custom-ports
index cd6c91ce12..19453b682d 160000
--- a/ci_tools_atomic_dex/vcpkg-custom-ports
+++ b/ci_tools_atomic_dex/vcpkg-custom-ports
@@ -1 +1 @@
-Subproject commit cd6c91ce12494c9f7ce1edd1a9562177525029a6
+Subproject commit 19453b682d43a354235b20809f59761d899a50ee
diff --git a/cmake/dependencies.cmake b/cmake/dependencies.cmake
index bc0562478e..f8095790f8 100644
--- a/cmake/dependencies.cmake
+++ b/cmake/dependencies.cmake
@@ -80,7 +80,7 @@ find_package(Qt5 5.15 COMPONENTS Core Quick LinguistTools Svg Charts WebEngine W
#find_package(Qt5)
set(BUILD_TESTING OFF CACHE BOOL "Override option" FORCE)
-set(REPROC++ ON CACHE BOOL "" FORCE)
+#set(REPROC++ ON CACHE BOOL "" FORCE)
FetchContent_Declare(
doom_st
@@ -92,10 +92,10 @@ FetchContent_Declare(
URL https://github.com/KomodoPlatform/meta/archive/master.zip
)
-FetchContent_Declare(
- reproc
- URL https://github.com/KomodoPlatform/reproc/archive/v14.2.1.zip
-)
+#FetchContent_Declare(
+# reproc
+# URL https://github.com/KomodoPlatform/reproc/archive/v14.2.1.zip
+#)
set(EXPECTED_ENABLE_TESTS OFF CACHE BOOL "Override option" FORCE)
@@ -122,11 +122,11 @@ add_library(refl-cpp INTERFACE)
target_include_directories(refl-cpp INTERFACE ${refl-cpp_SOURCE_DIR})
add_library(antara::refl-cpp ALIAS refl-cpp)
-FetchContent_GetProperties(reproc)
-if (NOT reproc_POPULATED)
- FetchContent_Populate(reproc)
- add_subdirectory(${reproc_SOURCE_DIR} ${reproc_BINARY_DIR} EXCLUDE_FROM_ALL)
-endif ()
+#FetchContent_GetProperties(reproc)
+#if (NOT reproc_POPULATED)
+ # FetchContent_Populate(reproc)
+ # add_subdirectory(${reproc_SOURCE_DIR} ${reproc_BINARY_DIR} EXCLUDE_FROM_ALL)
+#endif ()
FetchContent_GetProperties(expected)
if (NOT expected_POPULATED)
diff --git a/cmake/install/macos/dex_install.cmake b/cmake/install/macos/dex_install.cmake
index cf00bf0898..3dfda7315a 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.4.3
- MACOSX_BUNDLE_LONG_VERSION_STRING 0.4.3
+ MACOSX_BUNDLE_SHORT_VERSION_STRING 0.5.0
+ MACOSX_BUNDLE_LONG_VERSION_STRING 0.5.0
MACOSX_BUNDLE_INFO_PLIST "${PROJECT_SOURCE_DIR}/cmake/MacOSXBundleInfo.plist.in")
add_custom_command(TARGET ${PROJECT_NAME}
POST_BUILD COMMAND
diff --git a/cmake/ipo_prerequisites.cmake b/cmake/ipo_prerequisites.cmake
index c52fcb1d61..5553ed66a8 100644
--- a/cmake/ipo_prerequisites.cmake
+++ b/cmake/ipo_prerequisites.cmake
@@ -3,7 +3,7 @@ if (CMAKE_BUILD_TYPE STREQUAL "Release")
include(CheckIPOSupported)
check_ipo_supported(RESULT ipo_supported OUTPUT output)
if (ipo_supported)
- set(CMAKE_INTERPROCEDURAL_OPTIMIZATION ON)
+ #set(CMAKE_INTERPROCEDURAL_OPTIMIZATION ON)
message(STATUS "We are in release - Successfully enabled IPO")
else ()
message(WARNING "IPO NOT SUPPORTED - Skipping reason: ${output}")
diff --git a/hot_reload/cmake/Configuration.cmake b/hot_reload/cmake/Configuration.cmake
deleted file mode 100644
index 5eeb47619d..0000000000
--- a/hot_reload/cmake/Configuration.cmake
+++ /dev/null
@@ -1,47 +0,0 @@
-# MIT License
-#
-# Copyright (c) 2020 Olivier Le Doeuff
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in all
-# copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-# SOFTWARE.
-
-include(hot_reload/cmake/Version.cmake)
-
-set(QATERIALHOTRELOAD_PROJECT "QaterialHotReload" CACHE STRING "Project Name")
-set(QATERIALHOTRELOAD_FOLDER_PREFIX "Qaterial/HotReload" CACHE STRING "Prefix folder for all Qaterial generated targets in generated project (only decorative)")
-set(QATERIALHOTRELOAD_BUILD_SHARED OFF CACHE BOOL "Build QaterialHotReloadApp as a shared library (for android)")
-# Might be useful to disable if you only want the HotReload Gui to integrate into your project
-set(QATERIALHOTRELOAD_ENABLE_HOTRELOAD_APP ON CACHE BOOL "Build Qaterial HotReload application")
-set(QATERIALHOTRELOAD_IGNORE_ENV OFF CACHE BOOL "Ignore qt environment variables")
-set(QATERIALHOTRELOAD_ENABLE_PCH ON CACHE BOOL
- "Enable precompile headers support for 'QaterialHotReload'. \"
- Only work if CMake support 'target_precompile_headers'. \"
- This can speed up compilation time.")
-
-message(STATUS "------ ${QATERIALHOTRELOAD_PROJECT} Configuration ------")
-
-message(STATUS "QATERIALHOTRELOAD_PROJECT : ${QATERIALHOTRELOAD_PROJECT}")
-message(STATUS "QATERIALHOTRELOAD_VERSION : ${QATERIALHOTRELOAD_VERSION}")
-message(STATUS "QATERIALHOTRELOAD_VERSION_TAG_HEX : ${QATERIALHOTRELOAD_VERSION_TAG_HEX}")
-message(STATUS "QATERIALHOTRELOAD_BUILD_SHARED : ${QATERIALHOTRELOAD_BUILD_SHARED}")
-message(STATUS "QATERIALHOTRELOAD_IGNORE_ENV : ${QATERIALHOTRELOAD_IGNORE_ENV}")
-message(STATUS "QATERIALHOTRELOAD_FOLDER_PREFIX : ${QATERIALHOTRELOAD_FOLDER_PREFIX}")
-
-message(STATUS "QATERIALHOTRELOAD_ENABLE_HOTRELOAD_APP : ${QATERIALHOTRELOAD_ENABLE_HOTRELOAD_APP}")
-
-message(STATUS "------ ${QATERIALHOTRELOAD_PROJECT} End Configuration ------")
diff --git a/hot_reload/cmake/Dependencies.cmake b/hot_reload/cmake/Dependencies.cmake
deleted file mode 100644
index 4383978c43..0000000000
--- a/hot_reload/cmake/Dependencies.cmake
+++ /dev/null
@@ -1,68 +0,0 @@
-# MIT License
-#
-# Copyright (c) 2020 Olivier Le Doeuff
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in all
-# copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-# SOFTWARE.
-
-## CMake Platforms scripts
-
-set(QTSTATICCMAKE_REPOSITORY "https://github.com/OlivierLDff/QtStaticCMake.git" CACHE STRING "QtStaticCMake repository, can be a local URL")
-set(QTSTATICCMAKE_TAG "master" CACHE STRING "QtStaticCMake git tag")
-
-set(QLINUXCMAKE_REPOSITORY "https://github.com/OlivierLDff/QtLinuxCMake.git" CACHE STRING "QtLinuxCMake repository, can be a local URL")
-set(QLINUXCMAKE_TAG "b9f2108feb0523c844fd5ecd19f4e240d786a48b" CACHE STRING "QtLinuxCMake git tag")
-
-set(QTWINDOWSCMAKE_REPOSITORY "https://github.com/OlivierLDff/QtWindowsCMake" CACHE STRING "Repository of QtWindowsCMake")
-set(QTWINDOWSCMAKE_TAG "8f324287de9e568eec905091750533d0dbec7cbc" CACHE STRING "Git Tag of QtWindowsCMake")
-
-set(QBC_REPOSITORY "https://github.com/OlivierLdff/QBCInstaller.git" CACHE STRING "QBC repository, can be a local URL")
-set(QBC_TAG "965118e5570da9bcc53662abc8c0525f04751c89" CACHE STRING "QBC git tag")
-
-set(QTMACCMAKE_REPOSITORY "https://github.com/OlivierLDff/QtMacCMake.git" CACHE STRING "QtMacCMake repository, can be a local URL")
-set(QTMACCMAKE_TAG "a398dd9c529aeda674fd63af747d84e0752732fd" CACHE STRING "QtMacCMake git tag")
-
-## CMake Resources scripts
-
-set(QTGENERATORCMAKE_REPOSITORY "https://github.com/OlivierLDff/QtGeneratorCMake.git" CACHE STRING "QtGeneratorCMake repository, can be a local URL")
-set(QTGENERATORCMAKE_TAG "master" CACHE STRING "QtGeneratorCMake git tag")
-
-set(FETCHGOOGLEFONTCMAKE_REPOSITORY "https://github.com/OlivierLDff/FetchGoogleFontCMake.git" CACHE STRING "FetchGoogleFontCMake repository, can be a local URL")
-set(FETCHGOOGLEFONTCMAKE_TAG "master" CACHE STRING "FetchGoogleFontCMake git tag")
-
-set(GOOGLEFONTS_REPOSITORY "https://github.com/OlivierLDff/fonts" CACHE STRING "Google fonts repository, can be a local URL")
-set(GOOGLEFONTS_TAG "master" CACHE STRING "Google fonts git tag")
-
-set(MATERIALDESIGNICONS_REPOSITORY "https://github.com/OlivierLDff/MaterialDesignSvgo" CACHE STRING "MaterialDesignIcons repository url")
-set(MATERIALDESIGNICONS_TAG master CACHE STRING "MaterialDesignIcons git tag")
-
-## Qml Libraries
-
-set(SFPM_REPOSITORY "https://github.com/OlivierLDff/SortFilterProxyModel.git" CACHE STRING "SortFilterProxyModel repository url")
-set(SFPM_TAG "master" CACHE STRING "SortFilterProxyModel git tag")
-
-set(QATERIAL_REPOSITORY "https://github.com/OlivierLDff/Qaterial.git" CACHE STRING "Qaterial repository url")
-set(QATERIAL_TAG "master" CACHE STRING "Qaterial git tag")
-
-## C++ libraries
-
-set(SPDLOG_REPOSITORY "https://github.com/gabime/spdlog" CACHE STRING "spdlog repository url")
-set(SPDLOG_TAG "v1.x" CACHE STRING "spdlog git tag")
-
-set(QOLM_REPOSITORY "https://github.com/OlivierLDff/QOlm.git" CACHE STRING "QOlm repository url")
-set(QOLM_TAG "master" CACHE STRING "QOlm git tag")
diff --git a/hot_reload/cmake/FetchDependencies.cmake b/hot_reload/cmake/FetchDependencies.cmake
deleted file mode 100644
index e6532c8e51..0000000000
--- a/hot_reload/cmake/FetchDependencies.cmake
+++ /dev/null
@@ -1,60 +0,0 @@
-# MIT License
-#
-# Copyright (c) 2020 Olivier Le Doeuff
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in all
-# copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-# SOFTWARE.
-
-#include(${PROJECT_SOURCE_DIR}/cmake/Dependencies.cmake)
-
-find_package(Qt5 REQUIRED COMPONENTS
- Core
- Gui
- Qml
- Quick
- QuickControls2
- Svg
- Xml
- QuickCompiler
-)
-
-find_package(Qt5 QUIET COMPONENTS
- Charts
- DataVisualization
- VirtualKeyboard
- WebChannel
- WebSockets
- WebEngine
-
- 3DCore
- 3DRender
- 3DInput
- 3DLogic
- 3DExtras
- 3DAnimation
-
- Quick3D
- Quick3DAssetImport
- Quick3DRender
- Quick3DRuntimeRender
- Quick3DUtils
-)
-
-include(${PROJECT_SOURCE_DIR}/hot_reload/cmake/FetchQtGeneratorCMake.cmake)
-include(${PROJECT_SOURCE_DIR}/hot_reload/cmake/FetchSortFilterProxyModel.cmake)
-#include(${PROJECT_SOURCE_DIR}/cmake/FetchQaterial.cmake)
diff --git a/hot_reload/cmake/FetchGoogleFontCMake.cmake b/hot_reload/cmake/FetchGoogleFontCMake.cmake
deleted file mode 100644
index 16fb4a1a6f..0000000000
--- a/hot_reload/cmake/FetchGoogleFontCMake.cmake
+++ /dev/null
@@ -1,13 +0,0 @@
-include(FetchContent)
-
-set(FETCHGOOGLEFONTCMAKE_REPOSITORY "https://github.com/OlivierLDff/FetchGoogleFontCMake.git" CACHE STRING "FetchGoogleFontCMake repository, can be a local URL")
-set(FETCHGOOGLEFONTCMAKE_TAG "master" CACHE STRING "FetchGoogleFontCMake git tag")
-
-FetchContent_Declare(
- FetchGoogleFontCMake
- GIT_REPOSITORY ${FETCHGOOGLEFONTCMAKE_REPOSITORY}
- GIT_TAG ${FETCHGOOGLEFONTCMAKE_TAG}
- GIT_SHALLOW 1
-)
-
-FetchContent_MakeAvailable(FetchGoogleFontCMake)
diff --git a/hot_reload/cmake/FetchMaterialDesignIcons.cmake b/hot_reload/cmake/FetchMaterialDesignIcons.cmake
deleted file mode 100644
index ddedb08dbf..0000000000
--- a/hot_reload/cmake/FetchMaterialDesignIcons.cmake
+++ /dev/null
@@ -1,16 +0,0 @@
-include(FetchContent)
-
-set(MATERIALDESIGNICONS_REPOSITORY "https://github.com/OlivierLDff/MaterialDesignSvgo" CACHE STRING "MaterialDesignIcons repository url")
-set(MATERIALDESIGNICONS_TAG master CACHE STRING "MaterialDesignIcons git tag")
-
-FetchContent_Declare(
- MaterialDesignIcons
- GIT_REPOSITORY ${MATERIALDESIGNICONS_REPOSITORY}
- GIT_TAG ${MATERIALDESIGNICONS_TAG}
- GIT_SHALLOW 1
-)
-
-message(STATUS "Download MaterialDesignIcons from ${MATERIALDESIGNICONS_REPOSITORY}")
-FetchContent_MakeAvailable(MaterialDesignIcons)
-
-set(MATERIALDESIGNICONS_ICONS_DIR "${materialdesignicons_SOURCE_DIR}/svg")
diff --git a/hot_reload/cmake/FetchQOlm.cmake b/hot_reload/cmake/FetchQOlm.cmake
deleted file mode 100644
index d8fc4a816f..0000000000
--- a/hot_reload/cmake/FetchQOlm.cmake
+++ /dev/null
@@ -1,14 +0,0 @@
-include(FetchContent)
-
-set(QOLM_REPOSITORY "https://github.com/OlivierLDff/QOlm.git" CACHE STRING "QOlm repository url")
-set(QOLM_TAG master CACHE STRING "QOlm git tag")
-
-FetchContent_Declare(
- QOlm
- GIT_REPOSITORY ${QOLM_REPOSITORY}
- GIT_TAG ${QOLM_TAG}
- GIT_SHALLOW 1
-)
-
-set(QOLM_FOLDER_PREFIX "Dependencies" CACHE STRING "Prefix folder for all QOlm generated targets in generated project (only decorative)")
-FetchContent_MakeAvailable(QOlm)
diff --git a/hot_reload/cmake/FetchQaterial.cmake b/hot_reload/cmake/FetchQaterial.cmake
deleted file mode 100644
index 7f09ed0978..0000000000
--- a/hot_reload/cmake/FetchQaterial.cmake
+++ /dev/null
@@ -1,12 +0,0 @@
-include(FetchContent)
-
-set(QATERIAL_REPOSITORY "https://github.com/KomodoPlatform/Qaterial.git" CACHE STRING "Qaterial repository url")
-set(QATERIAL_TAG master CACHE STRING "Qaterial git tag")
-
-FetchContent_Declare(
- Qaterial
- GIT_REPOSITORY ${QATERIAL_REPOSITORY}
- GIT_TAG ${QATERIAL_TAG}
-)
-
-FetchContent_MakeAvailable(Qaterial)
diff --git a/hot_reload/cmake/FetchQtGeneratorCMake.cmake b/hot_reload/cmake/FetchQtGeneratorCMake.cmake
deleted file mode 100644
index 5a469cccaf..0000000000
--- a/hot_reload/cmake/FetchQtGeneratorCMake.cmake
+++ /dev/null
@@ -1,13 +0,0 @@
-include(FetchContent)
-
-set(QTGENERATORCMAKE_REPOSITORY "https://github.com/OlivierLDff/QtGeneratorCMake.git" CACHE STRING "QtGeneratorCMake repository, can be a local URL")
-set(QTGENERATORCMAKE_TAG "master" CACHE STRING "QtGeneratorCMake git tag")
-
-FetchContent_Declare(
- QtGeneratorCMake
- GIT_REPOSITORY ${QTGENERATORCMAKE_REPOSITORY}
- GIT_TAG ${QTGENERATORCMAKE_TAG}
- GIT_SHALLOW 1
-)
-
-FetchContent_MakeAvailable(QtGeneratorCMake)
diff --git a/hot_reload/cmake/FetchQtLinuxCMake.cmake b/hot_reload/cmake/FetchQtLinuxCMake.cmake
deleted file mode 100644
index 8886018612..0000000000
--- a/hot_reload/cmake/FetchQtLinuxCMake.cmake
+++ /dev/null
@@ -1,12 +0,0 @@
-include(FetchContent)
-
-set(QLINUXCMAKE_REPOSITORY "https://github.com/OlivierLDff/QtLinuxCMake.git" CACHE STRING "QtLinuxCMake repository, can be a local URL")
-set(QLINUXCMAKE_TAG "main" CACHE STRING "QtLinuxCMake git tag")
-
-FetchContent_Declare(
- QtLinuxCMake
- GIT_REPOSITORY ${QLINUXCMAKE_REPOSITORY}
- GIT_TAG ${QLINUXCMAKE_TAG}
-)
-
-FetchContent_MakeAvailable(QtLinuxCMake)
\ No newline at end of file
diff --git a/hot_reload/cmake/FetchQtMacCMake.cmake b/hot_reload/cmake/FetchQtMacCMake.cmake
deleted file mode 100644
index 288cf05d0f..0000000000
--- a/hot_reload/cmake/FetchQtMacCMake.cmake
+++ /dev/null
@@ -1,12 +0,0 @@
-include(FetchContent)
-
-set(QTMACCMAKE_REPOSITORY "https://github.com/OlivierLDff/QtMacCMake.git" CACHE STRING "QtMacCMake repository, can be a local URL")
-set(QTMACCMAKE_TAG "main" CACHE STRING "QtMacCMake git tag")
-
-FetchContent_Declare(
- QtMacCMake
- GIT_REPOSITORY ${QTMACCMAKE_REPOSITORY}
- GIT_TAG ${QTMACCMAKE_TAG}
-)
-
-FetchContent_MakeAvailable(QtMacCMake)
diff --git a/hot_reload/cmake/FetchQtStaticCMake.cmake b/hot_reload/cmake/FetchQtStaticCMake.cmake
deleted file mode 100644
index 2473a487ab..0000000000
--- a/hot_reload/cmake/FetchQtStaticCMake.cmake
+++ /dev/null
@@ -1,13 +0,0 @@
-include(FetchContent)
-
-set(QTSTATICCMAKE_REPOSITORY "https://github.com/OlivierLDff/QtStaticCMake.git" CACHE STRING "QtStaticCMake repository, can be a local URL")
-set(QTSTATICCMAKE_TAG "master" CACHE STRING "QtStaticCMake git tag")
-
-FetchContent_Declare(
- QtStaticCMake
- GIT_REPOSITORY ${QTSTATICCMAKE_REPOSITORY}
- GIT_TAG ${QTSTATICCMAKE_TAG}
- GIT_SHALLOW 1
-)
-
-FetchContent_MakeAvailable(QtStaticCMake)
\ No newline at end of file
diff --git a/hot_reload/cmake/FetchQtWindowsCMake.cmake b/hot_reload/cmake/FetchQtWindowsCMake.cmake
deleted file mode 100644
index 0beb4feae9..0000000000
--- a/hot_reload/cmake/FetchQtWindowsCMake.cmake
+++ /dev/null
@@ -1,23 +0,0 @@
-include(FetchContent)
-
-set(QTWINDOWSCMAKE_REPOSITORY "https://github.com/OlivierLDff/QtWindowsCMake" CACHE STRING "Repository of QtWindowsCMake")
-set(QTWINDOWSCMAKE_TAG "master" CACHE STRING "Git Tag of QtWindowsCMake")
-
-set(QBC_REPOSITORY "https://github.com/OlivierLdff/QBCInstaller.git" CACHE STRING "QBC repository, can be a local URL")
-set(QBC_TAG master CACHE STRING "QBC git tag")
-
-FetchContent_Declare(
- QtWindowsCMake
- GIT_REPOSITORY ${QTWINDOWSCMAKE_REPOSITORY}
- GIT_TAG ${QTWINDOWSCMAKE_TAG}
- GIT_SHALLOW 1
-)
-
-FetchContent_Declare(
- Qbc
- GIT_REPOSITORY ${QBC_REPOSITORY}
- GIT_TAG ${QBC_TAG}
- GIT_SHALLOW 1
-)
-
-FetchContent_MakeAvailable(QtWindowsCMake)
\ No newline at end of file
diff --git a/hot_reload/cmake/FetchSortFilterProxyModel.cmake b/hot_reload/cmake/FetchSortFilterProxyModel.cmake
deleted file mode 100644
index cdb6c52db0..0000000000
--- a/hot_reload/cmake/FetchSortFilterProxyModel.cmake
+++ /dev/null
@@ -1,14 +0,0 @@
-include(FetchContent)
-
-set(SFPM_REPOSITORY "https://github.com/OlivierLDff/SortFilterProxyModel.git" CACHE STRING "SortFilterProxyModel repository url")
-set(SFPM_TAG master CACHE STRING "SortFilterProxyModel git tag")
-
-FetchContent_Declare(
- SortFilterProxyModel
- GIT_REPOSITORY ${SFPM_REPOSITORY}
- GIT_TAG ${SFPM_TAG}
- GIT_SHALLOW 1
-)
-
-set(SFPM_FOLDER_PREFIX "Dependencies" CACHE STRING "Prefix folder for all SortFilterProxyModel generated targets in generated project (only decorative)")
-FetchContent_MakeAvailable(SortFilterProxyModel)
diff --git a/hot_reload/cmake/FetchSpdlog.cmake b/hot_reload/cmake/FetchSpdlog.cmake
deleted file mode 100644
index a4d70c5454..0000000000
--- a/hot_reload/cmake/FetchSpdlog.cmake
+++ /dev/null
@@ -1,15 +0,0 @@
-include(FetchContent)
-
-set(SPDLOG_REPOSITORY "https://github.com/gabime/spdlog" CACHE STRING "spdlog repository url")
-set(SPDLOG_TAG "v1.x" CACHE STRING "spdlog git tag")
-
-FetchContent_Declare(
- spdlog
- GIT_REPOSITORY ${SPDLOG_REPOSITORY}
- GIT_TAG ${SPDLOG_TAG}
- GIT_SHALLOW 1
-)
-
-option(SPDLOG_ENABLE_PCH "Build static or shared library using precompiled header to speed up compilation time" ON)
-FetchContent_MakeAvailable(spdlog)
-set_target_properties(spdlog PROPERTIES FOLDER "Dependencies")
\ No newline at end of file
diff --git a/hot_reload/cmake/Version.cmake b/hot_reload/cmake/Version.cmake
deleted file mode 100644
index 70c8828cc7..0000000000
--- a/hot_reload/cmake/Version.cmake
+++ /dev/null
@@ -1,39 +0,0 @@
-# MIT License
-#
-# Copyright (c) 2020 Olivier Le Doeuff
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in all
-# copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-# SOFTWARE.
-
-set(QATERIALHOTRELOAD_VERSION_MAJOR 1)
-set(QATERIALHOTRELOAD_VERSION_MINOR 1)
-set(QATERIALHOTRELOAD_VERSION_PATCH 0)
-if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git")
- execute_process(
- COMMAND git rev-parse --short HEAD
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
- OUTPUT_VARIABLE QATERIALHOTRELOAD_VERSION_TAG
- OUTPUT_STRIP_TRAILING_WHITESPACE
-)
-endif()
-if(NOT QATERIALHOTRELOAD_VERSION_TAG)
- set(QATERIALHOTRELOAD_VERSION_TAG 00000000)
-endif()
-set(QATERIALHOTRELOAD_VERSION_TAG_HEX 0x${QATERIALHOTRELOAD_VERSION_TAG})
-set(QATERIALHOTRELOAD_VERSION_TAG ${QATERIALHOTRELOAD_VERSION_TAG} CACHE STRING "Git Tag of Qaterial")
-set(QATERIALHOTRELOAD_VERSION ${QATERIALHOTRELOAD_VERSION_MAJOR}.${QATERIALHOTRELOAD_VERSION_MINOR}.${QATERIALHOTRELOAD_VERSION_PATCH} CACHE STRING "Version of Qaterial")
diff --git a/hot_reload/qml/Qaterial/HotReload/CMakeLists.txt b/hot_reload/qml/Qaterial/HotReload/CMakeLists.txt
deleted file mode 100644
index 87025abfcc..0000000000
--- a/hot_reload/qml/Qaterial/HotReload/CMakeLists.txt
+++ /dev/null
@@ -1,63 +0,0 @@
-# Copyright 2019-2020 Olivier Le Doeuff
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation
-# files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy,
-# modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software
-# is furnished to do so, subject to the following conditions:
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
-# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
-# OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-message(STATUS "Generate Qaterial.HotReload qmldir")
-qt_generate_qmldir(QATERIALHOTRELOAD_QMLDIR_FILE
- SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}
- MODULE "Qaterial.HotReload"
-)
-
-message(STATUS "Generate Qaterial.HotReload.Images.qml")
-qt_generate_qrc_alias_qt_object(QATERIALHOTRELOAD_IMAGES_QML
- SINGLETON
- SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/Images
- NAME "${CMAKE_CURRENT_SOURCE_DIR}/Images.qml"
- PREFIX "Qaterial/HotReload/Images"
- GLOB_EXPRESSION "*png;*.svg"
- ALWAYS_OVERWRITE
-)
-
-message(STATUS "Generate QaterialHotReload.qrc")
-qt_generate_qrc(QATERIALHOTRELOAD_QML_QRC
- SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}
- DEST_DIR ${CMAKE_CURRENT_BINARY_DIR}/Generated
- NAME QaterialHotReload.qrc
- PREFIX "Qaterial/HotReload"
- GLOB_EXPRESSION "*.qml;qmldir;*.png;*.svg"
- ALWAYS_OVERWRITE
- RECURSE
-)
-qtquick_compiler_add_resources(QATERIALHOTRELOAD_QML_RES ${QATERIALHOTRELOAD_QML_QRC})
-
-foreach(QATERIAL_CURRENT_QML_FILE ${QATERIALHOTRELOAD_QML_RES})
- source_group("Qml\\QtQuickCompiler Files" FILES ${QATERIAL_CURRENT_QML_FILE})
-endforeach()
-
-
-add_library(${QATERIALHOTRELOAD_LIB}Ui STATIC ${QATERIALHOTRELOAD_QML_RES})
-add_library(Qaterial::HotReload::Ui ALIAS ${QATERIALHOTRELOAD_LIB}Ui)
-
-set_target_properties(${QATERIALHOTRELOAD_LIB}Ui PROPERTIES AUTORCC TRUE)
-
-target_link_libraries(${QATERIALHOTRELOAD_LIB}Ui PRIVATE
- Qt::Core
- Qt::Gui
- Qt::Svg
- Qt::Xml
- Qt::Qml
- Qt::Quick
- Qt::QuickControls2
-)
-
-if(QATERIALHOTRELOAD_FOLDER_PREFIX)
- set_target_properties(${QATERIALHOTRELOAD_LIB}Ui PROPERTIES FOLDER ${QATERIALHOTRELOAD_FOLDER_PREFIX})
-endif()
diff --git a/hot_reload/qml/Qaterial/HotReload/HotReload.qml b/hot_reload/qml/Qaterial/HotReload/HotReload.qml
deleted file mode 100644
index 29905def1a..0000000000
--- a/hot_reload/qml/Qaterial/HotReload/HotReload.qml
+++ /dev/null
@@ -1,815 +0,0 @@
-// Copyright Olivier Le Doeuff 2020 (C)
-
-import QtQml 2.15
-
-import QtQuick 2.15
-import QtQuick.Layouts 1.14
-import QtQuick.Controls 2.15
-
-import Qt.labs.settings 1.1 as QLab
-
-import Qaterial 1.0 as Qaterial
-import Qaterial.HotReload 1.0 as HR
-
-Qaterial.Page
-{
- id: root
-
- property string currentFolderPath
- property string currentFilePath
- property string currentFileUrl
- property string currentFileName: currentFilePath.substring(currentFilePath.lastIndexOf('/') + 1)
-
- property bool showFolderExplorer: true
-
- property
- var currentImportPath: []
-
- property string errorString
-
- property int theme: Qaterial.Style.theme
-
- signal newObjectLoaded()
-
- implicitWidth: 1280
- implicitHeight: 600
-
- function loadFileInLoader(source)
- {
- Qaterial.DialogManager.close()
- loader.create(source)
- }
-
- function reload()
- {
- root.loadFileInLoader(currentFileUrl)
- }
-
- function loadFile(path)
- {
- Qaterial.HotReload.unWatchFile(root.currentFilePath)
- currentFileUrl = `file:/${path}`
- currentFilePath = path
- Qaterial.HotReload.watchFile(root.currentFilePath)
-
- loadFileInLoader(root.currentFileUrl)
- }
-
- QLab.Settings
- {
- id: settings
-
- category: "General"
-
- property alias currentFolderPath: root.currentFolderPath
- property alias currentFilePath: root.currentFilePath
- property alias currentFileUrl: root.currentFileUrl
- property alias currentImportPath: root.currentImportPath
-
- property alias showFolderExplorer: root.showFolderExplorer
- property
- var folderSplitView
-
- property alias formatHorizontalAlignCenter: formatHorizontalAlignCenter.checked
- property alias formatVerticalAlignCenter: formatVerticalAlignCenter.checked
- property alias formatHorizontalAlignLeft: formatHorizontalAlignLeft.checked
- property alias formatHorizontalAlignRight: formatHorizontalAlignRight.checked
- property alias formatVerticalAlignBottom: formatVerticalAlignBottom.checked
- property alias formatVerticalAlignTop: formatVerticalAlignTop.checked
- property alias fullScreen: fullScreen.checked
-
- property alias theme: root.theme
- }
-
- Shortcut
- {
- sequence: "F5"
- onActivated: () => root.reload()
- }
-
- Shortcut
- {
- sequence: "Ctrl+O"
- onActivated: () => root.openFilePicker()
- }
-
- function openFilePicker()
- {
- Qaterial.DialogManager.showOpenFileDialog(
- {
- title: "Please choose a file",
- nameFilters: ["Qml Files (*.qml)"],
- onAccepted: function(path)
- {
- root.loadFile(path)
- }
- })
- }
-
- function openFolderPicker()
- {
- Qaterial.DialogManager.showFolderDialog(
- {
- title: "Please choose a folder",
- onAccepted: function(path)
- {
- root.currentFolderPath = path
- root.showFolderExplorer = true
- }
- })
- }
-
- Connections
- {
- target: Qaterial.HotReload
- function onWatchedFileChanged() { root.reload() }
- }
-
- header: Qaterial.ToolBar
- {
- implicitHeight: flow.implicitHeight
- Flow
- {
- id: flow
- width: parent.width - menuButton.implicitWidth
- Qaterial.SquareButton
- {
- ToolTip.visible: hovered || pressed
- ToolTip.text: "Open File to Hot Reload"
- icon.source: Qaterial.Icons.fileOutline
- useSecondaryColor: true
-
- onClicked: () => root.openFilePicker()
- }
-
- Qaterial.SquareButton
- {
- ToolTip.visible: hovered || pressed
- ToolTip.text: "Open Folder to Hot Reload"
- icon.source: Qaterial.Icons.folderOutline
- useSecondaryColor: true
-
- onClicked: () => root.openFolderPicker()
- }
-
- Qaterial.SquareButton
- {
- ToolTip.visible: hovered || pressed
- ToolTip.text: checked ? "Hide folder explorer" : "Show folder explorer"
- icon.source: Qaterial.Icons.pageLayoutSidebarLeft
- useSecondaryColor: true
-
- checked: root.showFolderExplorer
-
- onReleased: () => root.showFolderExplorer = checked
- }
-
- Qaterial.ToolSeparator {}
-
- Qaterial.SquareButton
- {
- ToolTip.visible: hovered || pressed
- ToolTip.text: "Reload (F5)"
- icon.source: Qaterial.Icons.sync
- useSecondaryColor: true
-
- onClicked: () => root.reload()
- }
-
- Qaterial.SquareButton
- {
- ToolTip.visible: hovered || pressed
- ToolTip.text: "Qml Import Path"
- icon.source: Qaterial.Icons.fileTree
- useSecondaryColor: true
-
- onClicked: function()
- {
- if(!_importPathMenu.visible)
- _importPathMenu.open()
- }
-
- ImportPathMenu
- {
- id: _importPathMenu
- y: parent.height
-
- model: Qaterial.HotReload.importPaths
-
- function setImportPathsAndReload(paths)
- {
- Qaterial.HotReload.importPaths = paths
- root.currentImportPath = paths
- root.reload()
- }
-
- onResetPathEntries: function()
- {
- Qaterial.HotReload.importPaths = undefined
- Qaterial.Logger.info(`Reset Path Entries to ${Qaterial.HotReload.importPaths}`)
- root.currentImportPath = Qaterial.HotReload.importPaths.toString()
- .split(',')
- root.reload()
- }
-
- onAddPathEntry: function(index)
- {
- Qaterial.DialogManager.showTextFieldDialog(
- {
- context: root,
- width: 800,
- title: "Enter Qml import path",
- textTitle: "Path",
- validator: null,
- inputMethodHints: Qt.ImhSensitiveData,
- standardButtons: Dialog.Ok | Dialog.Cancel,
- onAccepted: function(text, acceptable)
- {
- if(index <= -1)
- index = Qaterial.HotReload.importPaths.length
- Qaterial.Logger.info(`Append Path ${text} at ${index}`)
- let tempPaths = Qaterial.HotReload.importPaths.toString()
- .split(',')
- tempPaths.splice(index, 0, text)
- _importPathMenu.setImportPathsAndReload(tempPaths)
- },
- })
- }
-
- onEditPathEntry: function(index)
- {
- Qaterial.DialogManager.showTextFieldDialog(
- {
- context: root,
- width: 800,
- title: "Edit Qml import path",
- textTitle: "Path",
- text: Qaterial.HotReload.importPaths[index],
- validator: null,
- inputMethodHints: Qt.ImhSensitiveData,
- standardButtons: Dialog.Ok | Dialog.Cancel,
- onAccepted: function(text, acceptable)
- {
- Qaterial.Logger.info(`Edit Path ${index} to ${text}`)
- let tempPaths = Qaterial.HotReload.importPaths.toString()
- .split(',')
- tempPaths.splice(index, 1, text)
- _importPathMenu.setImportPathsAndReload(tempPaths)
- },
- })
- }
-
- onDeletePathEntry: function(index)
- {
- if(index >= 0 && index < Qaterial.HotReload.importPaths.length)
- {
- Qaterial.DialogManager.showDialog(
- {
- context: root,
- width: 500,
- title: "Warning",
- text: `Are you sure to delete "${Qaterial.HotReload.importPaths[index]}"`,
- iconSource: Qaterial.Icons.alertOutline,
- standardButtons: Dialog.Ok | Dialog.Cancel,
- onAccepted: function()
- {
- Qaterial.Logger.info(`Remove Path ${Qaterial.HotReload.importPaths[index]}`)
- let tempPaths = Qaterial.HotReload.importPaths.toString()
- .split(',')
- tempPaths.splice(index, 1)
- _importPathMenu.setImportPathsAndReload(tempPaths)
- }
- })
- }
- }
-
- onMovePathUp: function(index)
- {
- let tempPaths = Qaterial.HotReload.importPaths.toString()
- .split(',')
- tempPaths.splice(index, 0, tempPaths.splice(index - 1, 1)[0])
- _importPathMenu.setImportPathsAndReload(tempPaths)
- }
-
- onMovePathDown: function(index)
- {
- let tempPaths = Qaterial.HotReload.importPaths.toString()
- .split(',')
- tempPaths.splice(index, 0, tempPaths.splice(index + 1, 1)[0])
- _importPathMenu.setImportPathsAndReload(tempPaths)
- }
- }
- }
-
- Qaterial.ToolButton
- {
- id: formatHorizontalAlignCenter
-
- enabled: !fullScreen.checked && !formatHorizontalAlignLeft.checked && !formatHorizontalAlignRight.checked
- icon.source: Qaterial.Icons.formatHorizontalAlignCenter
-
- ToolTip.visible: hovered || pressed
- ToolTip.text: "Align Horizontal Center"
-
- onClicked: () => root.reload()
- }
-
- Qaterial.ToolButton
- {
- id: formatVerticalAlignCenter
-
- enabled: !fullScreen.checked && !formatVerticalAlignBottom.checked && !formatVerticalAlignTop.checked
- icon.source: Qaterial.Icons.formatVerticalAlignCenter
-
- ToolTip.visible: hovered || pressed
- ToolTip.text: "Align Vertical Center"
-
- onClicked: () => root.reload()
- }
-
- Qaterial.ToolSeparator {}
-
- Qaterial.ToolButton
- {
- id: formatHorizontalAlignLeft
-
- enabled: !fullScreen.checked && !formatHorizontalAlignCenter.checked
- icon.source: Qaterial.Icons.formatHorizontalAlignLeft
-
- ToolTip.visible: hovered || pressed
- ToolTip.text: "Align Left"
-
- onClicked: () => root.reload()
- }
-
- Qaterial.ToolButton
- {
- id: formatHorizontalAlignRight
-
- enabled: !fullScreen.checked && !formatHorizontalAlignCenter.checked
- icon.source: Qaterial.Icons.formatHorizontalAlignRight
-
- ToolTip.visible: hovered || pressed
- ToolTip.text: "Align Right"
-
- onClicked: () => root.reload()
- }
-
- Qaterial.ToolButton
- {
- id: formatVerticalAlignBottom
-
- enabled: !fullScreen.checked && !formatVerticalAlignCenter.checked
- icon.source: Qaterial.Icons.formatVerticalAlignBottom
-
- ToolTip.visible: hovered || pressed
- ToolTip.text: "Align Bottom"
-
- onClicked: () => root.reload()
- }
-
- Qaterial.ToolButton
- {
- id: formatVerticalAlignTop
-
- enabled: !fullScreen.checked && !formatVerticalAlignCenter.checked
- icon.source: Qaterial.Icons.formatVerticalAlignTop
-
- ToolTip.visible: hovered || pressed
- ToolTip.text: "Align Top"
-
- onClicked: () => root.reload()
- }
-
- Qaterial.ToolSeparator {}
-
- Qaterial.ToolButton
- {
- id: fullScreen
-
- enabled: !formatHorizontalAlignCenter.checked &&
- !formatVerticalAlignCenter.checked &&
- !formatHorizontalAlignLeft.checked &&
- !formatHorizontalAlignRight.checked &&
- !formatVerticalAlignBottom.checked &&
- !formatVerticalAlignTop.checked
- icon.source: checked ? Qaterial.Icons.fullscreen : Qaterial.Icons.fullscreenExit
-
- ToolTip.visible: hovered || pressed
- ToolTip.text: checked ? "Fullscreen" : "Fullscreen Exit"
-
- onClicked: () => root.reload()
- }
-
- Qaterial.ToolSeparator {}
-
- Qaterial.SquareButton
- {
- readonly property bool lightTheme: root.theme === Qaterial.Style.Theme.Light
- icon.source: lightTheme ? Qaterial.Icons.weatherSunny : Qaterial.Icons.moonWaningCrescent
- useSecondaryColor: true
- ToolTip.visible: hovered || pressed
- ToolTip.text: lightTheme ? "Theme Light" : "Theme Dark"
-
- onClicked: function()
- {
- theme = lightTheme ? Qaterial.Style.Theme.Dark : Qaterial.Style.Theme.Light
- Qaterial.Style.theme = theme
- }
- }
-
- Qaterial.ToolSeparator {}
-
- Qaterial.SquareButton
- {
- icon.source: Qaterial.Icons.formatLetterCase
-
- onClicked: function()
- {
- if(!_typoMenu.visible)
- _typoMenu.open()
- }
-
- TypoMenu
- {
- id: _typoMenu
- y: parent.height
- }
-
- ToolTip.visible: hovered || pressed
- ToolTip.text: "Typography"
- }
-
- Qaterial.SquareButton
- {
- contentItem: Item
- {
- Image
- {
- anchors.centerIn: parent
- source: HR.Images.materialIconsLight
- sourceSize.width: Qaterial.Style.toolButton.iconWidth
- sourceSize.height: Qaterial.Style.toolButton.iconWidth
- }
- }
-
- onClicked: function()
- {
- if(!_iconsMenu.visible)
- _iconsMenu.open()
- }
-
- IconsMenu
- {
- id: _iconsMenu
- y: parent.height
- }
-
- ToolTip.visible: hovered || pressed
- ToolTip.text: "Icons Explorer"
- }
-
- Qaterial.SquareButton
- {
- contentItem: Item
- {
- Image
- {
- anchors.centerIn: parent
- source: HR.Images.materialPalette
- }
- }
-
- onClicked: function()
- {
- if(!_paletteMenu.visible)
- _paletteMenu.open()
- }
-
- MaterialPaletteMenu
- {
- id: _paletteMenu
- y: parent.height
- }
-
- ToolTip.visible: hovered || pressed
- ToolTip.text: "Material Color Palette"
- }
-
- } // Flow
-
- Qaterial.AppBarButton
- {
- id: menuButton
- x: parent.width - width
- icon.source: Qaterial.Icons.dotsVertical
-
- onClicked: function()
- {
- if(!menu.visible)
- menu.open()
- }
-
- Qaterial.Menu
- {
- id: menu
- y: parent.height
-
- Qaterial.MenuItem
- {
- icon.source: Qaterial.Icons.earth
- text: "Qaterial Online"
- onClicked: () => Qt.openUrlExternally("https://olivierldff.github.io/QaterialOnline/")
- }
-
- Qaterial.MenuItem
- {
- icon.source: Qaterial.Icons.helpCircle
- text: "Documentation"
- onClicked: () => Qt.openUrlExternally("https://olivierldff.github.io/Qaterial/")
- }
-
- Qaterial.MenuItem
- {
- icon.source: Qaterial.Icons.github
- text: "Qaterial on Github"
- onClicked: () => Qt.openUrlExternally("https://github.com/OlivierLDff/Qaterial")
- }
- }
- }
- } // ToolBar
-
- SplitView
- {
- anchors.fill: parent
- orientation: Qt.Vertical
- SplitView.fillWidth: true
-
- SplitView
- {
- id: folderSplitView
- orientation: Qt.Horizontal
- SplitView.fillHeight: true
- SplitView.minimumHeight: 100
-
- Rectangle
- {
- visible: root.showFolderExplorer
- color: Qaterial.Style.theme === Qaterial.Style.Theme.Dark ? "#2A2C30" : "white"
- z: 10
-
- SplitView.preferredWidth: 200
- SplitView.minimumWidth: 0
-
- Qaterial.FolderTreeView
- {
- id: treeView
- anchors.fill: parent
-
- header: Qaterial.Label
- {
- text: treeView.model.fileName
- textType: Qaterial.Style.TextType.Button
- padding: 8
- elide: Text.ElideRight
- width: treeView.width
- }
-
- ScrollIndicator.vertical: Qaterial.ScrollIndicator {}
-
- property QtObject selectedElement
-
- nameFilters: ["*.qml"]
- path: `file:${root.currentFolderPath}`
-
- itemDelegate: Qaterial.FolderTreeViewItem
- {
- id: control
- highlighted: model && model.filePath === root.currentFilePath
- onAccepted: function(path)
- {
- function urlToLocalFile(url)
- {
- let path = url.toString()
- const isWindows = Qt.platform.os === "windows"
- path = isWindows ? path.replace(/^(file:\/{3})/, "") : path.replace(/^(file:\/{2})/, "")
- return decodeURIComponent(path)
- }
- root.loadFile(urlToLocalFile(path))
- }
- }
- } // TreeView
- } // Pane
-
- Item
- {
- id: loader
- width: parent.width
- property
- var loadedObject: null
- property url createUrl
-
- function create(url)
- {
- createUrl = url
- Qaterial.DialogManager.openBusyIndicator({ text: `Loading ${root.currentFileName}` })
- createLaterTimer.start()
- }
-
- Timer
- {
- id: createLaterTimer
- interval: 230
- onTriggered: () => loader.createLater(loader.createUrl)
- }
-
- function assignAnchors()
- {
- if(loadedObject.anchors)
- {
- if(fullScreen.checked)
- loadedObject.anchors.fill = loader
- if(formatHorizontalAlignCenter.checked)
- loadedObject.anchors.horizontalCenter = loader.horizontalCenter
- if(formatVerticalAlignCenter.checked)
- loadedObject.anchors.verticalCenter = loader.verticalCenter
- if(formatHorizontalAlignLeft.checked)
- loadedObject.anchors.left = loader.left
- if(formatHorizontalAlignRight.checked)
- loadedObject.anchors.right = loader.right
- if(formatVerticalAlignBottom.checked)
- loadedObject.anchors.bottom = loader.bottom
- if(formatVerticalAlignTop.checked)
- loadedObject.anchors.top = loader.top
- }
- }
-
- function createLater(url)
- {
- Qaterial.Logger.info(`Load from ${url}`)
-
- // Destroy previous item
- if(loadedObject)
- {
- loadedObject.destroy()
- loadedObject = null
- }
-
- Qaterial.HotReload.clearCache()
- let component = Qt.createComponent(url)
-
- if(component.status === Component.Ready)
- {
- //loadedObject = component.createObject(loader)
-
- var incubator = component.incubateObject(loader, { visible: false });
- if(incubator.status != Component.Ready)
- {
- incubator.onStatusChanged = function(status)
- {
- if(status == Component.Ready)
- {
- loadedObject = incubator.object
- assignAnchors()
- loadedObject.visible = true
- Qaterial.DialogManager.close()
-
- root.newObjectLoaded()
- }
- }
- }
- else
- {
- loadedObject = incubator.object
- assignAnchors()
- loadedObject.visible = true
- Qaterial.DialogManager.close()
-
- root.newObjectLoaded()
- }
-
- root.errorString = ""
- }
- else
- {
- root.errorString = component.errorString()
- Qaterial.Logger.error(`Fail to load with error ${root.errorString}`)
- Qaterial.DialogManager.close()
- root.newObjectLoaded()
- }
- }
-
- Column
- {
- anchors.centerIn: parent
- spacing: 16
- visible: !root.currentFilePath
-
- Image
- {
- anchors.horizontalCenter: parent.horizontalCenter
- width: 128
- height: 128
- source: HR.Images.code
- }
-
- Qaterial.Label
- {
- anchors.horizontalCenter: parent.horizontalCenter
- text: "Please Pick a qml file or folder to get started"
- }
-
- Row
- {
- anchors.horizontalCenter: parent.horizontalCenter
-
- Qaterial.RaisedButton
- {
- text: "Open File"
- icon.source: Qaterial.Icons.fileOutline
-
- onClicked: () => root.openFilePicker()
- }
-
- Qaterial.OutlineButton
- {
- text: "Open Folder"
- icon.source: Qaterial.Icons.folderOutline
-
- onClicked: () => root.openFolderPicker()
- }
- }
- }
- }
- }
-
- StatusView
- {
- id: _statusView
- anchors.bottom: parent.bottom
- width: parent.width
- SplitView.minimumHeight: 40
-
- errorString: root.errorString
- file: root.currentFileName
-
- Connections
- {
- target: Qaterial.HotReload
- function onNewLog(msg)
- {
- const color = function()
- {
- if(msg.includes("debug"))
- return Qaterial.Style.blue
- if(msg.includes("info"))
- return Qaterial.Style.green
- if(msg.includes("warning"))
- return Qaterial.Style.orange
- if(msg.includes("error"))
- return Qaterial.Style.red
- return Qaterial.Style.primaryTextColor()
- }();
-
- _statusView.log(msg, color)
- }
- }
-
- function log(msg, color)
- {
- _statusView.append(`${msg} `)
- }
- } // StatusView
- } // SplitView
-
- Component.onCompleted: function()
- {
- Qaterial.Logger.info(`Load configuration from ${settings.fileName}`)
- folderSplitView.restoreState(settings.folderSplitView)
- Qaterial.Style.theme = root.theme
-
- if(Qaterial.HotReload.importPaths !== root.currentImportPath)
- {
- if(root.currentImportPath.length)
- {
- Qaterial.Logger.info(`Set qml import path to Qaterial.HotReload.importPaths`)
- Qaterial.HotReload.importPaths = root.currentImportPath
- }
- else
- {
- root.currentImportPath = Qaterial.HotReload.importPaths
- }
- }
-
- if(root.currentFileUrl)
- {
- loader.create(root.currentFileUrl)
- Qaterial.HotReload.watchFile(root.currentFilePath)
- }
- }
-
- Component.onDestruction: function()
- {
- settings.folderSplitView = folderSplitView.saveState()
- }
-} // ApplicationWindow
diff --git a/hot_reload/qml/Qaterial/HotReload/HotReloadWindow.qml b/hot_reload/qml/Qaterial/HotReload/HotReloadWindow.qml
deleted file mode 100644
index a68dda9771..0000000000
--- a/hot_reload/qml/Qaterial/HotReload/HotReloadWindow.qml
+++ /dev/null
@@ -1,31 +0,0 @@
-// Copyright Olivier Le Doeuff 2020 (C)
-
-import QtQuick 2.15
-import Qaterial 1.0 as Qaterial
-
-Qaterial.ApplicationWindow
-{
- id: window
-
- property alias currentFilePath: hr.currentFilePath
-
- signal newObjectLoaded()
-
- title: `Qaterial Hot Reload - ${currentFilePath}`
-
- width: 1280
- height: 600
-
- minimumWidth: 200
- minimumHeight: 200
-
- HotReload
- {
- id: hr
- anchors.fill: parent
-
- onNewObjectLoaded: window.newObjectLoaded()
- }
-
- Qaterial.WindowLayoutSave { name: "Reloader" }
-}
diff --git a/hot_reload/qml/Qaterial/HotReload/IconsMenu.qml b/hot_reload/qml/Qaterial/HotReload/IconsMenu.qml
deleted file mode 100644
index e6bf82b91b..0000000000
--- a/hot_reload/qml/Qaterial/HotReload/IconsMenu.qml
+++ /dev/null
@@ -1,117 +0,0 @@
-import QtQuick 2.15
-import QtQuick.Controls 2.15
-import Qt.labs.folderlistmodel 2.15
-import Qaterial 1.0 as Qaterial
-
-Qaterial.Menu
-{
- id: root
-
- implicitWidth: 320
-
- Qaterial.TextField
- {
- id: textField
- anchors.horizontalCenter: parent.horizontalCenter
- title: titleUp ? "Search" : "Search ..."
- leadingIconSource: Qaterial.Icons.magnify
- leadingIconInline: true
- focus: true
-
- onTextEdited: () => delaySearch.start()
- } // TextField
-
- GridView
- {
- id: grid
- clip: true
-
- width: parent.width
- height: 200
-
- cellWidth: 50
- cellHeight: 50
-
- ScrollBar.vertical: Qaterial.ScrollBar { x: 32;policy: ScrollBar.AlwaysOn }
-
- Timer
- {
- id: delaySearch
- interval: 100
- onTriggered: function()
- {
- const words = textField.text.split(' ')
- let filter1 = ''
- let filter2 = '*'
- let filter3 = ''
- words.forEach(
- function(word)
- {
- const lowerCaseWord = word.toLowerCase()
- filter1 += `${lowerCaseWord}*`
- filter2 += `${lowerCaseWord}*`
- filter3 += `*${lowerCaseWord}`
- })
- //console.log(`filter: ${filter}`)
- folderModel.nameFilters = [`${filter1}.svg`, `${filter2}.svg`, `${filter3}.svg`]
- }
- } // Timer
-
- model: FolderListModel
- {
- id: folderModel
- folder: 'qrc:/Qaterial/Icons/'
- nameFilters: ['*.svg']
-
- //property string iconSearch
- } // FolderListModel
-
- delegate: Qaterial.AppBarButton
- {
- id: icon
-
- readonly property
- var forbiddenKeywords: ['id', 'index', 'model', 'modelData', 'console', 'do', 'if', 'in', 'for', 'let', 'new',
- 'try', 'var', 'case', 'else', 'enum', 'eval', 'null', 'this', 'true', 'void', 'with', 'await', 'break',
- 'catch', 'class', 'const', 'false', 'super', 'throw', 'while', 'yield', 'delete', 'export', 'import',
- 'public', 'return', 'static', 'switch', 'typeof', 'default', 'extends', 'finally', 'package', 'private',
- 'continue', 'debugger', 'function', 'arguments', 'interface', 'protected', 'implements', 'instanceof'
- ]
-
- function fileNameToProperty(str)
- {
- // snake to camel
- str = str.replace(/([-_][a-z0-9])/g,
- (group) => group.toUpperCase()
- .replace('-', '')
- .replace('_', '')
- );
-
- // remove extension
- str = str.replace(/\.[^/.]+$/, "")
-
- // append _ to forbidden keywords
- if(forbiddenKeywords.includes(str))
- return `${str}_`
- return str
- }
-
- icon.source: `qrc:/Qaterial/Icons/${fileName}`
-
- onClicked: function()
- {
- const textToCopy = `Qaterial.Icons.${fileNameToProperty(fileName)}`
- Qaterial.Clipboard.text = textToCopy
- Qaterial.SnackbarManager.show(`Icon Name Copied! \n"${textToCopy}"`)
- }
-
- Qaterial.ToolTip
- {
-
- text: `${fileNameToProperty(fileName)}`
- delay: 50
- visible: icon.hovered
- } // ToolTip
- } // AppBarButton
- } // GridView
-}
diff --git a/hot_reload/qml/Qaterial/HotReload/Images.qml b/hot_reload/qml/Qaterial/HotReload/Images.qml
deleted file mode 100644
index 1a6abae29b..0000000000
--- a/hot_reload/qml/Qaterial/HotReload/Images.qml
+++ /dev/null
@@ -1,16 +0,0 @@
-// File auto generated with CMake qt_generate_qrc_alias_singleton.
-// Everything written here will be lost.
-
-pragma Singleton
-
-import QtQml 2.0
-
-QtObject
-{
- readonly property string code: 'qrc:/Qaterial/HotReload/Images/code.svg'
- readonly property string icon: 'qrc:/Qaterial/HotReload/Images/icon.svg'
- readonly property string materialIconsLight: 'qrc:/Qaterial/HotReload/Images/material-icons-light.svg'
- readonly property string materialPalette: 'qrc:/Qaterial/HotReload/Images/material-palette.png'
- readonly property string qaterialHotreloadBlack: 'qrc:/Qaterial/HotReload/Images/qaterial-hotreload-black.png'
- readonly property string qaterialHotreloadWhite: 'qrc:/Qaterial/HotReload/Images/qaterial-hotreload-white.png'
-}
diff --git a/hot_reload/qml/Qaterial/HotReload/Images/code.svg b/hot_reload/qml/Qaterial/HotReload/Images/code.svg
deleted file mode 100644
index 0b5bd63bde..0000000000
--- a/hot_reload/qml/Qaterial/HotReload/Images/code.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/hot_reload/qml/Qaterial/HotReload/Images/icon.svg b/hot_reload/qml/Qaterial/HotReload/Images/icon.svg
deleted file mode 100644
index f00220e9a5..0000000000
--- a/hot_reload/qml/Qaterial/HotReload/Images/icon.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/hot_reload/qml/Qaterial/HotReload/Images/material-icons-light.svg b/hot_reload/qml/Qaterial/HotReload/Images/material-icons-light.svg
deleted file mode 100644
index d7506303bd..0000000000
--- a/hot_reload/qml/Qaterial/HotReload/Images/material-icons-light.svg
+++ /dev/null
@@ -1 +0,0 @@
-ic_icons_192px_light
\ No newline at end of file
diff --git a/hot_reload/qml/Qaterial/HotReload/Images/material-palette.png b/hot_reload/qml/Qaterial/HotReload/Images/material-palette.png
deleted file mode 100644
index 789d516a7a..0000000000
Binary files a/hot_reload/qml/Qaterial/HotReload/Images/material-palette.png and /dev/null differ
diff --git a/hot_reload/qml/Qaterial/HotReload/Images/qaterial-hotreload-black.png b/hot_reload/qml/Qaterial/HotReload/Images/qaterial-hotreload-black.png
deleted file mode 100644
index 215ccd8fc8..0000000000
Binary files a/hot_reload/qml/Qaterial/HotReload/Images/qaterial-hotreload-black.png and /dev/null differ
diff --git a/hot_reload/qml/Qaterial/HotReload/Images/qaterial-hotreload-white.png b/hot_reload/qml/Qaterial/HotReload/Images/qaterial-hotreload-white.png
deleted file mode 100644
index 1ea5aa3bce..0000000000
Binary files a/hot_reload/qml/Qaterial/HotReload/Images/qaterial-hotreload-white.png and /dev/null differ
diff --git a/hot_reload/qml/Qaterial/HotReload/ImportPathMenu.qml b/hot_reload/qml/Qaterial/HotReload/ImportPathMenu.qml
deleted file mode 100644
index c30f1e2b53..0000000000
--- a/hot_reload/qml/Qaterial/HotReload/ImportPathMenu.qml
+++ /dev/null
@@ -1,262 +0,0 @@
-import QtQml 2.15
-import QtQuick 2.15
-import QtQuick.Controls 2.15
-
-import Qaterial 1.0 as Qaterial
-
-Qaterial.Menu
-{
- id: control
-
- signal resetPathEntries()
- signal addPathEntry(int index)
- signal editPathEntry(int index)
- signal deletePathEntry(int index)
- signal movePathUp(int index)
- signal movePathDown(int index)
-
- property
- var model: []
-
- implicitWidth: 600
- bottomPadding: 0
-
- contentItem: Column
- {
- width: root.width
-
- Rectangle
- {
- color: Qaterial.Style.dialogColor
- width: control.width
- implicitHeight: title.implicitHeight
- z: 1
-
- Qaterial.Label
- {
- id: title
- text: "Qml Import Paths"
- width: parent.width
- textType: Qaterial.Style.TextType.Title
- elide: Text.ElideRight
- leftPadding: 16
- bottomPadding: 8
- }
-
- Qaterial.HorizontalLineSeparator
- {
- anchors.horizontalCenter: parent.horizontalCenter
- implicitWidth: control.width
- y: parent.height - 1
- } // HorizontalLineSeparator
- } // Header
-
- Item
- {
- width: control.width
- implicitHeight: Math.max(listView.implicitHeight, modifierColumn.implicitHeight)
-
- ListView
- {
- id: listView
- currentIndex: -1
- implicitHeight: Math.min(300, contentHeight)
- width: parent.width - modifierColumn.width
- interactive: height < contentHeight
-
- ScrollBar.vertical: Qaterial.ScrollBar { policy: ScrollBar.AsNeeded;width: 12;active: true }
-
- model: control.model
-
- delegate: Qaterial.ItemDelegate
- {
- id: pathDelegate
- width: listView.width
-
- topPadding: 4
- bottomPadding: 4
- rightPadding: 20
-
- highlighted: listView.currentIndex === index
-
- onDoubleClicked: () => control.editPathEntry(index)
-
- onClicked: function()
- {
- listView.currentIndex = listView.currentIndex === index ? -1 : index
- }
-
- contentItem: Qaterial.Label
- {
- id: pathLabel
- text: modelData
- elide: Text.ElideRight
- Binding on color
- {
- when: pathDelegate.highlighted
- value: Qaterial.Style.accentColor
- }
- }
-
- Qaterial.ToolTip
- {
- text: modelData
- visible: pathLabel.truncated && (pathDelegate.hovered || pathDelegate.pressed)
- position: Qaterial.Style.Position.Right
- }
-
- background: Rectangle
- {
- color: Qt.darker(Qaterial.Style.dialogColor, (index % 2 === 0) ? 1 : 1.2)
- Qaterial.Ripple
- {
- id: _ripple
- width: parent.width
- height: parent.height
-
- pressed: pathDelegate.pressed
- active: pathDelegate.down || pathDelegate.visualFocus || pathDelegate.hovered
- anchor: pathDelegate
-
- clip: visible
- color: Qaterial.Style.rippleColor(Qaterial.Style.RippleBackground.Background)
- } // Ripple
- }
- }
- } // ListView
-
- Qaterial.VerticalLineSeparator
- {
- x: modifierColumn.x
- height: parent.height
- }
-
- Column
- {
- id: modifierColumn
- anchors.right: parent.right
- spacing: 0
-
- Qaterial.SquareButton
- {
- icon.source: Qaterial.Icons.plus
- topInset: 1
- bottomInset: 1
-
- onClicked: function()
- {
- const index = listView.currentIndex
- control.addPathEntry(index)
- listView.currentIndex = -1
- }
-
- Qaterial.ToolTip
- {
- text: `Add Path Entry`
- visible: parent.hovered || parent.pressed
- position: Qaterial.Style.Position.BottomStart
- }
- } // SquareButton
-
- Qaterial.SquareButton
- {
- icon.source: Qaterial.Icons.minus
- topInset: 1
- bottomInset: 1
- enabled: listView.currentIndex !== -1
-
- onClicked: function()
- {
- const index = listView.currentIndex
- control.deletePathEntry(index)
- listView.currentIndex = -1
- }
-
- Qaterial.ToolTip
- {
- text: `Delete ${listView.model[listView.currentIndex]}`
- visible: parent.hovered || parent.pressed
- position: Qaterial.Style.Position.BottomStart
- }
- } // SquareButton
-
- Qaterial.SquareButton
- {
- icon.source: Qaterial.Icons.pencil
- topInset: 1
- bottomInset: 1
- enabled: listView.currentIndex !== -1
-
- onClicked: () => control.editPathEntry(listView.currentIndex)
-
- Qaterial.ToolTip
- {
- text: `Edit ${listView.model[listView.currentIndex]}`
- visible: parent.hovered || parent.pressed
- position: Qaterial.Style.Position.BottomStart
- }
- } // SquareButton
-
- Qaterial.SquareButton
- {
- icon.source: Qaterial.Icons.chevronUp
- topInset: 1
- bottomInset: 1
- enabled: (listView.currentIndex !== -1) && (listView.currentIndex > 0)
-
- onClicked: function()
- {
- const tempCurrentIndex = listView.currentIndex
- control.movePathUp(listView.currentIndex)
- listView.currentIndex = tempCurrentIndex - 1
- }
-
- Qaterial.ToolTip
- {
- text: `Move ${listView.model[listView.currentIndex]} Up`
- visible: parent.hovered || parent.pressed
- position: Qaterial.Style.Position.BottomStart
- }
- } // SquareButton
-
- Qaterial.SquareButton
- {
- icon.source: Qaterial.Icons.chevronDown
- topInset: 1
- bottomInset: 1
- enabled: (listView.currentIndex !== -1) && ((listView.model.length - 1) > listView.currentIndex)
-
- onClicked: function()
- {
- const tempCurrentIndex = listView.currentIndex
- control.movePathDown(listView.currentIndex)
- listView.currentIndex = tempCurrentIndex + 1
- }
-
- Qaterial.ToolTip
- {
- text: `Move ${listView.model[listView.currentIndex]} Down`
- visible: parent.hovered || parent.pressed
- position: Qaterial.Style.Position.BottomStart
- }
- } // SquareButton
-
- Qaterial.SquareButton
- {
- icon.source: Qaterial.Icons.restore
- topInset: 1
- bottomInset: 1
-
- onClicked: () => control.resetPathEntries()
-
- Qaterial.ToolTip
- {
- text: `Reset import path`
- visible: parent.hovered || parent.pressed
- position: Qaterial.Style.Position.BottomStart
- }
- } // SquareButton
- } // ButtonColumn
- } // Content
- }
-}
diff --git a/hot_reload/qml/Qaterial/HotReload/Imports.qml b/hot_reload/qml/Qaterial/HotReload/Imports.qml
deleted file mode 100644
index cf496194ca..0000000000
--- a/hot_reload/qml/Qaterial/HotReload/Imports.qml
+++ /dev/null
@@ -1,51 +0,0 @@
-import QtQml 2.15
-import QtQml.Models 2.15
-import QtQml.StateMachine 1.14
-
-import QtQuick 2.15
-import QtQuick.Controls 2.15
-import QtQuick.Window 2.15
-import QtQuick.Layouts 1.14
-import QtQuick.Extras 1.2
-import QtQuick.Shapes 1.14
-
-import QtQuick.Dialogs 1.3 as QQ1D
-
-import QtGraphicalEffects 1.14
-
-import Qt.labs.animation 1.0
-import Qt.labs.calendar 1.0
-import Qt.labs.settings 1.0 as QLab
-import Qt.labs.platform 1.0
-import Qt.labs.qmlmodels 1.0
-import Qt.labs.folderlistmodel 1.0
-import Qt.labs.location 1.0
-import Qt.labs.sharedimage 1.0
-import Qt.labs.wavefrontmesh 1.0
-
-import Qt3D.Core 2.15
-import Qt3D.Render 2.15
-import Qt3D.Input 2.15
-import Qt3D.Logic 2.15
-import Qt3D.Extras 2.15
-import Qt3D.Animation 2.15
-import QtQuick.Scene2D 2.15
-import QtQuick.Scene3D 2.15
-
-import QtQuick3D 1.15
-import QtQuick3D.Materials 1.15
-import QtQuick3D.Effects 1.15
-import QtQuick3D.Helpers 1.15
-
-import QtCharts 2.15
-import QtDataVisualization 1.15
-
-import QtQuick.VirtualKeyboard 2.15
-import QtQuick.VirtualKeyboard.Styles 2.15
-import QtQuick.VirtualKeyboard.Settings 2.15
-
-import QtWebChannel 1.15
-import QtWebSockets 1.15
-//import QtWebEngine 1.10
-
-Item {}
diff --git a/hot_reload/qml/Qaterial/HotReload/Main.qml b/hot_reload/qml/Qaterial/HotReload/Main.qml
deleted file mode 100644
index b76ec265e1..0000000000
--- a/hot_reload/qml/Qaterial/HotReload/Main.qml
+++ /dev/null
@@ -1,5 +0,0 @@
-// Copyright Olivier Le Doeuff 2020 (C)
-
-import Qaterial.HotReload 1.0 as HR
-
-HR.SplashScreenApplication { }
diff --git a/hot_reload/qml/Qaterial/HotReload/MaterialPaletteMenu.qml b/hot_reload/qml/Qaterial/HotReload/MaterialPaletteMenu.qml
deleted file mode 100644
index 19850d7759..0000000000
--- a/hot_reload/qml/Qaterial/HotReload/MaterialPaletteMenu.qml
+++ /dev/null
@@ -1,42 +0,0 @@
-import QtQuick 2.15
-import QtQuick.Controls 2.15
-import Qaterial 1.0 as Qaterial
-
-Qaterial.Menu
-{
- id: root
-
- implicitWidth: palette.implicitWidth + leftPadding + rightPadding
- implicitHeight: palette.implicitHeight + topPadding + bottomPadding
-
- leftPadding: 8
- rightPadding: 8
-
- Qaterial.MaterialColorPalette
- {
- id: palette
-
- cellWidth: 24
- cellHeight: 24
-
- showName: false
- showShade: false
-
- function camelize(str)
- {
- return str.replace(/(?:^\w|[A-Z]|\b\w)/g, function(word, index)
- {
- return index === 0 ? word.toLowerCase() : word.toUpperCase();
- })
- .replace(/\s+/g, '');
- }
-
- onAccepted: function(color, name, shade)
- {
- const colorProperty = `Qaterial.Colors.${camelize(name)}${shade}`
- Qaterial.Clipboard.text = colorProperty
- Qaterial.SnackbarManager.show(`Color copied! \n"${colorProperty}"`)
- }
- }
-
-}
diff --git a/hot_reload/qml/Qaterial/HotReload/SplashScreenApplication.qml b/hot_reload/qml/Qaterial/HotReload/SplashScreenApplication.qml
deleted file mode 100644
index e095df2e02..0000000000
--- a/hot_reload/qml/Qaterial/HotReload/SplashScreenApplication.qml
+++ /dev/null
@@ -1,24 +0,0 @@
-// Copyright Olivier Le Doeuff 2020 (C)
-
-import QtQuick 2.15
-import Qt.labs.settings 1.0 as QLab
-
-import Qaterial 1.0 as Qaterial
-import Qaterial.HotReload 1.0 as HR
-
-Qaterial.SplashScreenApplication
-{
- id: root
-
- property int appTheme: Qaterial.Style.theme
-
- splashScreen: HR.SplashScreenWindow {}
- window: HR.HotReloadWindow {}
-
- QLab.Settings { property alias appTheme: root.appTheme }
-
- Component.onCompleted: function()
- {
- Qaterial.Style.theme = root.appTheme
- }
-}
diff --git a/hot_reload/qml/Qaterial/HotReload/SplashScreenWindow.qml b/hot_reload/qml/Qaterial/HotReload/SplashScreenWindow.qml
deleted file mode 100644
index f2d4136e0c..0000000000
--- a/hot_reload/qml/Qaterial/HotReload/SplashScreenWindow.qml
+++ /dev/null
@@ -1,34 +0,0 @@
-// Copyright Olivier Le Doeuff 2020 (C)
-
-import QtQuick 2.15
-import Qaterial 1.0 as Qaterial
-import Qaterial.HotReload 1.0 as HR
-
-Qaterial.SplashScreenWindow
-{
- id: splash
-
- image: Qaterial.Style.theme === Qaterial.Style.Theme.Dark ? HR.Images.qaterialHotreloadWhite : HR.Images.qaterialHotreloadBlack
- padding: Qaterial.Style.card.horizontalPadding
-
- text: "Loading ..."
- version: Qaterial.Version.readable
-
- property int dots: 1
-
- Timer
- {
- interval: 1000;running: true;repeat: true
- onTriggered: function()
- {
- ++splash.dots
- let text = "Loading "
- for(let i = 0; i < splash.dots; ++i)
- text += '.'
-
- splash.text = text
- if(splash.dots == 3)
- splash.dots = 0
- }
- }
-}
diff --git a/hot_reload/qml/Qaterial/HotReload/StatusView.qml b/hot_reload/qml/Qaterial/HotReload/StatusView.qml
deleted file mode 100644
index 29b151c1d4..0000000000
--- a/hot_reload/qml/Qaterial/HotReload/StatusView.qml
+++ /dev/null
@@ -1,103 +0,0 @@
-import QtQuick 2.15
-import QtQuick.Controls 2.15
-import Qaterial 1.0 as Qaterial
-
-Rectangle
-{
- id: root
-
- property string logString
- property string errorString
- property string file
- property bool error: errorString
-
- implicitWidth: 500
- implicitHeight: 100
-
- color: Qaterial.Style.theme === Qaterial.Style.Theme.Dark ? "#24262A" : "white"
-
- function append(text)
- {
- _errorTextArea.append(text)
- }
-
- Flickable
- {
- id: _flick
- width: parent.width
- height: root.height - _errorRect.height
-
- contentWidth: width
- contentHeight: _errorTextArea.height
-
- clip: true
-
- ScrollBar.vertical: Qaterial.ScrollBar {}
- ScrollBar.horizontal: Qaterial.ScrollBar {}
-
- TextEdit
- {
- id: _errorTextArea
- width: parent.width
- text: root.logString
- textFormat: TextEdit.RichText
- readOnly: true
- wrapMode: Text.WordWrap
- selectByMouse: true
- padding: Qaterial.Style.card.horizontalPadding
- selectionColor: Qaterial.Style.accentColor
-
- color: Qaterial.Style.textTypeToColor(Qaterial.Style.TextType.Body1)
- font.family: Qaterial.Style.textTypeToFontFamily(Qaterial.Style.TextType.Body1)
- font.styleName: Qaterial.Style.textTypeToStyleName(Qaterial.Style.TextType.Body1)
- font.capitalization: Qaterial.Style.fontCapitalization(Qaterial.Style.TextType.Body1)
- font.letterSpacing: Qaterial.Style.textTypeToLetterSpacing(Qaterial.Style.TextType.Body1)
- font.pixelSize: Qaterial.Style.textTypeToPixelSize(Qaterial.Style.TextType.Body1)
-
- onTextChanged: function()
- {
- cursorPosition = text.length - 1
- if(height > _flick.height)
- _flick.contentY = height - _flick.height
- }
- }
- }
-
- Rectangle
- {
- id: _errorRect
-
- y: root.height - height
- width: parent.width
- height: 32
-
- color: root.error ? "#f44336" : "#4CAF50"
-
- Qaterial.Label
- {
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: parent.left
- anchors.leftMargin: Qaterial.Style.card.horizontalPadding
- anchors.right: _version.left
- anchors.rightMargin: Qaterial.Style.card.horizontalPadding
-
- width: 200
-
- text: root.error ? `Fail to load ${root.file}` : `File ${root.file} Loaded`
- elide: Text.ElideRight
-
- horizontalAlignment: Text.AlignLeft
- verticalAlignment: Text.AlignVCenter
- } // Qaterial.Label
-
- Qaterial.Label
- {
- id: _version
- anchors.verticalCenter: parent.verticalCenter
- anchors.right: parent.right
- anchors.rightMargin: Qaterial.Style.card.horizontalPadding
- text: Qaterial.Version.readable
- textType: Qaterial.Style.TextType.Caption
- }
- }
-}
diff --git a/hot_reload/qml/Qaterial/HotReload/TypoMenu.qml b/hot_reload/qml/Qaterial/HotReload/TypoMenu.qml
deleted file mode 100644
index f8da9e00a2..0000000000
--- a/hot_reload/qml/Qaterial/HotReload/TypoMenu.qml
+++ /dev/null
@@ -1,64 +0,0 @@
-import QtQuick 2.15
-import QtQuick.Controls 2.15
-import Qt.labs.folderlistmodel 2.15
-import Qaterial 1.0 as Qaterial
-
-Qaterial.Menu
-{
- id: root
-
- width: 250
-
- Repeater
- {
- model: ListModel {}
-
- delegate: Qaterial.ItemDelegate
- {
- height: Qaterial.Style.textTypeToPixelSize(model.textType) + 8
- contentItem: Qaterial.Label
- {
- text: model.text
- textType: model.textType
- verticalAlignment: Text.AlignVCenter
-
- }
-
- Qaterial.ToolTip
- {
- visible: parent.hovered
- text: `TextType.${model.text}`
- delay: 300
- }
-
- onClicked: function()
- {
- const textToCopy = `Qaterial.Style.TextType.${model.text}`
- Qaterial.Clipboard.text = textToCopy
- Qaterial.SnackbarManager.show(`Text Type Copied! \n'${textToCopy}'`)
- root.close()
- }
- }
-
- Component.onCompleted: function()
- {
-
- model.append({ textType: Qaterial.Style.TextType.Display3, text: "Display3" })
- model.append({ textType: Qaterial.Style.TextType.Display2, text: "Display2" })
- model.append({ textType: Qaterial.Style.TextType.Display1, text: "Display1" })
- model.append({ textType: Qaterial.Style.TextType.Heading, text: "Heading" })
- model.append({ textType: Qaterial.Style.TextType.Title, text: "Title" })
- model.append({ textType: Qaterial.Style.TextType.Subheading, text: "Subheading" })
- model.append({ textType: Qaterial.Style.TextType.ListText, text: "ListText" })
- model.append({ textType: Qaterial.Style.TextType.ListSecText, text: "ListSecText" })
- model.append({ textType: Qaterial.Style.TextType.Overline, text: "Overline" })
- model.append({ textType: Qaterial.Style.TextType.Body2, text: "Body2" })
- model.append({ textType: Qaterial.Style.TextType.Body1, text: "Body1" })
- model.append({ textType: Qaterial.Style.TextType.Caption, text: "Caption" })
- model.append({ textType: Qaterial.Style.TextType.Hint, text: "Hint" })
- model.append({ textType: Qaterial.Style.TextType.Button, text: "Button" })
- model.append({ textType: Qaterial.Style.TextType.Menu, text: "Menu" })
- model.append({ textType: Qaterial.Style.TextType.MenuHint, text: "MenuHint" })
- }
- }
-}
diff --git a/hot_reload/qml/Qaterial/HotReload/qmldir b/hot_reload/qml/Qaterial/HotReload/qmldir
deleted file mode 100644
index 3cf250fd38..0000000000
--- a/hot_reload/qml/Qaterial/HotReload/qmldir
+++ /dev/null
@@ -1,16 +0,0 @@
-# File auto generated with CMake qt_generate_qmldir. Run CMake to regenerate if files changed.
-
-module Qaterial.HotReload
-
-HotReload 1.0 HotReload.qml
-HotReloadWindow 1.0 HotReloadWindow.qml
-IconsMenu 1.0 IconsMenu.qml
-singleton Images 1.0 Images.qml
-ImportPathMenu 1.0 ImportPathMenu.qml
-Imports 1.0 Imports.qml
-Main 1.0 Main.qml
-MaterialPaletteMenu 1.0 MaterialPaletteMenu.qml
-SplashScreenApplication 1.0 SplashScreenApplication.qml
-SplashScreenWindow 1.0 SplashScreenWindow.qml
-StatusView 1.0 StatusView.qml
-TypoMenu 1.0 TypoMenu.qml
diff --git a/hot_reload/src/Qaterial/HotReload/HotReload.cpp b/hot_reload/src/Qaterial/HotReload/HotReload.cpp
deleted file mode 100644
index 3366d5c757..0000000000
--- a/hot_reload/src/Qaterial/HotReload/HotReload.cpp
+++ /dev/null
@@ -1,86 +0,0 @@
-// MIT License
-//
-// Copyright (c) 2020 Olivier Le Doeuff
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in all
-// copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-// SOFTWARE.
-
-// ──── INCLUDE ────
-
-// Qaterial
-#include
-#include
-
-// ──── DECLARATION ────
-
-static void HotReload_loadResources() { Q_INIT_RESOURCE(QaterialHotReload); }
-
-namespace qaterial {
-
-const std::shared_ptr HotReload::_sink = std::make_shared();
-
-void HotReloadSink::sink_it_(const spdlog::details::log_msg& msg)
-{
- if(!_hotReload)
- return;
-
- // log_msg is a struct containing the log entry info like level, timestamp, thread id etc.
- // msg.raw contains pre formatted log
-
- // If needed (very likely but not mandatory), the sink formats the message before sending it to its final destination:
- spdlog::memory_buf_t formatted;
- base_sink::formatter_->format(msg, formatted);
- const auto string = fmt::to_string(formatted);
- Q_EMIT _hotReload->newLog(QString::fromStdString(string));
-}
-
-HotReload::HotReload(QQmlEngine* engine, QObject* parent) : QObject(parent), _engine(engine)
-{
- connect(&_watcher, &QFileSystemWatcher::fileChanged, this, &HotReload::watchedFileChanged);
- HotReload_loadResources();
-}
-
-void HotReload::clearCache() const { _engine->clearComponentCache(); }
-
-std::shared_ptr HotReload::sink() { return _sink; }
-
-void HotReload::registerSingleton()
-{
- qmlRegisterSingletonType("Qaterial",
- 1,
- 0,
- "HotReload",
- [](QQmlEngine* engine, QJSEngine* scriptEngine) -> QObject*
- {
- Q_UNUSED(scriptEngine);
- const auto hotReload = new qaterial::HotReload(engine, engine);
- _sink->_hotReload = hotReload;
- hotReload->_defaultImportPaths = engine->importPathList();
- return hotReload;
- });
-}
-
-void HotReload::watchFile(const QString& path) { _watcher.addPath(path); }
-
-void HotReload::unWatchFile(const QString& path)
-{
- if(!path.isEmpty())
- _watcher.removePath(path);
-}
-
-}
diff --git a/hot_reload/src/Qaterial/HotReload/HotReload.hpp b/hot_reload/src/Qaterial/HotReload/HotReload.hpp
deleted file mode 100644
index 63714afbbb..0000000000
--- a/hot_reload/src/Qaterial/HotReload/HotReload.hpp
+++ /dev/null
@@ -1,92 +0,0 @@
-// MIT License
-//
-// Copyright (c) 2020 Olivier Le Doeuff
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in all
-// copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-// SOFTWARE.
-
-#ifndef __QATERIAL_HOT_RELOAD_HPP__
-#define __QATERIAL_HOT_RELOAD_HPP__
-
-// ──── INCLUDE ────
-
-#include
-
-#include
-#include
-#include
-
-// ──── DECLARATION ────
-
-namespace qaterial {
-
-class HotReloadSink : public spdlog::sinks::base_sink
-{
-public:
- class HotReload* _hotReload = nullptr;
-
- void sink_it_(const spdlog::details::log_msg& msg) override;
- void flush_() override {}
-};
-
-class HotReload : public QObject
-{
- Q_OBJECT
-
-public:
- HotReload(QQmlEngine* engine, QObject* parent);
-
-private:
- QQmlEngine* _engine;
- QFileSystemWatcher _watcher;
- static const std::shared_ptr _sink;
- QStringList _defaultImportPaths;
-
- Q_PROPERTY(QStringList importPaths READ importPaths WRITE setImportPaths RESET resetImportPaths NOTIFY importPathsChanged)
-
-public:
- QStringList importPaths() const { return _engine->importPathList(); }
- void setImportPaths(const QStringList& paths)
- {
- _engine->setImportPathList(paths);
- Q_EMIT importPathsChanged();
- }
- void resetImportPaths() { setImportPaths(_defaultImportPaths); }
-
-Q_SIGNALS:
- void importPathsChanged();
-
-public Q_SLOTS:
- void clearCache() const;
-
- void watchFile(const QString& path);
- void unWatchFile(const QString& path);
-Q_SIGNALS:
- void watchedFileChanged();
- void newLog(QString s);
-
-public:
- static std::shared_ptr sink();
-
-public:
- static void registerSingleton();
-};
-
-}
-
-#endif
diff --git a/hot_reload/src/Qaterial/HotReload/Pch/Pch.hpp b/hot_reload/src/Qaterial/HotReload/Pch/Pch.hpp
deleted file mode 100644
index 732bf48823..0000000000
--- a/hot_reload/src/Qaterial/HotReload/Pch/Pch.hpp
+++ /dev/null
@@ -1,58 +0,0 @@
-// MIT License
-//
-// Copyright (c) 2020 Olivier Le Doeuff
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in all
-// copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-// SOFTWARE.
-
-#ifndef __QATERIAL_HOTRELOAD_PCH_HPP__
-#define __QATERIAL_HOTRELOAD_PCH_HPP__
-
-#include
-#include
-
-#include
-#include
-
-#include
-#include
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-#include
-#include
-
-#include
-
-#ifdef major
-# undef major
-#endif
-#ifdef minor
-# undef minor
-#endif
-
-#endif
diff --git a/hot_reload/src/Qaterial/HotReloadApp/Main.cpp b/hot_reload/src/Qaterial/HotReloadApp/Main.cpp
deleted file mode 100644
index e6d42f066a..0000000000
--- a/hot_reload/src/Qaterial/HotReloadApp/Main.cpp
+++ /dev/null
@@ -1,160 +0,0 @@
-// MIT License
-//
-// Copyright (c) 2020 Olivier Le Doeuff
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in all
-// copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-// SOFTWARE.
-
-// ──── INCLUDE ────
-
-#include "atomicdex/pch.hpp"
-
-
-#define QZXING_QML
-
-#include "QZXing.h"
-
-// Qaterial
-#include
-#include
-#include
-
-// spdlog
-#ifdef WIN32
-# include
-#endif
-#include
-
-// Qt
-#include
-#include
-#include
-#include
-#include
-
-#include "atomicdex/app.hpp"
-#include "atomicdex/models/qt.portfolio.model.hpp"
-
-#ifdef __APPLE__
-# include "atomicdex/platform/osx/manager.hpp"
-#endif
-
-// ──── DECLARATION ────
-
-void qtMsgOutput(QtMsgType type, const QMessageLogContext& context, const QString& msg)
-{
- const auto localMsg = msg.toLocal8Bit();
- switch(type)
- {
- case QtDebugMsg: qaterial::Logger::QATERIAL->debug(localMsg.constData()); break;
- case QtInfoMsg: qaterial::Logger::QATERIAL->info(localMsg.constData()); break;
- case QtWarningMsg: qaterial::Logger::QATERIAL->warn(localMsg.constData()); break;
- case QtCriticalMsg: qaterial::Logger::QATERIAL->error(localMsg.constData()); break;
- case QtFatalMsg: qaterial::Logger::QATERIAL->error(localMsg.constData()); abort();
- }
-
-#if defined(Q_OS_WIN)
- //OutputDebugStringW(reinterpret_cast(msg.utf16()));
-#elif defined(Q_OS_ANDROID)
- android_default_message_handler(type, context, msg);
-#endif
-}
-
-void installLoggers()
-{
- qInstallMessageHandler(qtMsgOutput);
-#ifdef WIN32
- const auto msvcSink = std::make_shared();
- qaterial::Logger::registerSink(msvcSink);
-#endif
- const auto stdoutSink = std::make_shared();
- qaterial::Logger::registerSink(stdoutSink);
- qaterial::Logger::registerSink(qaterial::HotReload::sink());
- stdoutSink->set_level(spdlog::level::debug);
- qaterial::HotReload::sink()->set_level(spdlog::level::debug);
- qaterial::Logger::QATERIAL->set_level(spdlog::level::debug);
-}
-
-// ──── FUNCTIONS ────
-
-int main(int argc, char* argv[])
-{
-#if defined(QATERIALHOTRELOAD_IGNORE_ENV)
- const QString executable = argv[0];
-# if defined(Q_OS_WINDOWS)
- const auto executablePath = executable.mid(0, executable.lastIndexOf("\\"));
- QCoreApplication::setLibraryPaths({executablePath});
-# endif
-#endif
- installLoggers();
-
- //! App declaration
- atomic_dex::application atomic_app;
-
- QtWebEngine::initialize();
- std::shared_ptr app = std::make_shared(argc, argv);
- QQmlApplicationEngine engine;
-
- // ──── REGISTER APPLICATION ────
-
- QGuiApplication::setOrganizationName("Qaterial");
- QGuiApplication::setApplicationName("Qaterial Hot Reload");
- QGuiApplication::setOrganizationDomain("https://olivierldff.github.io/Qaterial/");
- QGuiApplication::setApplicationVersion(qaterial::Version::version().readable());
- QGuiApplication::setWindowIcon(QIcon(":/Qaterial/HotReload/Images/icon.svg"));
-
- atomic_app.set_qt_app(app, &engine);
-
- // ──── LOAD AND REGISTER QML ────
-
-#if defined(QATERIALHOTRELOAD_IGNORE_ENV)
- engine.setImportPathList({QLibraryInfo::location(QLibraryInfo::Qml2ImportsPath), "qrc:/", "qrc:/qt-project.org/imports"});
-#else
- engine.addImportPath("qrc:/");
-#endif
-
- QZXing::registerQMLTypes();
- QZXing::registerQMLImageProvider(engine);
- qRegisterMetaType("MarketMode");
- qmlRegisterUncreatableType("AtomicDEX.MarketMode", 1, 0, "MarketMode", "Not creatable as it is an enum type");
- qRegisterMetaType("TradingError");
- qmlRegisterUncreatableType("AtomicDEX.TradingError", 1, 0, "TradingError", "Not creatable as it is an enum type");
- engine.rootContext()->setContextProperty("atomic_app", &atomic_app);
-
- //! Load Qaterial
- qaterial::loadQmlResources();
- qaterial::registerQmlTypes();
- qaterial::HotReload::registerSingleton();
- qqsfpm::registerQmlTypes();
- engine.addImportPath("qrc:/atomic_defi_design/imports");
- engine.addImportPath("qrc:/atomic_defi_design/Constants");
- qmlRegisterSingletonType(QUrl("qrc:/atomic_defi_design/qml/Constants/General.qml"), "App", 1, 0, "General");
- qmlRegisterSingletonType(QUrl("qrc:/atomic_defi_design/qml/Constants/Style.qml"), "App", 1, 0, "Style");
- qmlRegisterSingletonType(QUrl("qrc:/atomic_defi_design/qml/Constants/API.qml"), "App", 1, 0, "API");
- qRegisterMetaType("PortfolioRoles");
-
- // ──── LOAD QML MAIN ────
-
- engine.load(QUrl("qrc:/Qaterial/HotReload/Main.qml"));
- if(engine.rootObjects().isEmpty())
- return -1;
-
- // ──── START EVENT LOOP ────
-
- return QGuiApplication::exec();
-}
diff --git a/qml.qrc b/qml.qrc
index ab875fa2c5..5badce21c5 100644
--- a/qml.qrc
+++ b/qml.qrc
@@ -20,15 +20,18 @@
atomic_defi_design/assets/images/coins/aave.png
atomic_defi_design/assets/images/coins/aby.png
atomic_defi_design/assets/images/coins/ada.png
+ atomic_defi_design/assets/images/coins/adx.png
atomic_defi_design/assets/images/coins/agi.png
atomic_defi_design/assets/images/coins/ankr.png
atomic_defi_design/assets/images/coins/ant.png
atomic_defi_design/assets/images/coins/arpa.png
atomic_defi_design/assets/images/coins/atom.png
atomic_defi_design/assets/images/coins/aur.png
+ atomic_defi_design/assets/images/coins/ava.png
atomic_defi_design/assets/images/coins/avax.png
atomic_defi_design/assets/images/coins/awc.png
atomic_defi_design/assets/images/coins/axe.png
+ atomic_defi_design/assets/images/coins/babydoge.png
atomic_defi_design/assets/images/coins/bal.png
atomic_defi_design/assets/images/coins/band.png
atomic_defi_design/assets/images/coins/band.png
@@ -36,6 +39,7 @@
atomic_defi_design/assets/images/coins/bch.png
atomic_defi_design/assets/images/coins/best.png
atomic_defi_design/assets/images/coins/bet.png
+ atomic_defi_design/assets/images/coins/bidr.png
atomic_defi_design/assets/images/coins/blk.png
atomic_defi_design/assets/images/coins/bnb.png
atomic_defi_design/assets/images/coins/bnbt.png
@@ -48,12 +52,14 @@
atomic_defi_design/assets/images/coins/btt.png
atomic_defi_design/assets/images/coins/btu.png
atomic_defi_design/assets/images/coins/busd.png
+ atomic_defi_design/assets/images/coins/bte.png
atomic_defi_design/assets/images/coins/cake.png
atomic_defi_design/assets/images/coins/cdn.png
atomic_defi_design/assets/images/coins/ccl.png
atomic_defi_design/assets/images/coins/cel.png
atomic_defi_design/assets/images/coins/cennz.png
atomic_defi_design/assets/images/coins/chips.png
+ atomic_defi_design/assets/images/coins/ciphs.png
atomic_defi_design/assets/images/coins/chsb.png
atomic_defi_design/assets/images/coins/chz.png
atomic_defi_design/assets/images/coins/clc.png
@@ -86,8 +92,8 @@
atomic_defi_design/assets/images/coins/erc-20.png
atomic_defi_design/assets/images/coins/etc.png
atomic_defi_design/assets/images/coins/eth.png
+ atomic_defi_design/assets/images/coins/ethr.png
atomic_defi_design/assets/images/coins/eurs.png
- atomic_defi_design/assets/images/coins/fet.png
atomic_defi_design/assets/images/coins/fil.png
atomic_defi_design/assets/images/coins/firo.png
atomic_defi_design/assets/images/coins/fjc.png
@@ -103,16 +109,20 @@
atomic_defi_design/assets/images/coins/hpy.png
atomic_defi_design/assets/images/coins/ht.png
atomic_defi_design/assets/images/coins/husd.png
+ atomic_defi_design/assets/images/coins/il8p.png
atomic_defi_design/assets/images/coins/iln.png
+ atomic_defi_design/assets/images/coins/inj.png
atomic_defi_design/assets/images/coins/ink.png
atomic_defi_design/assets/images/coins/iota.png
atomic_defi_design/assets/images/coins/iotx.png
atomic_defi_design/assets/images/coins/jrt.png
+ atomic_defi_design/assets/images/coins/jstr.png
atomic_defi_design/assets/images/coins/jumblr.png
atomic_defi_design/assets/images/coins/kmd.png
atomic_defi_design/assets/images/coins/knc.png
atomic_defi_design/assets/images/coins/koin.png
atomic_defi_design/assets/images/coins/labs.png
+ atomic_defi_design/assets/images/coins/lbc.png
atomic_defi_design/assets/images/coins/lcc.png
atomic_defi_design/assets/images/coins/leo.png
atomic_defi_design/assets/images/coins/link.png
@@ -123,16 +133,18 @@
atomic_defi_design/assets/images/coins/mana.png
atomic_defi_design/assets/images/coins/matic.png
atomic_defi_design/assets/images/coins/mcl.png
- atomic_defi_design/assets/images/coins/med.png
+ atomic_defi_design/assets/images/coins/mesh.png
atomic_defi_design/assets/images/coins/mgw.png
atomic_defi_design/assets/images/coins/mkr.png
atomic_defi_design/assets/images/coins/mln.png
+ atomic_defi_design/assets/images/coins/mm.png
atomic_defi_design/assets/images/coins/mona.png
atomic_defi_design/assets/images/coins/morty.png
atomic_defi_design/assets/images/coins/mshark.png
atomic_defi_design/assets/images/coins/nav.png
atomic_defi_design/assets/images/coins/near.png
atomic_defi_design/assets/images/coins/nmc.png
+ atomic_defi_design/assets/images/coins/nvc.png
atomic_defi_design/assets/images/coins/oc.png
atomic_defi_design/assets/images/coins/ocean.png
atomic_defi_design/assets/images/coins/okb.png
@@ -142,6 +154,7 @@
atomic_defi_design/assets/images/coins/pangea.png
atomic_defi_design/assets/images/coins/pax.png
atomic_defi_design/assets/images/coins/paxg.png
+ atomic_defi_design/assets/images/coins/pic.png
atomic_defi_design/assets/images/coins/pnk.png
atomic_defi_design/assets/images/coins/powr.png
atomic_defi_design/assets/images/coins/put.png
@@ -181,14 +194,17 @@
atomic_defi_design/assets/images/coins/sushi.png
atomic_defi_design/assets/images/coins/sxp.png
atomic_defi_design/assets/images/coins/sys.png
+ atomic_defi_design/assets/images/coins/tblk.png
atomic_defi_design/assets/images/coins/tbtc.png
atomic_defi_design/assets/images/coins/thc.png
atomic_defi_design/assets/images/coins/thx.png
+ atomic_defi_design/assets/images/coins/tkl.png
atomic_defi_design/assets/images/coins/tmtg.png
atomic_defi_design/assets/images/coins/tqtum.png
atomic_defi_design/assets/images/coins/trac.png
atomic_defi_design/assets/images/coins/trc.png
atomic_defi_design/assets/images/coins/trx.png
+ atomic_defi_design/assets/images/coins/tryb.png
atomic_defi_design/assets/images/coins/tsl.png
atomic_defi_design/assets/images/coins/ttt.png
atomic_defi_design/assets/images/coins/tusd.png
@@ -196,6 +212,7 @@
atomic_defi_design/assets/images/coins/uis.png
atomic_defi_design/assets/images/coins/uma.png
atomic_defi_design/assets/images/coins/uni.png
+ atomic_defi_design/assets/images/coins/uno.png
atomic_defi_design/assets/images/coins/uos.png
atomic_defi_design/assets/images/coins/uqc.png
atomic_defi_design/assets/images/coins/usdc.png
@@ -203,17 +220,21 @@
atomic_defi_design/assets/images/coins/utk.png
atomic_defi_design/assets/images/coins/val.png
atomic_defi_design/assets/images/coins/vgx.png
- atomic_defi_design/assets/images/coins/vote2021.png
+ atomic_defi_design/assets/images/coins/vite.png
atomic_defi_design/assets/images/coins/vra.png
atomic_defi_design/assets/images/coins/vrm.png
atomic_defi_design/assets/images/coins/vrsc.png
atomic_defi_design/assets/images/coins/wbtc.png
+ atomic_defi_design/assets/images/coins/wcn.png
atomic_defi_design/assets/images/coins/wlc.png
atomic_defi_design/assets/images/coins/wsb.png
atomic_defi_design/assets/images/coins/xlm.png
+ atomic_defi_design/assets/images/coins/xmy.png
atomic_defi_design/assets/images/coins/xor.png
+ atomic_defi_design/assets/images/coins/xpm.png
atomic_defi_design/assets/images/coins/xrp.png
atomic_defi_design/assets/images/coins/xtz.png
+ atomic_defi_design/assets/images/coins/xvc.png
atomic_defi_design/assets/images/coins/xvs.png
atomic_defi_design/assets/images/coins/yfi.png
atomic_defi_design/assets/images/coins/yfii.png
@@ -314,22 +335,43 @@
atomic_defi_design/qml/Components/DefaultTextField.qml
atomic_defi_design/qml/Components/DefaultTooltip.qml
atomic_defi_design/qml/Components/DexAnimatedImage.qml
+ atomic_defi_design/qml/Components/DexAmountField.qml
+ atomic_defi_design/qml/Components/DexAppButton.qml
+ atomic_defi_design/qml/Components/DexTransparentButton.qml
+ atomic_defi_design/qml/Components/DexAppOutlineButton.qml
+ atomic_defi_design/qml/Components/DexAppTextField.qml
+ atomic_defi_design/qml/Components/DexAppPasswordField.qml
+ atomic_defi_design/qml/Components/DexBox.qml
+ atomic_defi_design/qml/Components/DexBoxManager.qml
atomic_defi_design/qml/Components/DexBusyIndicator.qml
atomic_defi_design/qml/Components/DexButton.qml
atomic_defi_design/qml/Components/DexCheckBox.qml
+ atomic_defi_design/qml/Components/DexCheckEye.qml
atomic_defi_design/qml/Components/DexColorOverlay.qml
+ atomic_defi_design/qml/Components/DexCopyableLabel.qml
atomic_defi_design/qml/Components/DexComboBox.qml
+ atomic_defi_design/qml/Components/DexDialogManager.qml
+ atomic_defi_design/qml/Components/DexDialogTextField.qml
atomic_defi_design/qml/Components/DexFadebehavior.qml
+ atomic_defi_design/qml/Components/DexVisibleBehavior.qml
atomic_defi_design/qml/Components/DexFlickable.qml
+ atomic_defi_design/qml/Components/DexGradientAppButton.qml
+ atomic_defi_design/qml/Components/DexIconButton.qml
atomic_defi_design/qml/Components/DexImage.qml
atomic_defi_design/qml/Components/DexInnerShadow.qml
atomic_defi_design/qml/Components/DexItemBox.qml
atomic_defi_design/qml/Components/DexLabel.qml
atomic_defi_design/qml/Components/DexLabelUnlinked.qml
+ atomic_defi_design/qml/Components/DexLanguage.qml
atomic_defi_design/qml/Components/DexListView.qml
atomic_defi_design/qml/Components/DexLoader.qml
+ atomic_defi_design/qml/Components/DexKeyChecker.qml
+ atomic_defi_design/qml/Components/DexMacControl.qml
atomic_defi_design/qml/Components/DexModal.qml
+ atomic_defi_design/qml/Components/DexModalHeader.qml
atomic_defi_design/qml/Components/DexMouseArea.qml
+ atomic_defi_design/qml/Components/DexPaginator.qml
+ atomic_defi_design/qml/Components/DexPopup.qml
atomic_defi_design/qml/Components/DexRangeSlider.qml
atomic_defi_design/qml/Components/DexRectangle.qml
atomic_defi_design/qml/Components/DexScrollBar.qml
@@ -339,11 +381,14 @@
atomic_defi_design/qml/Components/DexSubstractRectangle.qml
atomic_defi_design/qml/Components/DexSweetComboBox.qml
atomic_defi_design/qml/Components/DexSwitch.qml
+ atomic_defi_design/qml/Constants/DexThemeManager.qml
atomic_defi_design/qml/Components/DexText.qml
+ atomic_defi_design/qml/Components/DexAppTextArea.qml
atomic_defi_design/qml/Components/DexTextArea.qml
atomic_defi_design/qml/Components/DexTextEdit.qml
atomic_defi_design/qml/Components/DexTextField.qml
atomic_defi_design/qml/Components/DexTooltip.qml
+ atomic_defi_design/qml/Components/DexTradeBox.qml
atomic_defi_design/qml/Components/DexWindow.qml
atomic_defi_design/qml/Components/DexWindowControl.qml
atomic_defi_design/qml/Components/DexWindowHeaderControl.qml
@@ -352,6 +397,7 @@
atomic_defi_design/qml/Components/FloatingBackground.qml
atomic_defi_design/qml/Components/ForceRestartModal.qml
atomic_defi_design/qml/Components/GradientRectangle.qml
+ atomic_defi_design/qml/Components/HelpModal.qml
atomic_defi_design/qml/Components/HideFieldButton.qml
atomic_defi_design/qml/Components/HorizontalLine.qml
atomic_defi_design/qml/Components/InnerBackground.qml
@@ -388,6 +434,8 @@
atomic_defi_design/qml/Components/WalletNameField.qml
atomic_defi_design/qml/Constants
atomic_defi_design/qml/Constants/API.qml
+ atomic_defi_design/qml/Constants/DexTheme.qml
+ atomic_defi_design/qml/Constants/DexTypo.qml
atomic_defi_design/qml/Constants/General.qml
atomic_defi_design/qml/Constants/Style.qml
atomic_defi_design/qml/Dashboard/FatalErrorModal.qml
@@ -419,7 +467,20 @@
atomic_defi_design/qml/Exchange/Trade/Orders/OrdersPage.qml
atomic_defi_design/qml/Exchange/Trade/Orders/SwapProgress.qml
atomic_defi_design/qml/Exchange/Trade/PriceLine.qml
+ atomic_defi_design/qml/Exchange/Trade/PriceLineSimplified.qml
atomic_defi_design/qml/Exchange/Trade/ProView.qml
+ atomic_defi_design/qml/Exchange/Trade/SimpleView/List.qml
+ atomic_defi_design/qml/Exchange/Trade/SimpleView/Main.qml
+ atomic_defi_design/qml/Exchange/Trade/SimpleView/Main.js
+ atomic_defi_design/qml/Exchange/Trade/SimpleView/NavigationLabel.qml
+ atomic_defi_design/qml/Exchange/Trade/SimpleView/Trade.qml
+ atomic_defi_design/qml/Exchange/Trade/SimpleView/CoinsListModal.qml
+ atomic_defi_design/qml/Exchange/Trade/SimpleView/BestOrdersModal.qml
+ atomic_defi_design/qml/Exchange/Trade/SimpleView/OrderRemovedModal.qml
+ atomic_defi_design/qml/Exchange/Trade/SimpleView/SubBestOrder.qml
+ atomic_defi_design/qml/Exchange/Trade/SimpleView/SubCoinSelector.qml
+ atomic_defi_design/qml/Exchange/Trade/SimpleView/SubOrders.qml
+ atomic_defi_design/qml/Exchange/Trade/SimpleView/SubHistory.qml
atomic_defi_design/qml/Exchange/Trade/SweetDexComboBox.qml
atomic_defi_design/qml/Exchange/Trade/TickerSelector.qml
atomic_defi_design/qml/Exchange/Trade/Trade.qml
@@ -444,6 +505,7 @@
atomic_defi_design/qml/Settings/DeleteWalletModal.qml
atomic_defi_design/qml/Settings/Languages.qml
atomic_defi_design/qml/Settings/RecoverSeedModal.qml
+ atomic_defi_design/qml/Settings/SettingsButton.qml
atomic_defi_design/qml/Settings/SettingModal.qml
atomic_defi_design/qml/Settings/Settings.qml
atomic_defi_design/qml/Sidebar/Sidebar.qml
@@ -451,6 +513,7 @@
atomic_defi_design/qml/Sidebar/SidebarCenter.qml
atomic_defi_design/qml/Sidebar/SidebarLine.qml
atomic_defi_design/qml/Sidebar/SidebarTooltip.qml
+ atomic_defi_design/qml/Sidebar/Line.qml
atomic_defi_design/qml/Support/FAQLine.qml
atomic_defi_design/qml/Support/Support.qml
atomic_defi_design/qml/Wallet/AddressBook.qml
@@ -473,6 +536,7 @@
atomic_defi_design/qml/Wallet/SendModalContactList.qml
atomic_defi_design/qml/Wallet/SendResult.qml
atomic_defi_design/qml/Wallet/Sidebar.qml
+ atomic_defi_design/qml/Wallet/SidebarItemDelegate.qml
atomic_defi_design/qml/Wallet/TransactionDetailsModal.qml
atomic_defi_design/qml/Wallet/Transactions.qml
atomic_defi_design/qml/Wallet/Wallet.qml
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index c3acbe8eb3..b1f257f307 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -4,13 +4,14 @@ include(DEX_NEW_LIB)
DEX_NEW_LIB(core INTERFACE
INTERFACE_DEPS
cpprestsdk::cpprest Qt::Core Qt::Quick Qt::Svg Qt::Charts Qt::WebEngine Qt::WebEngineCore Qt::WebEngineWidgets
- Qt::Widgets nlohmann_json::nlohmann_json antara_qrcode spdlog::spdlog antara::world reproc++
+ Qt::Widgets nlohmann_json::nlohmann_json antara_qrcode spdlog::spdlog antara::world
unofficial-btc::bitcoin komodo-date::date komodo-taskflow::taskflow
Boost::random Boost::filesystem komodo-sodium::sodium antara::app::net
INTERFACE_DEFS
$<$,$>:QT_QML_DEBUG> $<$:HAS_REMOTE_API>
$<$:AUTO_DOWNLOAD>
$<$:SPDLOG_WCHAR_TO_UTF8_SUPPORT>
+ _TURN_OFF_PLATFORM_STRING
DEX_NAME="${DEX_DISPLAY_NAME}" DEX_WEBSITE_URL="${DEX_WEBSITE}"
DEX_SUPPORT_URL="${DEX_SUPPORT_PAGE}" DEX_DISCORD_URL="${DEX_DISCORD}" DEX_TWITTER_URL="${DEX_TWITTER}"
DEX_PRIMARY_COIN="${DEX_PRIMARY_COIN}" DEX_SECOND_PRIMARY_COIN="${DEX_SECOND_PRIMARY_COIN}" #DEX_COMMON_DATA_FOLDER="${DEX_COMMON_DATA_FOLDER}"
@@ -41,9 +42,7 @@ if (DISABLE_GEOBLOCKING)
message(STATUS "Disabling Geoblocking for dev purpose")
target_compile_definitions(${PROJECT_NAME}_core INTERFACE -DDISABLE_GEOBLOCKING)
endif ()
-if (NOT WITH_HOTRELOAD)
- target_link_libraries(${PROJECT_NAME}_core INTERFACE SortFilterProxyModel)
-endif()
+target_link_libraries(${PROJECT_NAME}_core INTERFACE SortFilterProxyModel)
# Translation files
@@ -56,6 +55,7 @@ set(TS_FILES
set_source_files_properties(${TS_FILES} PROPERTIES OUTPUT_LOCATION ${CMAKE_SOURCE_DIR}/atomic_defi_design/assets/languages)
qt5_create_translation(QM_FILES
${PROJECT_SOURCE_DIR}/atomic_defi_design/qml
+ ${PROJECT_SOURCE_DIR}/src
${TS_FILES}
OPTIONS -source-language en_US -no-obsolete)
message(STATUS "QM FILES -> ${QM_FILES}")
diff --git a/src/app/app.cpp b/src/app/app.cpp
index 97503c739c..aa72133f7d 100644
--- a/src/app/app.cpp
+++ b/src/app/app.cpp
@@ -76,8 +76,24 @@ namespace atomic_dex
std::vector coins_std{};
coins_std.reserve(coins.size());
atomic_dex::mm2_service& mm2 = get_mm2();
- for (auto&& coin: coins) { coins_std.push_back(coin.toStdString()); }
+ std::unordered_set extra_coins;
+ for (auto&& coin: coins) {
+ auto coin_info = mm2.get_coin_info(coin.toStdString());
+ if (coin_info.has_parent_fees_ticker && coin_info.ticker != coin_info.fees_ticker)
+ {
+ auto coin_parent_info = mm2.get_coin_info(coin_info.fees_ticker);
+ if (extra_coins.insert(coin_parent_info.ticker).second)
+ {
+ SPDLOG_INFO("Adding extra coin: {} to enable", coin_parent_info.ticker);
+ }
+ }
+ coins_std.push_back(coin.toStdString());
+ }
+ for (auto&& extra_coin : extra_coins)
+ {
+ coins_std.push_back(extra_coin);
+ }
mm2.enable_multiple_coins(coins_std);
return true;
@@ -143,6 +159,7 @@ namespace atomic_dex
void
application::launch()
{
+ SPDLOG_INFO("Launch the application");
this->system_manager_.start();
auto* timer = new QTimer(this);
connect(timer, &QTimer::timeout, this, &application::tick);
@@ -289,7 +306,12 @@ namespace atomic_dex
application::application(QObject* pParent) : QObject(pParent)
{
fs::path settings_path = (atomic_dex::utils::get_current_configs_path() / "cfg.ini");
- this->entity_registry_.set(settings_path.string().c_str(), QSettings::IniFormat);
+ #if defined(_WIN32) || defined(WIN32)
+ this->entity_registry_.set(QString::fromStdWString(settings_path.wstring()), QSettings::IniFormat);
+ #else
+ this->entity_registry_.set(QString::fromStdString(settings_path.string()), QSettings::IniFormat);
+ #endif
+
//! Creates managers
{
system_manager_.create_system(system_manager_);
@@ -332,6 +354,7 @@ namespace atomic_dex
wallet_mgr->set_wallet_default_name(wallet_mgr->get_default_wallet_name());
// set_wallet_default_name(get_default_wallet_name());
}
+ SPDLOG_INFO("application created");
}
void
@@ -390,8 +413,6 @@ namespace atomic_dex
bool
application::disconnect()
{
- SPDLOG_INFO("disconnecting every models");
-
//! Clears pending events
while (not this->m_actions_queue.empty())
{
diff --git a/src/app/main.prerequisites.hpp b/src/app/main.prerequisites.hpp
index 3a9e824463..9c0d5925d8 100644
--- a/src/app/main.prerequisites.hpp
+++ b/src/app/main.prerequisites.hpp
@@ -30,6 +30,7 @@
#include
#include
#include
+#include
#include
//! Qaterial
@@ -68,44 +69,10 @@
#endif
#if defined(ATOMICDEX_HOT_RELOAD)
-void
-qtMsgOutput(QtMsgType type, const QMessageLogContext& context, const QString& msg)
-{
- const auto localMsg = msg.toLocal8Bit();
- switch (type)
- {
- case QtDebugMsg:
- qaterial::Logger::QATERIAL->debug(localMsg.constData());
- break;
- case QtInfoMsg:
- qaterial::Logger::QATERIAL->info(localMsg.constData());
- break;
- case QtWarningMsg:
- qaterial::Logger::QATERIAL->warn(localMsg.constData());
- break;
- case QtCriticalMsg:
- qaterial::Logger::QATERIAL->error(localMsg.constData());
- break;
- case QtFatalMsg:
- qaterial::Logger::QATERIAL->error(localMsg.constData());
- abort();
- }
-}
-
void
installLoggers()
{
- qInstallMessageHandler(qtMsgOutput);
-# ifdef WIN32
- const auto msvcSink = std::make_shared();
- qaterial::Logger::registerSink(msvcSink);
-# endif
- const auto stdoutSink = std::make_shared();
- qaterial::Logger::registerSink(stdoutSink);
- qaterial::Logger::registerSink(qaterial::HotReload::sink());
- stdoutSink->set_level(spdlog::level::debug);
- qaterial::HotReload::sink()->set_level(spdlog::level::debug);
- qaterial::Logger::QATERIAL->set_level(spdlog::level::debug);
+ qInstallMessageHandler(&qaterial::HotReload::log);
}
#endif
@@ -238,6 +205,7 @@ init_dpi()
QGuiApplication::setHighDpiScaleFactorRoundingPolicy(
should_floor ? Qt::HighDpiScaleFactorRoundingPolicy::Floor : Qt::HighDpiScaleFactorRoundingPolicy::PassThrough);
QGuiApplication::setAttribute(should_floor ? Qt::AA_DisableHighDpiScaling : Qt::AA_EnableHighDpiScaling);
+ SPDLOG_INFO("dpi settings finished");
}
static void
@@ -253,10 +221,17 @@ init_timezone_db()
{
SPDLOG_INFO("Init timezone db");
#if defined(_WIN32) || defined(WIN32)
- using namespace std::string_literals;
- auto install_db_tz_path = std::make_unique(ag::core::assets_real_path() / "tools" / "timezone" / "tzdata");
- std::cout << install_db_tz_path->string() << std::endl;
- date::set_install(install_db_tz_path->string());
+ try
+ {
+ using namespace std::string_literals;
+ auto install_db_tz_path = std::make_unique(ag::core::assets_real_path() / "tools" / "timezone" / "tzdata");
+ date::set_install(install_db_tz_path->string());
+ SPDLOG_INFO("Timezone db successfully initialized");
+ }
+ catch (const std::exception& error)
+ {
+ SPDLOG_ERROR("Couldn't initialize timezone DB, you will get UTC time instead");
+ }
#endif
}
@@ -266,12 +241,11 @@ setup_default_themes()
const fs::path theme_path = atomic_dex::utils::get_themes_path();
fs::path original_theme_path{ag::core::assets_real_path() / "themes"};
fs_error_code ec;
- SPDLOG_INFO("Checking for setup default themes - theme_path: {} original_theme_path: {}", theme_path.string(), original_theme_path.string());
- if (fs::is_empty(theme_path, ec))
- {
- SPDLOG_INFO("{} is empty, copying default themes into this directory", theme_path.string());
- fs::copy(original_theme_path, theme_path, ec);
- }
+
+ LOG_PATH_CMP("Checking for setup default themes - theme_path: {} original_theme_path: {}", theme_path, original_theme_path);
+ LOG_PATH("copying default themes into directory: {}", theme_path);
+ //fs::remove_all(theme_path);
+ fs::copy(original_theme_path, theme_path, fs::copy_options::recursive | fs::copy_options::overwrite_existing, ec);
if (ec)
{
SPDLOG_ERROR("fs::error: {}", ec.message());
@@ -284,12 +258,10 @@ setup_default_themes()
const fs::path logo_path = atomic_dex::utils::get_logo_path();
fs::path original_logo_path{ag::core::assets_real_path() / "logo"};
- SPDLOG_INFO("Checking for setup default logo - logo_path: {} original_logo_path: {}", logo_path.string(), original_logo_path.string());
- if (fs::is_empty(logo_path, ec))
- {
- SPDLOG_INFO("{} is empty, copying default logo into this directory", logo_path.string());
- fs::copy(original_logo_path, logo_path, ec);
- }
+ LOG_PATH_CMP("Checking for setup default logo - logo_path: {} original_logo_path: {}", logo_path, original_logo_path);
+ //fs::remove_all(logo_path);
+ fs::copy(original_logo_path, logo_path, fs::copy_options::recursive | fs::copy_options::overwrite_existing, ec);
+ LOG_PATH("copying default logo into directory: {}", logo_path);
if (ec)
{
SPDLOG_ERROR("fs::error: {}", ec.message());
@@ -307,7 +279,7 @@ check_settings_reconfiguration(const fs::path& path)
if (fs::exists(previous_path) && !fs::exists(path))
{
fs_error_code ec;
- SPDLOG_INFO("Copying {} to {}", previous_path.string(), path.string());
+ LOG_PATH_CMP("Copying {} to {}", previous_path, path);
fs::copy(previous_path, path, ec);
if (ec)
{
@@ -316,12 +288,13 @@ check_settings_reconfiguration(const fs::path& path)
SPDLOG_INFO("Deleting previous cfg after reconfiguring it");
ec.clear();
- fs::remove_all( get_atomic_dex_data_folder() / get_precedent_raw_version(), ec);
+ fs::remove_all(get_atomic_dex_data_folder() / get_precedent_raw_version(), ec);
if (ec)
{
SPDLOG_ERROR("error occured when deleting previous path");
}
}
+ SPDLOG_INFO("reconfiguration for settings finished");
}
static void
@@ -341,19 +314,20 @@ handle_settings(QSettings& settings)
};
SPDLOG_INFO("file name settings: {}", settings.fileName().toStdString());
create_settings_functor("CurrentTheme", QString("Dark.json"));
+
+#if defined(_WIN32) || defined(WIN32)
+ create_settings_functor("ThemePath", QString::fromStdWString(atomic_dex::utils::get_themes_path().wstring()));
+#else
create_settings_functor("ThemePath", QString::fromStdString(atomic_dex::utils::get_themes_path().string()));
+#endif
create_settings_functor("AutomaticUpdateOrderBot", QVariant(false));
create_settings_functor("WalletChartsCategory", qint32(WalletChartsCategories::OneMonth));
create_settings_functor("AvailableLang", QStringList{"en", "fr", "tr", "ru"});
create_settings_functor("CurrentLang", QString("en"));
create_settings_functor("2FA", 0);
create_settings_functor("MaximumNbCoinsEnabled", 50);
-#ifdef __APPLE__
- create_settings_functor("FontMode", QQuickWindow::TextRenderType::NativeTextRendering);
- QQuickWindow::setTextRenderType(static_cast(settings.value("FontMode").toInt()));
-#else
+ create_settings_functor("DefaultTradingMode", TradingMode::Simple);
create_settings_functor("FontMode", QQuickWindow::TextRenderType::QtTextRendering);
-#endif
}
inline int
@@ -368,6 +342,10 @@ run_app(int argc, char** argv)
QSslSocket::sslLibraryVersionString().toStdString());
#if defined(Q_OS_MACOS)
+ // https://bugreports.qt.io/browse/QTBUG-89379
+ qputenv("QT_ENABLE_GLYPH_CACHE_WORKAROUND", "1");
+ qputenv("QML_USE_GLYPHCACHE_WORKAROUND", "1");
+
fs::path old_path = fs::path(std::getenv("HOME")) / ".atomic_qt";
fs::path target_path = atomic_dex::utils::get_atomic_dex_data_folder();
SPDLOG_INFO("{} exists -> {}", old_path.string(), fs::exists(old_path));
@@ -410,11 +388,13 @@ run_app(int argc, char** argv)
QtWebEngine::initialize();
std::shared_ptr app = std::make_shared(argc, argv);
+ app->setWindowIcon(QIcon(":/atomic_defi_design/assets/images/logo/dex-logo.png"));
app->setOrganizationName("KomodoPlatform");
app->setOrganizationDomain("com");
QQmlApplicationEngine engine;
atomic_app.set_qt_app(app, &engine);
+ SPDLOG_INFO("post set_qt_app");
//! QT QML
engine.addImportPath("qrc:///");
@@ -426,10 +406,16 @@ run_app(int argc, char** argv)
qmlRegisterUncreatableType(
"AtomicDEX.WalletChartsCategories", 1, 0, "WalletChartsCategories", "Not creatable as it is an enum type");
qRegisterMetaType("TradingError");
+ qRegisterMetaType("SelectedOrderStatus");
+ qmlRegisterUncreatableType(
+ "AtomicDEX.SelectedOrderStatus", 1, 0, "SelectedOrderStatus", "Not creatable as it is an enum type");
qmlRegisterUncreatableType("AtomicDEX.TradingError", 1, 0, "TradingError", "Not creatable as it is an enum type");
qRegisterMetaType("CoinType");
qmlRegisterUncreatableType("AtomicDEX.CoinType", 1, 0, "CoinType", "Not creatable as it is an enum type");
+ SPDLOG_INFO("QML Enum created");
+ const QFont fixedFont = QFontDatabase::systemFont(QFontDatabase::FixedFont);
+ engine.rootContext()->setContextProperty("atomic_fixed_font", fixedFont);
engine.rootContext()->setContextProperty("atomic_app", &atomic_app);
engine.rootContext()->setContextProperty("atomic_app_name", QString{DEX_NAME});
engine.rootContext()->setContextProperty("atomic_app_website_url", QString{DEX_WEBSITE_URL});
@@ -439,24 +425,35 @@ run_app(int argc, char** argv)
engine.rootContext()->setContextProperty("atomic_app_primary_coin", QString{DEX_PRIMARY_COIN});
engine.rootContext()->setContextProperty("atomic_app_secondary_coin", QString{DEX_SECOND_PRIMARY_COIN});
engine.rootContext()->setContextProperty("atomic_qt_utilities", &qt_utilities);
- engine.rootContext()->setContextProperty("atomic_cfg_file", QString::fromStdString((atomic_dex::utils::get_current_configs_path() / "cfg.ini").string()));
- engine.rootContext()->setContextProperty("atomic_logo_path", QString::fromStdString((atomic_dex::utils::get_atomic_dex_data_folder() / "logo").string()));
+ #if defined(_WIN32) || defined(WIN32)
+ engine.rootContext()->setContextProperty("atomic_cfg_file", QString::fromStdWString((atomic_dex::utils::get_current_configs_path() / "cfg.ini").wstring()));
+ engine.rootContext()->setContextProperty("atomic_logo_path", QString::fromStdWString((atomic_dex::utils::get_atomic_dex_data_folder() / "logo").wstring()));
+ #else
+ engine.rootContext()->setContextProperty("atomic_cfg_file", QString::fromStdString((atomic_dex::utils::get_current_configs_path() / "cfg.ini").string()));
+ engine.rootContext()->setContextProperty("atomic_logo_path", QString::fromStdString((atomic_dex::utils::get_atomic_dex_data_folder() / "logo").string()));
+ #endif
+
engine.rootContext()->setContextProperty("atomic_settings", &settings);
engine.rootContext()->setContextProperty("dex_current_version", QString::fromStdString(atomic_dex::get_version()));
engine.rootContext()->setContextProperty("qtversion", QString(qVersion()));
+ SPDLOG_INFO("QML context properties created");
// Load Qaterial.
qaterial::loadQmlResources(false);
qaterial::registerQmlTypes("Qaterial", 1, 0);
// QQuickStyle::setStyle(QStringLiteral("Qaterial"));
// SPDLOG_INFO("{}", QQuickStyle::ge))
+ SPDLOG_INFO("Qaterial type created");
engine.addImportPath("qrc:/atomic_defi_design/imports");
engine.addImportPath("qrc:/atomic_defi_design/Constants");
+ qmlRegisterSingletonType(QUrl("qrc:/atomic_defi_design/qml/Constants/DexTheme.qml"), "App", 1, 0, "DexTheme");
+ qmlRegisterSingletonType(QUrl("qrc:/atomic_defi_design/qml/Constants/DexTypo.qml"), "App", 1, 0, "DexTypo");
qmlRegisterSingletonType(QUrl("qrc:/atomic_defi_design/qml/Constants/General.qml"), "App", 1, 0, "General");
qmlRegisterSingletonType(QUrl("qrc:/atomic_defi_design/qml/Constants/Style.qml"), "App", 1, 0, "Style");
qmlRegisterSingletonType(QUrl("qrc:/atomic_defi_design/qml/Constants/API.qml"), "App", 1, 0, "API");
qRegisterMetaType("PortfolioRoles");
+ SPDLOG_INFO("QML singleton created");
#if defined(ATOMICDEX_HOT_RELOAD)
engine.rootContext()->setContextProperty("debug_bar", QVariant(true));
@@ -469,6 +466,7 @@ run_app(int argc, char** argv)
if (engine.rootObjects().isEmpty())
return -1;
#else
+ SPDLOG_INFO("Load qml engine");
engine.rootContext()->setContextProperty("debug_bar", QVariant(false));
const QUrl url(QStringLiteral("qrc:/atomic_defi_design/qml/main.qml"));
QObject::connect(
@@ -483,6 +481,7 @@ run_app(int argc, char** argv)
Qt::QueuedConnection);
engine.load(url);
+ SPDLOG_INFO("qml engine successfully loaded");
#endif
diff --git a/src/core/atomicdex/api/coingecko/coingecko.cpp b/src/core/atomicdex/api/coingecko/coingecko.cpp
index 6560139e6b..fff54a825f 100644
--- a/src/core/atomicdex/api/coingecko/coingecko.cpp
+++ b/src/core/atomicdex/api/coingecko/coingecko.cpp
@@ -126,6 +126,8 @@ namespace atomic_dex::coingecko::api
{
answer.current_price = std::to_string(j.at("current_price").get());
boost::algorithm::replace_all(answer.current_price, ",", ".");
+ answer.total_volume = std::to_string(j.at("total_volume").get());
+ boost::algorithm::replace_all(answer.total_volume, ",", ".");
std::ostringstream ss;
ss << std::setprecision(2) << j.at("price_change_percentage_24h").get();
answer.price_change_24h = ss.str();
diff --git a/src/core/atomicdex/api/coingecko/coingecko.hpp b/src/core/atomicdex/api/coingecko/coingecko.hpp
index 29126a41a3..88625c0a10 100644
--- a/src/core/atomicdex/api/coingecko/coingecko.hpp
+++ b/src/core/atomicdex/api/coingecko/coingecko.hpp
@@ -44,6 +44,7 @@ namespace atomic_dex::coingecko::api
{
std::string price_change_24h;
std::string current_price;
+ std::string total_volume;
nlohmann::json sparkline_in_7d{nlohmann::json::array()};
};
diff --git a/src/core/atomicdex/api/mm2/generic.error.cpp b/src/core/atomicdex/api/mm2/generic.error.cpp
new file mode 100644
index 0000000000..4c0f6ab146
--- /dev/null
+++ b/src/core/atomicdex/api/mm2/generic.error.cpp
@@ -0,0 +1,18 @@
+//
+// Created by Sztergbaum Roman on 08/06/2021.
+//
+
+#include "atomicdex/api/mm2/generic.error.hpp"
+
+namespace mm2::api
+{
+ void
+ from_json(const nlohmann::json& j, generic_answer_error& res)
+ {
+ j.at("error").get_to(res.error);
+ j.at("error_path").get_to(res.error_path);
+ j.at("error_trace").get_to(res.error_trace);
+ j.at("error_type").get_to(res.error_type);
+ j.at("error_data").get_to(res.error_data);
+ }
+} // namespace mm2::api
\ No newline at end of file
diff --git a/src/core/atomicdex/api/mm2/generic.error.hpp b/src/core/atomicdex/api/mm2/generic.error.hpp
new file mode 100644
index 0000000000..a7de90b803
--- /dev/null
+++ b/src/core/atomicdex/api/mm2/generic.error.hpp
@@ -0,0 +1,21 @@
+#pragma once
+
+//! STD Headers
+#include
+
+//! Deps
+#include
+
+namespace mm2::api
+{
+ struct generic_answer_error
+ {
+ std::string error;
+ std::string error_path;
+ std::string error_trace;
+ std::string error_type;
+ nlohmann::json error_data;
+ };
+
+ void from_json(const nlohmann::json& j, generic_answer_error& res);
+} // namespace mm2::api
\ No newline at end of file
diff --git a/src/core/atomicdex/api/mm2/generics.cpp b/src/core/atomicdex/api/mm2/generics.cpp
index b7f5e20371..6920b12069 100644
--- a/src/core/atomicdex/api/mm2/generics.cpp
+++ b/src/core/atomicdex/api/mm2/generics.cpp
@@ -21,11 +21,14 @@
#include "atomicdex/api/mm2/generics.hpp"
#include "atomicdex/api/mm2/rpc.best.orders.hpp"
#include "atomicdex/api/mm2/rpc.buy.hpp"
+#include "atomicdex/api/mm2/rpc.convertaddress.hpp"
#include "atomicdex/api/mm2/rpc.disable.hpp"
#include "atomicdex/api/mm2/rpc.max.taker.vol.hpp"
#include "atomicdex/api/mm2/rpc.min.volume.hpp"
#include "atomicdex/api/mm2/rpc.sell.hpp"
#include "atomicdex/api/mm2/rpc.trade.preimage.hpp"
+#include "atomicdex/api/mm2/rpc.validate.address.hpp"
+#include "atomicdex/api/mm2/rpc.recover.funds.hpp"
namespace mm2::api
{
@@ -50,4 +53,7 @@ namespace mm2::api
template void extract_rpc_json_answer(const nlohmann::json& j, sell_answer& answer);
template void extract_rpc_json_answer(const nlohmann::json& j, best_orders_answer& answer);
template void extract_rpc_json_answer(const nlohmann::json& j, disable_coin_answer& answer);
+ template void extract_rpc_json_answer(const nlohmann::json& j, validate_address_answer& answer);
+ template void extract_rpc_json_answer(const nlohmann::json& j, convert_address_answer& answer);
+ template void extract_rpc_json_answer(const nlohmann::json& j, recover_funds_of_swap_answer& answer);
} // namespace mm2::api
\ No newline at end of file
diff --git a/src/core/atomicdex/api/mm2/mm2.client.cpp b/src/core/atomicdex/api/mm2/mm2.client.cpp
index f4782aaf4f..8eab3ff8a5 100644
--- a/src/core/atomicdex/api/mm2/mm2.client.cpp
+++ b/src/core/atomicdex/api/mm2/mm2.client.cpp
@@ -8,6 +8,7 @@
//! Project Headers
#include "atomicdex/api/mm2/mm2.client.hpp"
#include "atomicdex/api/mm2/mm2.hpp"
+#include "atomicdex/api/mm2/rpc.tx.history.hpp"
namespace
{
diff --git a/src/core/atomicdex/api/mm2/mm2.cpp b/src/core/atomicdex/api/mm2/mm2.cpp
index 8ebd429f81..b9beab57dc 100644
--- a/src/core/atomicdex/api/mm2/mm2.cpp
+++ b/src/core/atomicdex/api/mm2/mm2.cpp
@@ -20,9 +20,13 @@
//! Project Headers
#include "atomicdex/api/mm2/mm2.hpp"
#include "atomicdex/api/mm2/rpc.best.orders.hpp"
+#include "atomicdex/api/mm2/rpc.convertaddress.hpp"
#include "atomicdex/api/mm2/rpc.min.volume.hpp"
#include "atomicdex/api/mm2/rpc.orderbook.hpp"
#include "atomicdex/api/mm2/rpc.trade.preimage.hpp"
+#include "atomicdex/api/mm2/rpc.validate.address.hpp"
+#include "atomicdex/api/mm2/rpc.withdraw.hpp"
+#include "atomicdex/api/mm2/rpc.recover.funds.hpp"
#include "atomicdex/pages/qt.settings.page.hpp"
#include "atomicdex/services/price/global.provider.hpp"
#include "atomicdex/utilities/global.utilities.hpp"
@@ -165,211 +169,6 @@ namespace
namespace mm2::api
{
- void
- from_json(const nlohmann::json& j, fee_regular_coin& cfg)
- {
- j.at("amount").get_to(cfg.amount);
- }
-
- void
- from_json(const nlohmann::json& j, fee_erc_coin& cfg)
- {
- j.at("coin").get_to(cfg.coin);
- j.at("gas").get_to(cfg.gas);
- j.at("gas_price").get_to(cfg.gas_price);
- j.at("total_fee").get_to(cfg.total_fee);
- }
-
- void
- from_json(const nlohmann::json& j, fee_qrc_coin& cfg)
- {
- j.at("coin").get_to(cfg.coin);
- j.at("gas_limit").get_to(cfg.gas_limit);
- j.at("gas_price").get_to(cfg.gas_price);
- j.at("miner_fee").get_to(cfg.miner_fee);
- j.at("total_gas_fee").get_to(cfg.total_gas_fee);
- }
-
- void
- from_json(const nlohmann::json& j, fees_data& cfg)
- {
- if (j.count("amount") == 1)
- {
- cfg.normal_fees = fee_regular_coin{};
- from_json(j, cfg.normal_fees.value());
- }
- else if (auto coin = j.at("coin").get(); coin == "ETH" || coin == "BNB" || coin == "BNBT" || coin == "ETHR")
- {
- cfg.erc_fees = fee_erc_coin{};
- from_json(j, cfg.erc_fees.value());
- }
- else if (j.at("coin").get() == "QTUM" || j.at("coin").get() == "tQTUM")
- {
- cfg.qrc_fees = fee_qrc_coin{};
- from_json(j, cfg.qrc_fees.value());
- }
- }
-
- void
- to_json(nlohmann::json& j, const tx_history_request& cfg)
- {
- j["coin"] = cfg.coin;
- j["limit"] = cfg.limit;
- }
-
- void
- from_json(const nlohmann::json& j, transaction_data& cfg)
- {
- j.at("block_height").get_to(cfg.block_height);
- j.at("coin").get_to(cfg.coin);
- if (j.contains("confirmations"))
- {
- cfg.confirmations = j.at("confirmations").get();
- }
- j.at("fee_details").get_to(cfg.fee_details);
- j.at("from").get_to(cfg.from);
- j.at("internal_id").get_to(cfg.internal_id);
- j.at("my_balance_change").get_to(cfg.my_balance_change);
- j.at("received_by_me").get_to(cfg.received_by_me);
- j.at("spent_by_me").get_to(cfg.spent_by_me);
- j.at("timestamp").get_to(cfg.timestamp);
- j.at("to").get_to(cfg.to);
- j.at("total_amount").get_to(cfg.total_amount);
- j.at("tx_hash").get_to(cfg.tx_hash);
- j.at("tx_hex").get_to(cfg.tx_hex);
-
- std::string s = atomic_dex::utils::to_human_date(cfg.timestamp, "%e %b %Y, %H:%M");
- cfg.timestamp_as_date = std::move(s);
- }
-
- void
- from_json(const nlohmann::json& j, sync_status_additional_error& answer)
- {
- j.at("code").get_to(answer.code);
- j.at("message").get_to(answer.message);
- }
-
-
- void
- from_json(const nlohmann::json& j, sync_status_eth_erc_20_coins& answer)
- {
- j.at("blocks_left").get_to(answer.blocks_left);
- }
-
- void
- from_json(const nlohmann::json& j, sync_status_regular_coins& answer)
- {
- j.at("transactions_left").get_to(answer.transactions_left);
- }
-
- void
- from_json(const nlohmann::json& j, sync_status_additional_infos& answer)
- {
- if (j.count("error") == 1)
- {
- answer.error = j.get();
- }
- else if (j.count("blocks_left") == 1)
- {
- answer.erc_infos = j.get();
- }
- else if (j.count("transactions_left") == 1)
- {
- answer.regular_infos = j.get();
- }
- }
-
- void
- from_json(const nlohmann::json& j, t_sync_status& answer)
- {
- j.at("state").get_to(answer.state);
- if (j.count("additional_info") == 1)
- {
- answer.additional_info = j.at("additional_info").get();
- }
- }
-
- void
- from_json(const nlohmann::json& j, tx_history_answer_success& answer)
- {
- if (j.contains("from_id"))
- {
- if (not j.at("from_id").is_null())
- j.at("from_id").get_to(answer.from_id);
- }
- if (j.contains("current_block"))
- {
- j.at("current_block").get_to(answer.current_block);
- }
- j.at("limit").get_to(answer.limit);
- j.at("skipped").get_to(answer.skipped);
- if (j.contains("sync_status"))
- {
- j.at("sync_status").get_to(answer.sync_status);
- }
- j.at("total").get_to(answer.total);
- j.at("transactions").get_to(answer.transactions);
- }
-
- void
- from_json(const nlohmann::json& j, tx_history_answer& answer)
- {
- if (j.contains("error"))
- {
- answer.error = j.at("error").get();
- }
- else
- {
- answer.result = j.at("result").get();
- }
- }
-
- void
- to_json(nlohmann::json& j, const withdraw_fees& cfg)
- {
- j["type"] = cfg.type;
- if (cfg.type == "EthGas")
- {
- j["gas"] = cfg.gas_limit.value_or(55000);
- j["gas_price"] = cfg.gas_price.value();
- }
- else if (cfg.type == "Qrc20Gas")
- {
- j["gas_limit"] = cfg.gas_limit.value_or(40);
- j["gas_price"] = std::stoi(cfg.gas_price.value());
- }
- else
- {
- j["amount"] = cfg.amount.value();
- }
- }
-
- void
- to_json(nlohmann::json& j, const withdraw_request& cfg)
- {
- j["coin"] = cfg.coin;
- j["amount"] = cfg.amount;
- j["to"] = cfg.to;
- j["max"] = cfg.max;
- if (cfg.fees.has_value())
- {
- j["fee"] = cfg.fees.value();
- }
- }
-
- void
- from_json(const nlohmann::json& j, withdraw_answer& answer)
- {
- if (j.count("error") >= 1)
- {
- answer.error = j.at("error").get();
- }
- else
- {
- answer.result = j.get();
- }
- }
-
void
to_json(nlohmann::json& j, const send_raw_transaction_request& cfg)
{
@@ -769,9 +568,14 @@ namespace mm2::api
}
nlohmann::json
- template_request(std::string method_name)
+ template_request(std::string method_name, bool is_protocol_v2)
{
- return {{"method", std::move(method_name)}, {"userpass", get_rpc_password()}};
+ nlohmann::json request = {{"method", std::move(method_name)}, {"userpass", get_rpc_password()}};
+ if (is_protocol_v2)
+ {
+ request["mmrpc"] = "2.0";
+ }
+ return request;
}
std::string
@@ -893,17 +697,20 @@ namespace mm2::api
return answer;
}
- template mm2::api::withdraw_answer rpc_process_answer_batch(nlohmann::json& json_answer, const std::string& rpc_command);
- template mm2::api::my_orders_answer rpc_process_answer_batch(nlohmann::json& json_answer, const std::string& rpc_command);
- template mm2::api::orderbook_answer rpc_process_answer_batch(nlohmann::json& json_answer, const std::string& rpc_command);
- template mm2::api::trade_fee_answer rpc_process_answer_batch(nlohmann::json& json_answer, const std::string& rpc_command);
- template mm2::api::max_taker_vol_answer rpc_process_answer_batch(nlohmann::json& json_answer, const std::string& rpc_command);
- template mm2::api::min_volume_answer rpc_process_answer_batch(nlohmann::json& json_answer, const std::string& rpc_command);
- template mm2::api::my_recent_swaps_answer rpc_process_answer_batch(nlohmann::json& json_answer, const std::string& rpc_command);
- template mm2::api::active_swaps_answer rpc_process_answer_batch(nlohmann::json& json_answer, const std::string& rpc_command);
- template mm2::api::show_priv_key_answer rpc_process_answer_batch(nlohmann::json& json_answer, const std::string& rpc_command);
- template mm2::api::trade_preimage_answer rpc_process_answer_batch(nlohmann::json& json_answer, const std::string& rpc_command);
- template mm2::api::best_orders_answer rpc_process_answer_batch(nlohmann::json& json_answer, const std::string& rpc_command);
+ template mm2::api::withdraw_answer rpc_process_answer_batch(nlohmann::json& json_answer, const std::string& rpc_command);
+ template mm2::api::my_orders_answer rpc_process_answer_batch(nlohmann::json& json_answer, const std::string& rpc_command);
+ template mm2::api::orderbook_answer rpc_process_answer_batch(nlohmann::json& json_answer, const std::string& rpc_command);
+ template mm2::api::trade_fee_answer rpc_process_answer_batch(nlohmann::json& json_answer, const std::string& rpc_command);
+ template mm2::api::max_taker_vol_answer rpc_process_answer_batch(nlohmann::json& json_answer, const std::string& rpc_command);
+ template mm2::api::min_volume_answer rpc_process_answer_batch(nlohmann::json& json_answer, const std::string& rpc_command);
+ template mm2::api::my_recent_swaps_answer rpc_process_answer_batch(nlohmann::json& json_answer, const std::string& rpc_command);
+ template mm2::api::active_swaps_answer rpc_process_answer_batch(nlohmann::json& json_answer, const std::string& rpc_command);
+ template mm2::api::show_priv_key_answer rpc_process_answer_batch(nlohmann::json& json_answer, const std::string& rpc_command);
+ template mm2::api::trade_preimage_answer rpc_process_answer_batch(nlohmann::json& json_answer, const std::string& rpc_command);
+ template mm2::api::best_orders_answer rpc_process_answer_batch(nlohmann::json& json_answer, const std::string& rpc_command);
+ template mm2::api::validate_address_answer rpc_process_answer_batch(nlohmann::json& json_answer, const std::string& rpc_command);
+ template mm2::api::convert_address_answer rpc_process_answer_batch(nlohmann::json& json_answer, const std::string& rpc_command);
+ template mm2::api::recover_funds_of_swap_answer rpc_process_answer_batch(nlohmann::json& json_answer, const std::string& rpc_command);
void
set_system_manager(ag::ecs::system_manager& system_manager)
diff --git a/src/core/atomicdex/api/mm2/mm2.hpp b/src/core/atomicdex/api/mm2/mm2.hpp
index 47cd310c7a..57b15785fd 100644
--- a/src/core/atomicdex/api/mm2/mm2.hpp
+++ b/src/core/atomicdex/api/mm2/mm2.hpp
@@ -62,166 +62,6 @@ namespace mm2::api
void from_json(const nlohmann::json& j, trade_fee_answer& cfg);
- struct fee_regular_coin
- {
- std::string amount;
- };
-
- void from_json(const nlohmann::json& j, fee_regular_coin& cfg);
-
- struct fee_erc_coin
- {
- std::string coin;
- std::size_t gas;
- std::string gas_price;
- std::string total_fee;
- };
-
- void from_json(const nlohmann::json& j, fee_erc_coin& cfg);
-
- struct fee_qrc_coin
- {
- std::string coin;
- std::string miner_fee;
- std::size_t gas_limit;
- std::size_t gas_price;
- std::string total_gas_fee;
- };
-
- void from_json(const nlohmann::json& j, fee_qrc_coin& cfg);
-
- struct fees_data
- {
- std::optional normal_fees; ///< btc, kmd based coins
- std::optional erc_fees; ///< eth based coins
- std::optional qrc_fees; // Qtum based coin
- };
-
- void from_json(const nlohmann::json& j, fees_data& cfg);
-
-
- struct tx_history_request
- {
- std::string coin;
- std::size_t limit;
- };
-
- void to_json(nlohmann::json& j, const tx_history_request& cfg);
-
- struct transaction_data
- {
- std::size_t timestamp;
- std::vector from;
- std::vector to;
- fees_data fee_details;
- std::optional confirmations;
- std::string coin;
- std::size_t block_height;
- std::string internal_id;
- std::string spent_by_me;
- std::string received_by_me;
- std::string my_balance_change;
- std::string total_amount;
- std::string tx_hash;
- std::string tx_hex;
- std::string timestamp_as_date; ///< human readeable timestamp
- };
-
- void from_json(const nlohmann::json& j, transaction_data& cfg);
-
- struct sync_status_additional_error
- {
- std::string message;
- int code;
- };
-
- void from_json(const nlohmann::json& j, sync_status_additional_error& answer);
-
- struct sync_status_eth_erc_20_coins
- {
- std::size_t blocks_left;
- };
-
- void from_json(const nlohmann::json& j, sync_status_eth_erc_20_coins& answer);
-
- struct sync_status_regular_coins
- {
- std::size_t transactions_left;
- };
-
- void from_json(const nlohmann::json& j, sync_status_regular_coins& answer);
-
- struct sync_status_additional_infos
- {
- std::optional error; ///< in case of error
- std::optional erc_infos; ///< eth/erc20 related coins
- std::optional regular_infos; ///< kmd/btc/utxo related coins
- };
-
- void from_json(const nlohmann::json& j, sync_status_additional_infos& answer);
-
- struct t_sync_status
- {
- std::string state; ///< NotEnabled, NotStarted, InProgress, Error, Finished
- std::optional additional_info;
- };
-
- void from_json(const nlohmann::json& j, t_sync_status& answer);
-
- struct tx_history_answer_success
- {
- std::string from_id;
- std::size_t skipped;
- std::size_t limit;
- std::size_t current_block;
- std::size_t total;
- std::vector transactions;
- t_sync_status sync_status;
- };
-
- void from_json(const nlohmann::json& j, tx_history_answer_success& answer);
-
- struct tx_history_answer
- {
- std::optional error;
- std::optional result;
- std::string raw_result; ///< internal
- int rpc_result_code; ///< internal
- };
-
- void from_json(const nlohmann::json& j, tx_history_answer& answer);
-
- struct withdraw_fees
- {
- std::string type; ///< UtxoFixed, UtxoPerKbyte, EthGas, Qrc20Gas
- std::optional amount; ///< Utxo only
- std::optional gas_price; ///< price EthGas or Qrc20Gas
- std::optional gas_limit; ///< sets the gas limit for transaction
- };
-
- void to_json(nlohmann::json& j, const withdraw_fees& cfg);
-
- struct withdraw_request
- {
- std::string coin;
- std::string to; ///< coins will be withdraw to this address
- std::string amount; ///< ignored if max is true
- std::optional fees{std::nullopt}; ///< ignored if std::nullopt
- bool max{false};
- };
-
- void to_json(nlohmann::json& j, const withdraw_request& cfg);
-
- struct withdraw_answer
- {
- std::optional result;
- std::optional error;
- std::string raw_result; ///< internal
- int rpc_result_code; ///< internal
- };
-
- void from_json(const nlohmann::json& j, withdraw_answer& answer);
-
struct send_raw_transaction_request
{
std::string tx_hex;
@@ -394,7 +234,7 @@ namespace mm2::api
pplx::task async_process_rpc_get(t_http_client_ptr& client, const std::string rpc_command, const std::string& url);
- nlohmann::json template_request(std::string method_name) ;
+ nlohmann::json template_request(std::string method_name, bool is_protocol_v2 = false);
void set_rpc_password(std::string rpc_password) ;
const std::string& get_rpc_password() ;
@@ -404,11 +244,7 @@ namespace mm2::api
namespace atomic_dex
{
using t_my_orders_answer = ::mm2::api::my_orders_answer;
- using t_withdraw_request = ::mm2::api::withdraw_request;
- using t_withdraw_fees = ::mm2::api::withdraw_fees;
- using t_withdraw_answer = ::mm2::api::withdraw_answer;
using t_broadcast_request = ::mm2::api::send_raw_transaction_request;
- using t_tx_history_request = ::mm2::api::tx_history_request;
using t_my_recent_swaps_answer = ::mm2::api::my_recent_swaps_answer;
using t_my_recent_swaps_request = ::mm2::api::my_recent_swaps_request;
using t_active_swaps_request = ::mm2::api::active_swaps_request;
diff --git a/src/core/atomicdex/api/mm2/orderbook.order.contents.cpp b/src/core/atomicdex/api/mm2/orderbook.order.contents.cpp
index cf2081a87c..2e0cb2f910 100644
--- a/src/core/atomicdex/api/mm2/orderbook.order.contents.cpp
+++ b/src/core/atomicdex/api/mm2/orderbook.order.contents.cpp
@@ -36,6 +36,16 @@ namespace mm2::api
j.at("price_fraction").at("denom").get_to(contents.price_fraction_denom);
j.at("max_volume_fraction").at("numer").get_to(contents.max_volume_fraction_numer);
j.at("max_volume_fraction").at("denom").get_to(contents.max_volume_fraction_denom);
+
+ j.at("base_min_volume_fraction").at("numer").get_to(contents.base_min_volume_numer);
+ j.at("base_min_volume_fraction").at("denom").get_to(contents.base_min_volume_denom);
+ j.at("base_max_volume_fraction").at("numer").get_to(contents.base_max_volume_numer);
+ j.at("base_max_volume_fraction").at("denom").get_to(contents.base_max_volume_denom);
+ j.at("rel_min_volume_fraction").at("numer").get_to(contents.rel_min_volume_numer);
+ j.at("rel_min_volume_fraction").at("denom").get_to(contents.rel_min_volume_denom);
+ j.at("rel_max_volume_fraction").at("numer").get_to(contents.rel_max_volume_numer);
+ j.at("rel_max_volume_fraction").at("denom").get_to(contents.rel_max_volume_denom);
+
j.at("maxvolume").get_to(contents.maxvolume);
j.at("pubkey").get_to(contents.pubkey);
j.at("age").get_to(contents.age);
@@ -67,9 +77,13 @@ namespace mm2::api
std::stringstream ss;
ss << "coin: " << coin << " ";
ss << "address: " << address << " ";
- //ss << "price: " << price << " ";
+ ss << "price: " << price << " ";
ss << "max_volume: " << maxvolume << " ";
ss << "depth_percent: " << depth_percent << " ";
+ ss << "base_max_volume: " << base_max_volume << " ";
+ ss << "rel_max_volume: " << rel_max_volume << " ";
+ ss << "base_min_volume: " << base_min_volume << " ";
+ ss << "rel_min_volume: " << rel_min_volume << " ";
return ss.str();
}
} // namespace mm2::api
\ No newline at end of file
diff --git a/src/core/atomicdex/api/mm2/orderbook.order.contents.hpp b/src/core/atomicdex/api/mm2/orderbook.order.contents.hpp
index 353bc46e66..a97609de26 100644
--- a/src/core/atomicdex/api/mm2/orderbook.order.contents.hpp
+++ b/src/core/atomicdex/api/mm2/orderbook.order.contents.hpp
@@ -34,9 +34,17 @@ namespace mm2::api
std::string max_volume_fraction_denom;
std::string maxvolume;
std::string base_min_volume;
+ std::string base_min_volume_denom;
+ std::string base_min_volume_numer;
std::string base_max_volume;
+ std::string base_max_volume_denom;
+ std::string base_max_volume_numer;
std::string rel_min_volume;
+ std::string rel_min_volume_denom;
+ std::string rel_min_volume_numer;
std::string rel_max_volume;
+ std::string rel_max_volume_denom;
+ std::string rel_max_volume_numer;
std::string pubkey;
std::size_t age;
std::size_t zcredits;
diff --git a/src/core/atomicdex/api/mm2/rpc.best.orders.cpp b/src/core/atomicdex/api/mm2/rpc.best.orders.cpp
index be6128dbf2..cab39abea5 100644
--- a/src/core/atomicdex/api/mm2/rpc.best.orders.cpp
+++ b/src/core/atomicdex/api/mm2/rpc.best.orders.cpp
@@ -14,6 +14,9 @@
* *
******************************************************************************/
+//! STD
+#include
+
//! Deps
#include
#include
@@ -45,13 +48,28 @@ namespace mm2::api
for (auto&& [key, value]: j.items())
{
// SPDLOG_INFO("{} best orders size: {}", key, value.size());
+ //bool hit = false;
+ std::unordered_set uuid_visited;
for (auto&& cur_order: value)
{
order_contents contents;
contents.rel_coin = key;
from_json(cur_order, contents);
- answer.result.emplace_back(std::move(contents));
+ if (uuid_visited.emplace(contents.uuid).second)
+ {
+ answer.result.emplace_back(std::move(contents));
+ }
+ else
+ {
+ //hit = true;
+ SPDLOG_WARN("Order with uuid: {} already added - skipping", contents.uuid);
+ }
}
+ /*if (hit)
+ {
+ SPDLOG_WARN("mm2 answer duplicated: {}", value.dump());
+ hit = false;
+ }*/
}
}
}
diff --git a/src/core/atomicdex/api/mm2/rpc.convertaddress.cpp b/src/core/atomicdex/api/mm2/rpc.convertaddress.cpp
new file mode 100644
index 0000000000..32f3f8fbf3
--- /dev/null
+++ b/src/core/atomicdex/api/mm2/rpc.convertaddress.cpp
@@ -0,0 +1,33 @@
+//
+// Created by Sztergbaum Roman on 22/05/2021.
+//
+
+//! Deps
+#include
+
+//! Project Headers
+#include "atomicdex/api/mm2/rpc.convertaddress.hpp"
+#include "atomicdex/api/mm2/generics.hpp"
+
+namespace mm2::api
+{
+ void
+ to_json(nlohmann::json& j, const mm2::api::convert_address_request& req)
+ {
+ j["coin"] = req.coin;
+ j["from"] = req.from;
+ j["to_address_format"] = req.to_address_format;
+ }
+
+ void
+ from_json(const nlohmann::json& j, convert_address_answer_success& answer)
+ {
+ j.at("address").get_to(answer.address);
+ }
+
+ void
+ from_json(const nlohmann::json& j, convert_address_answer& answer)
+ {
+ extract_rpc_json_answer(j, answer);
+ }
+} // namespace mm2::api
diff --git a/src/core/atomicdex/api/mm2/rpc.convertaddress.hpp b/src/core/atomicdex/api/mm2/rpc.convertaddress.hpp
new file mode 100644
index 0000000000..31e599d4bf
--- /dev/null
+++ b/src/core/atomicdex/api/mm2/rpc.convertaddress.hpp
@@ -0,0 +1,43 @@
+#pragma once
+
+#include
+#include
+
+//! Deps
+#include
+
+namespace mm2::api
+{
+ struct convert_address_request
+ {
+ std::string coin;
+ std::string from; ///< input address
+ nlohmann::json to_address_format;
+ };
+
+ void to_json(nlohmann::json& j, const convert_address_request& req);
+
+ struct convert_address_answer_success
+ {
+ std::string address;
+ };
+
+ void from_json(const nlohmann::json& j, convert_address_answer_success& answer);
+
+ struct convert_address_answer
+ {
+ std::optional result;
+ std::optional error;
+ std::string raw_result; ///< internal
+ int rpc_result_code; ///< internal
+ };
+
+ void from_json(const nlohmann::json& j, convert_address_answer& answer);
+} // namespace mm2::api
+
+namespace atomic_dex
+{
+ using t_convert_address_request = ::mm2::api::convert_address_request;
+ using t_convert_address_answer = ::mm2::api::convert_address_answer;
+ using t_convert_address_answer_success = ::mm2::api::convert_address_answer_success;
+} // namespace atomic_dex
\ No newline at end of file
diff --git a/src/core/atomicdex/api/mm2/rpc.electrum.cpp b/src/core/atomicdex/api/mm2/rpc.electrum.cpp
index d7fc46fd5c..86d90c695d 100644
--- a/src/core/atomicdex/api/mm2/rpc.electrum.cpp
+++ b/src/core/atomicdex/api/mm2/rpc.electrum.cpp
@@ -33,7 +33,12 @@ namespace mm2::api
if (cfg.coin_type == CoinType::QRC20)
{
j["swap_contract_address"] = cfg.is_testnet ? cfg.testnet_qrc_swap_contract_address : cfg.mainnet_qrc_swap_contract_address;
+ j["fallback_swap_contract"] = cfg.is_testnet ? cfg.testnet_fallback_qrc_swap_contract_address : cfg.mainnet_fallback_qrc_swap_contract_address;
}
+ if (cfg.address_format.has_value()) {
+ j["address_format"] = cfg.address_format.value();
+ }
+ //SPDLOG_INFO("electrum: {}", j.dump());
}
//! Deserialization
diff --git a/src/core/atomicdex/api/mm2/rpc.electrum.hpp b/src/core/atomicdex/api/mm2/rpc.electrum.hpp
index 4e71d7aff6..80f0cfdec9 100644
--- a/src/core/atomicdex/api/mm2/rpc.electrum.hpp
+++ b/src/core/atomicdex/api/mm2/rpc.electrum.hpp
@@ -33,7 +33,10 @@ namespace mm2::api
bool is_testnet{false};
bool with_tx_history{true};
const std::string testnet_qrc_swap_contract_address{"0xba8b71f3544b93e2f681f996da519a98ace0107a"};
+ const std::string testnet_fallback_qrc_swap_contract_address{testnet_qrc_swap_contract_address};
const std::string mainnet_qrc_swap_contract_address{"0x2f754733acd6d753731c00fee32cb484551cc15d"};
+ const std::string mainnet_fallback_qrc_swap_contract_address{mainnet_qrc_swap_contract_address};
+ std::optional address_format;
};
struct electrum_answer
diff --git a/src/core/atomicdex/api/mm2/rpc.enable.cpp b/src/core/atomicdex/api/mm2/rpc.enable.cpp
index d3dd9814eb..b24eefd5d8 100644
--- a/src/core/atomicdex/api/mm2/rpc.enable.cpp
+++ b/src/core/atomicdex/api/mm2/rpc.enable.cpp
@@ -33,16 +33,18 @@ namespace mm2::api
{
case CoinType::ERC20:
{
- j["gas_station_url"] = cfg.gas_station_url;
- j["urls"] = cfg.urls;
- j["swap_contract_address"] = cfg.is_testnet ? cfg.erc_testnet_swap_contract_address : cfg.erc_swap_contract_address;
+ j["gas_station_url"] = cfg.gas_station_url;
+ j["urls"] = cfg.urls;
+ j["swap_contract_address"] = cfg.is_testnet ? cfg.erc_testnet_swap_contract_address : cfg.erc_swap_contract_address;
+ j["fallback_swap_contract"] = cfg.is_testnet ? cfg.erc_testnet_fallback_swap_contract_address : cfg.erc_fallback_swap_contract_address;
break;
}
break;
case CoinType::BEP20:
{
- j["swap_contract_address"] = cfg.is_testnet ? cfg.bnb_testnet_swap_contract_address : cfg.bnb_swap_contract_address;
- j["urls"] = cfg.urls;
+ j["swap_contract_address"] = cfg.is_testnet ? cfg.bnb_testnet_swap_contract_address : cfg.bnb_swap_contract_address;
+ j["fallback_swap_contract"] = cfg.is_testnet ? cfg.bnb_testnet_fallback_swap_contract_address : cfg.bnb_fallback_swap_contract_address;
+ j["urls"] = cfg.urls;
break;
}
default:
diff --git a/src/core/atomicdex/api/mm2/rpc.enable.hpp b/src/core/atomicdex/api/mm2/rpc.enable.hpp
index 32dabf31c4..5f8a1d60e5 100644
--- a/src/core/atomicdex/api/mm2/rpc.enable.hpp
+++ b/src/core/atomicdex/api/mm2/rpc.enable.hpp
@@ -31,10 +31,14 @@ namespace mm2::api
std::vector urls;
CoinType coin_type;
bool is_testnet{false};
- const std::string erc_swap_contract_address{"0x8500AFc0bc5214728082163326C2FF0C73f4a871"};
- const std::string erc_testnet_swap_contract_address{"0x7Bc1bBDD6A0a722fC9bffC49c921B685ECB84b94"};
+ const std::string erc_swap_contract_address{"0x24ABE4c71FC658C91313b6552cd40cD808b3Ea80"};
+ const std::string erc_testnet_swap_contract_address{"0x6b5A52217006B965BB190864D62dc3d270F7AaFD"};
const std::string bnb_testnet_swap_contract_address{"0xcCD17C913aD7b772755Ad4F0BDFF7B34C6339150"};
const std::string bnb_swap_contract_address{"0xeDc5b89Fe1f0382F9E4316069971D90a0951DB31"};
+ const std::string erc_fallback_swap_contract_address{"0x8500AFc0bc5214728082163326C2FF0C73f4a871"};
+ const std::string erc_testnet_fallback_swap_contract_address{"0x7Bc1bBDD6A0a722fC9bffC49c921B685ECB84b94"};
+ const std::string bnb_fallback_swap_contract_address{bnb_swap_contract_address};
+ const std::string bnb_testnet_fallback_swap_contract_address{bnb_testnet_swap_contract_address};
std::string gas_station_url{"https://ethgasstation.info/json/ethgasAPI.json"};
std::string type; ///< QRC-20 ?
bool with_tx_history{true};
diff --git a/src/core/atomicdex/api/mm2/rpc.max.taker.vol.cpp b/src/core/atomicdex/api/mm2/rpc.max.taker.vol.cpp
index d60a3ee457..554fafc374 100644
--- a/src/core/atomicdex/api/mm2/rpc.max.taker.vol.cpp
+++ b/src/core/atomicdex/api/mm2/rpc.max.taker.vol.cpp
@@ -42,20 +42,25 @@ namespace mm2::api
{
j.at("denom").get_to(cfg.denom);
j.at("numer").get_to(cfg.numer);
+ //SPDLOG_INFO("max: {}", j.dump(4));
t_rational rat(boost::multiprecision::cpp_int(cfg.numer), boost::multiprecision::cpp_int(cfg.denom));
t_float_50 res = rat.convert_to();
- cfg.decimal = res.str(8);
+ cfg.decimal = atomic_dex::utils::extract_large_float(res.str(50));
+ //SPDLOG_INFO("decimal: {}", cfg.decimal);
}
void
from_json(const nlohmann::json& j, max_taker_vol_answer& answer)
{
+ //SPDLOG_INFO("max: {}", j.dump(4));
extract_rpc_json_answer(j, answer);
if (answer.error.has_value()) ///< we need a default fallback in this case fixed on upstream already, need to update
{
SPDLOG_WARN("Max taker volume need a default value, fallback with 0 as value, this is probably because you have an empty balance or not enough "
- "funds (< 0.00777).");
+ "funds (< 0.00777)., error: {}", answer.error.value());
answer.result = max_taker_vol_answer_success{.denom = "1", .numer = "0", .decimal = "0"};
+ } else {
+ answer.result.value().coin = j.at("coin").get();
}
}
} // namespace mm2::api
\ No newline at end of file
diff --git a/src/core/atomicdex/api/mm2/rpc.max.taker.vol.hpp b/src/core/atomicdex/api/mm2/rpc.max.taker.vol.hpp
index a765f5c855..cb90104a9a 100644
--- a/src/core/atomicdex/api/mm2/rpc.max.taker.vol.hpp
+++ b/src/core/atomicdex/api/mm2/rpc.max.taker.vol.hpp
@@ -38,6 +38,7 @@ namespace mm2::api
std::string denom;
std::string numer;
std::string decimal;
+ std::string coin;
};
void from_json(const nlohmann::json& j, max_taker_vol_answer_success& cfg);
diff --git a/src/core/atomicdex/api/mm2/rpc.recover.funds.cpp b/src/core/atomicdex/api/mm2/rpc.recover.funds.cpp
index d04fe514d2..99df8d3009 100644
--- a/src/core/atomicdex/api/mm2/rpc.recover.funds.cpp
+++ b/src/core/atomicdex/api/mm2/rpc.recover.funds.cpp
@@ -29,7 +29,7 @@ namespace mm2::api
void
from_json(const nlohmann::json& j, recover_funds_of_swap_answer& answer)
{
- if (j.count("error") == 1)
+ if (j.contains("error"))
{
answer.error = j.at("error").get();
}
diff --git a/src/core/atomicdex/api/mm2/rpc.sell.cpp b/src/core/atomicdex/api/mm2/rpc.sell.cpp
index 74e8c4018e..6546f5a018 100644
--- a/src/core/atomicdex/api/mm2/rpc.sell.cpp
+++ b/src/core/atomicdex/api/mm2/rpc.sell.cpp
@@ -39,7 +39,7 @@ namespace mm2::api
j["base"] = request.base;
j["rel"] = request.rel;
j["volume"] = request.volume; //< First take the user input
- if (request.is_max) //< It's a real max means user want to sell his base_max_taker_vol let's take the fraction repr
+ if (request.is_max && !request.selected_order_use_input_volume) //< It's a real max means user want to sell his base_max_taker_vol let's take the fraction repr
{
j["volume"] = volume_fraction_functor();
}
@@ -64,7 +64,7 @@ namespace mm2::api
price_fraction_repr["numer"] = request.price_numer;
price_fraction_repr["denom"] = request.price_denom;
j["price"] = price_fraction_repr;
- if (request.is_exact_selected_order_volume)
+ if (request.is_exact_selected_order_volume && !request.selected_order_use_input_volume)
{
j["volume"] = volume_fraction_functor();
}
@@ -74,6 +74,10 @@ namespace mm2::api
{
SPDLOG_INFO("The order is not picked from orderbook we create it from volume = {}, price = {}", j.at("volume").dump(4), request.price);
}
+ if (request.order_type.has_value())
+ {
+ j["order_type"] = request.order_type.value();
+ }
}
void
diff --git a/src/core/atomicdex/api/mm2/rpc.sell.hpp b/src/core/atomicdex/api/mm2/rpc.sell.hpp
index f1b350812a..02be4e5071 100644
--- a/src/core/atomicdex/api/mm2/rpc.sell.hpp
+++ b/src/core/atomicdex/api/mm2/rpc.sell.hpp
@@ -30,21 +30,22 @@ namespace mm2::api
{
struct sell_request
{
- std::string base;
- std::string rel;
- std::string price;
- std::string volume;
- bool is_created_order;
- std::string price_denom;
- std::string price_numer;
- std::string volume_denom;
- std::string volume_numer;
- bool is_exact_selected_order_volume;
- bool selected_order_use_input_volume{false};
- std::optional rel_nota;
- std::optional rel_confs;
- bool is_max;
- std::optional min_volume{std::nullopt};
+ std::string base;
+ std::string rel;
+ std::string price;
+ std::string volume;
+ bool is_created_order;
+ std::string price_denom;
+ std::string price_numer;
+ std::string volume_denom;
+ std::string volume_numer;
+ bool is_exact_selected_order_volume;
+ bool selected_order_use_input_volume{false};
+ std::optional rel_nota;
+ std::optional rel_confs;
+ bool is_max;
+ std::optional min_volume{std::nullopt};
+ std::optional order_type{std::nullopt};
};
void to_json(nlohmann::json& j, const sell_request& request);
diff --git a/src/core/atomicdex/api/mm2/rpc.tx.history.cpp b/src/core/atomicdex/api/mm2/rpc.tx.history.cpp
new file mode 100644
index 0000000000..79aff426a9
--- /dev/null
+++ b/src/core/atomicdex/api/mm2/rpc.tx.history.cpp
@@ -0,0 +1,93 @@
+#include "rpc.tx.history.hpp"
+
+namespace mm2::api
+{
+ void
+ to_json(nlohmann::json& j, const tx_history_request& cfg)
+ {
+ j["coin"] = cfg.coin;
+ j["limit"] = cfg.limit;
+ }
+
+ void
+ from_json(const nlohmann::json& j, sync_status_additional_error& answer)
+ {
+ j.at("code").get_to(answer.code);
+ j.at("message").get_to(answer.message);
+ }
+
+
+ void
+ from_json(const nlohmann::json& j, sync_status_eth_erc_20_coins& answer)
+ {
+ j.at("blocks_left").get_to(answer.blocks_left);
+ }
+
+ void
+ from_json(const nlohmann::json& j, sync_status_regular_coins& answer)
+ {
+ j.at("transactions_left").get_to(answer.transactions_left);
+ }
+
+ void
+ from_json(const nlohmann::json& j, sync_status_additional_infos& answer)
+ {
+ if (j.count("error") == 1)
+ {
+ answer.error = j.get();
+ }
+ else if (j.count("blocks_left") == 1)
+ {
+ answer.erc_infos = j.get();
+ }
+ else if (j.count("transactions_left") == 1)
+ {
+ answer.regular_infos = j.get();
+ }
+ }
+
+ void
+ from_json(const nlohmann::json& j, t_sync_status& answer)
+ {
+ j.at("state").get_to(answer.state);
+ if (j.count("additional_info") == 1)
+ {
+ answer.additional_info = j.at("additional_info").get();
+ }
+ }
+
+ void
+ from_json(const nlohmann::json& j, tx_history_answer_success& answer)
+ {
+ if (j.contains("from_id"))
+ {
+ if (not j.at("from_id").is_null())
+ j.at("from_id").get_to(answer.from_id);
+ }
+ if (j.contains("current_block"))
+ {
+ j.at("current_block").get_to(answer.current_block);
+ }
+ j.at("limit").get_to(answer.limit);
+ j.at("skipped").get_to(answer.skipped);
+ if (j.contains("sync_status"))
+ {
+ j.at("sync_status").get_to(answer.sync_status);
+ }
+ j.at("total").get_to(answer.total);
+ j.at("transactions").get_to(answer.transactions);
+ }
+
+ void
+ from_json(const nlohmann::json& j, tx_history_answer& answer)
+ {
+ if (j.contains("error"))
+ {
+ answer.error = j.at("error").get();
+ }
+ else
+ {
+ answer.result = j.at("result").get();
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/core/atomicdex/api/mm2/rpc.tx.history.hpp b/src/core/atomicdex/api/mm2/rpc.tx.history.hpp
new file mode 100644
index 0000000000..b81f23b624
--- /dev/null
+++ b/src/core/atomicdex/api/mm2/rpc.tx.history.hpp
@@ -0,0 +1,88 @@
+#pragma once
+
+#include
+#include
+
+//! Deps
+#include
+
+//! Our Headers
+#include "transaction.data.hpp"
+
+namespace mm2::api
+{
+ struct tx_history_request
+ {
+ std::string coin;
+ std::size_t limit;
+ };
+
+ void to_json(nlohmann::json& j, const tx_history_request& cfg);
+
+ struct sync_status_additional_error
+ {
+ std::string message;
+ int code;
+ };
+
+ void from_json(const nlohmann::json& j, sync_status_additional_error& answer);
+
+ struct sync_status_eth_erc_20_coins
+ {
+ std::size_t blocks_left;
+ };
+
+ void from_json(const nlohmann::json& j, sync_status_eth_erc_20_coins& answer);
+
+ struct sync_status_regular_coins
+ {
+ std::size_t transactions_left;
+ };
+
+ void from_json(const nlohmann::json& j, sync_status_regular_coins& answer);
+
+ struct sync_status_additional_infos
+ {
+ std::optional error; ///< in case of error
+ std::optional erc_infos; ///< eth/erc20 related coins
+ std::optional regular_infos; ///< kmd/btc/utxo related coins
+ };
+
+ void from_json(const nlohmann::json& j, sync_status_additional_infos& answer);
+
+ struct t_sync_status
+ {
+ std::string state; ///< NotEnabled, NotStarted, InProgress, Error, Finished
+ std::optional additional_info;
+ };
+
+ void from_json(const nlohmann::json& j, t_sync_status& answer);
+
+ struct tx_history_answer_success
+ {
+ std::string from_id;
+ std::size_t skipped;
+ std::size_t limit;
+ std::size_t current_block;
+ std::size_t total;
+ std::vector transactions;
+ t_sync_status sync_status;
+ };
+
+ void from_json(const nlohmann::json& j, tx_history_answer_success& answer);
+
+ struct tx_history_answer
+ {
+ std::optional error;
+ std::optional result;
+ std::string raw_result; ///< internal
+ int rpc_result_code; ///< internal
+ };
+
+ void from_json(const nlohmann::json& j, tx_history_answer& answer);
+} // namespace mm2::api
+
+namespace atomic_dex
+{
+ using t_tx_history_request = ::mm2::api::tx_history_request;
+}
\ No newline at end of file
diff --git a/src/core/atomicdex/api/mm2/rpc.update.maker.order.cpp b/src/core/atomicdex/api/mm2/rpc.update.maker.order.cpp
new file mode 100644
index 0000000000..12d8b83d46
--- /dev/null
+++ b/src/core/atomicdex/api/mm2/rpc.update.maker.order.cpp
@@ -0,0 +1,44 @@
+//
+// Created by Sztergbaum Roman on 18/05/2021.
+//
+
+//! Dependencies
+#include
+
+//! Project Headers
+#include
+
+namespace mm2::api
+{
+ void
+ to_json(nlohmann::json& j, const mm2::api::update_maker_order_request& request)
+ {
+ j["uuid"] = request.uuid;
+ j["new_price"] = request.new_price;
+ j["max"] = request.max;
+ if (request.volume_delta.has_value())
+ {
+ j["volume_delta"] = request.volume_delta.value();
+ }
+ if (request.min_volume.has_value())
+ {
+ j["min_volume"] = request.min_volume.value();
+ }
+ if (request.base_confs.has_value())
+ {
+ j["base_confs"] = request.base_confs.value();
+ }
+ if (request.base_nota.has_value())
+ {
+ j["base_nota"] = request.base_nota.value();
+ }
+ if (request.rel_confs.has_value())
+ {
+ j["rel_confs"] = request.rel_confs.value();
+ }
+ if (request.rel_nota.has_value())
+ {
+ j["rel_nota"] = request.rel_nota.value();
+ }
+ }
+} // namespace mm2::api
diff --git a/src/core/atomicdex/api/mm2/rpc.update.maker.order.hpp b/src/core/atomicdex/api/mm2/rpc.update.maker.order.hpp
new file mode 100644
index 0000000000..8b9f27b0da
--- /dev/null
+++ b/src/core/atomicdex/api/mm2/rpc.update.maker.order.hpp
@@ -0,0 +1,31 @@
+#pragma once
+
+//! STD
+#include
+#include
+
+//! Deps
+#include
+
+namespace mm2::api
+{
+ struct update_maker_order_request
+ {
+ std::string uuid;
+ std::string new_price;
+ std::optional volume_delta;
+ bool max{false};
+ std::optional min_volume;
+ std::optional base_nota;
+ std::optional base_confs;
+ std::optional rel_nota;
+ std::optional rel_confs;
+ };
+
+ void to_json(nlohmann::json& j, const update_maker_order_request& request);
+} // namespace mm2::api
+
+namespace atomic_dex
+{
+ using t_update_maker_order_request = ::mm2::api::update_maker_order_request;
+}
\ No newline at end of file
diff --git a/src/core/atomicdex/api/mm2/rpc.validate.address.cpp b/src/core/atomicdex/api/mm2/rpc.validate.address.cpp
new file mode 100644
index 0000000000..da74be26b9
--- /dev/null
+++ b/src/core/atomicdex/api/mm2/rpc.validate.address.cpp
@@ -0,0 +1,33 @@
+//
+// Created by Sztergbaum Roman on 22/05/2021.
+//
+
+#include
+
+#include "atomicdex/api/mm2/rpc.validate.address.hpp"
+#include "atomicdex/api/mm2/generics.hpp"
+
+namespace mm2::api
+{
+ void
+ to_json(nlohmann::json& j, const mm2::api::validate_address_request& req)
+ {
+ j["coin"] = req.coin;
+ j["address"] = req.address;
+ }
+
+ void
+ from_json(const nlohmann::json& j, validate_address_answer_success& answer)
+ {
+ j.at("is_valid").get_to(answer.is_valid);
+ if (j.contains("reason"))
+ {
+ answer.reason = j.at("reason").get();
+ }
+ }
+ void
+ from_json(const nlohmann::json& j, validate_address_answer& answer)
+ {
+ extract_rpc_json_answer(j, answer);
+ }
+} // namespace mm2::api
diff --git a/src/core/atomicdex/api/mm2/rpc.validate.address.hpp b/src/core/atomicdex/api/mm2/rpc.validate.address.hpp
new file mode 100644
index 0000000000..00d6bd5221
--- /dev/null
+++ b/src/core/atomicdex/api/mm2/rpc.validate.address.hpp
@@ -0,0 +1,43 @@
+#pragma once
+
+#include
+#include
+
+//! Deps
+#include
+
+namespace mm2::api
+{
+ struct validate_address_request
+ {
+ std::string coin;
+ std::string address;
+ };
+
+ void to_json(nlohmann::json& j, const validate_address_request& req);
+
+ struct validate_address_answer_success
+ {
+ bool is_valid;
+ std::optional reason;
+ };
+
+ void from_json(const nlohmann::json& j, validate_address_answer_success& answer);
+
+ struct validate_address_answer
+ {
+ std::optional result;
+ std::optional error;
+ std::string raw_result; ///< internal
+ int rpc_result_code; ///< internal
+ };
+
+ void from_json(const nlohmann::json& j, validate_address_answer& answer);
+} // namespace mm2::api
+
+namespace atomic_dex
+{
+ using t_validate_address_request = ::mm2::api::validate_address_request;
+ using t_validate_address_answer = ::mm2::api::validate_address_answer;
+ using t_validate_address_answer_success = ::mm2::api::validate_address_answer_success;
+} // namespace atomic_dex
\ No newline at end of file
diff --git a/src/core/atomicdex/api/mm2/rpc.withdraw.cpp b/src/core/atomicdex/api/mm2/rpc.withdraw.cpp
new file mode 100644
index 0000000000..fbbb291aa0
--- /dev/null
+++ b/src/core/atomicdex/api/mm2/rpc.withdraw.cpp
@@ -0,0 +1,75 @@
+//
+// Created by Sztergbaum Roman on 08/06/2021.
+//
+
+//! Deps
+#include
+
+//! Our Headers
+#include "rpc.withdraw.hpp"
+
+namespace mm2::api
+{
+ void
+ to_json(nlohmann::json& j, const withdraw_fees& cfg)
+ {
+ j["type"] = cfg.type;
+ if (cfg.type == "EthGas")
+ {
+ j["gas"] = cfg.gas_limit.value_or(55000);
+ j["gas_price"] = cfg.gas_price.value();
+ }
+ else if (cfg.type == "Qrc20Gas")
+ {
+ j["gas_limit"] = cfg.gas_limit.value_or(40);
+ j["gas_price"] = std::stoi(cfg.gas_price.value());
+ }
+ else
+ {
+ j["amount"] = cfg.amount.value();
+ }
+ }
+
+ void
+ to_json(nlohmann::json& j, const withdraw_request& cfg)
+ {
+ nlohmann::json obj = nlohmann::json::object();
+
+ obj["coin"] = cfg.coin;
+ obj["amount"] = cfg.amount;
+ obj["to"] = cfg.to;
+ obj["max"] = cfg.max;
+ if (cfg.fees.has_value())
+ {
+ obj["fee"] = cfg.fees.value();
+ }
+ if (j.contains("mmrpc") && j.at("mmrpc").get() == "2.0")
+ {
+ j["params"] = obj;
+ }
+ else
+ {
+ j.update(obj);
+ }
+ }
+
+ void
+ from_json(const nlohmann::json& j, withdraw_answer& answer)
+ {
+ if (j.count("error") >= 1)
+ {
+ answer.error = j;
+ }
+ else
+ {
+ if (j.contains("result") && j.contains("mmrpc") && j.at("mmrpc").get() == "2.0")
+ {
+ answer.result = j.at("result").get();
+ }
+ else
+ {
+ answer.result = j.get();
+ }
+ }
+ }
+} // namespace mm2::api
\ No newline at end of file
diff --git a/src/core/atomicdex/api/mm2/rpc.withdraw.hpp b/src/core/atomicdex/api/mm2/rpc.withdraw.hpp
new file mode 100644
index 0000000000..6dcf08c575
--- /dev/null
+++ b/src/core/atomicdex/api/mm2/rpc.withdraw.hpp
@@ -0,0 +1,52 @@
+#pragma once
+
+#include
+#include
+
+//! Deps
+#include
+
+//! Our Headers
+#include "atomicdex/api/mm2/generic.error.hpp"
+#include "atomicdex/api/mm2/transaction.data.hpp"
+
+namespace mm2::api
+{
+ struct withdraw_fees
+ {
+ std::string type; ///< UtxoFixed, UtxoPerKbyte, EthGas, Qrc20Gas
+ std::optional amount; ///< Utxo only
+ std::optional gas_price; ///< price EthGas or Qrc20Gas
+ std::optional gas_limit; ///< sets the gas limit for transaction
+ };
+
+ void to_json(nlohmann::json& j, const withdraw_fees& cfg);
+
+ struct withdraw_request
+ {
+ std::string coin;
+ std::string to; ///< coins will be withdraw to this address
+ std::string amount; ///< ignored if max is true
+ std::optional fees{std::nullopt}; ///< ignored if std::nullopt
+ bool max{false};
+ };
+
+ void to_json(nlohmann::json& j, const withdraw_request& cfg);
+
+ struct withdraw_answer
+ {
+ std::optional result;
+ std::optional error;
+ std::string raw_result; ///< internal
+ int rpc_result_code; ///< internal
+ };
+
+ void from_json(const nlohmann::json& j, withdraw_answer& answer);
+} // namespace mm2::api
+
+namespace atomic_dex
+{
+ using t_withdraw_request = ::mm2::api::withdraw_request;
+ using t_withdraw_fees = ::mm2::api::withdraw_fees;
+ using t_withdraw_answer = ::mm2::api::withdraw_answer;
+} // namespace atomic_dex
\ No newline at end of file
diff --git a/src/core/atomicdex/api/mm2/transaction.data.cpp b/src/core/atomicdex/api/mm2/transaction.data.cpp
new file mode 100644
index 0000000000..ab7e17c1f8
--- /dev/null
+++ b/src/core/atomicdex/api/mm2/transaction.data.cpp
@@ -0,0 +1,87 @@
+//
+// Created by Sztergbaum Roman on 08/06/2021.
+//
+
+//! Deps
+#include
+
+//! Our Headers
+#include "atomicdex/api/mm2/transaction.data.hpp"
+#include "atomicdex/utilities/global.utilities.hpp"
+
+namespace mm2::api
+{
+ void
+ from_json(const nlohmann::json& j, fee_regular_coin& cfg)
+ {
+ j.at("amount").get_to(cfg.amount);
+ }
+
+ void
+ from_json(const nlohmann::json& j, fee_erc_coin& cfg)
+ {
+ j.at("coin").get_to(cfg.coin);
+ j.at("gas").get_to(cfg.gas);
+ j.at("gas_price").get_to(cfg.gas_price);
+ j.at("total_fee").get_to(cfg.total_fee);
+ }
+
+ void
+ from_json(const nlohmann::json& j, fee_qrc_coin& cfg)
+ {
+ j.at("coin").get_to(cfg.coin);
+ j.at("gas_limit").get_to(cfg.gas_limit);
+ j.at("gas_price").get_to(cfg.gas_price);
+ j.at("miner_fee").get_to(cfg.miner_fee);
+ j.at("total_gas_fee").get_to(cfg.total_gas_fee);
+ }
+
+ void
+ from_json(const nlohmann::json& j, fees_data& cfg)
+ {
+ if (j.count("amount") == 1)
+ {
+ cfg.normal_fees = fee_regular_coin{};
+ from_json(j, cfg.normal_fees.value());
+ }
+ else if (auto coin = j.at("coin").get(); coin == "ETH" || coin == "BNB" || coin == "BNBT" || coin == "ETHR")
+ {
+ cfg.erc_fees = fee_erc_coin{};
+ from_json(j, cfg.erc_fees.value());
+ }
+ else if (j.at("coin").get() == "QTUM" || j.at("coin").get() == "tQTUM")
+ {
+ cfg.qrc_fees = fee_qrc_coin{};
+ from_json(j, cfg.qrc_fees.value());
+ }
+ }
+
+ void
+ from_json(const nlohmann::json& j, transaction_data& cfg)
+ {
+ j.at("block_height").get_to(cfg.block_height);
+ j.at("coin").get_to(cfg.coin);
+ if (j.contains("confirmations"))
+ {
+ cfg.confirmations = j.at("confirmations").get();
+ }
+ j.at("fee_details").get_to(cfg.fee_details);
+ j.at("from").get_to(cfg.from);
+ if (cfg.from.empty() && cfg.coin == "FIRO")
+ {
+ cfg.from.emplace_back("Lelantusjsplit (Hidden)");
+ }
+ j.at("internal_id").get_to(cfg.internal_id);
+ j.at("my_balance_change").get_to(cfg.my_balance_change);
+ j.at("received_by_me").get_to(cfg.received_by_me);
+ j.at("spent_by_me").get_to(cfg.spent_by_me);
+ j.at("timestamp").get_to(cfg.timestamp);
+ j.at("to").get_to(cfg.to);
+ j.at("total_amount").get_to(cfg.total_amount);
+ j.at("tx_hash").get_to(cfg.tx_hash);
+ j.at("tx_hex").get_to(cfg.tx_hex);
+
+ std::string s = atomic_dex::utils::to_human_date(cfg.timestamp, "%e %b %Y, %H:%M");
+ cfg.timestamp_as_date = std::move(s);
+ }
+} // namespace mm2::api
\ No newline at end of file
diff --git a/src/core/atomicdex/api/mm2/transaction.data.hpp b/src/core/atomicdex/api/mm2/transaction.data.hpp
new file mode 100644
index 0000000000..dfb844ceaa
--- /dev/null
+++ b/src/core/atomicdex/api/mm2/transaction.data.hpp
@@ -0,0 +1,68 @@
+#pragma once
+
+#include
+#include
+
+//! Deps
+#include
+
+namespace mm2::api
+{
+ struct fee_regular_coin
+ {
+ std::string amount;
+ };
+
+ void from_json(const nlohmann::json& j, fee_regular_coin& cfg);
+
+ struct fee_erc_coin
+ {
+ std::string coin;
+ std::size_t gas;
+ std::string gas_price;
+ std::string total_fee;
+ };
+
+ void from_json(const nlohmann::json& j, fee_erc_coin& cfg);
+
+ struct fee_qrc_coin
+ {
+ std::string coin;
+ std::string miner_fee;
+ std::size_t gas_limit;
+ std::size_t gas_price;
+ std::string total_gas_fee;
+ };
+
+ void from_json(const nlohmann::json& j, fee_qrc_coin& cfg);
+
+ struct fees_data
+ {
+ std::optional normal_fees; ///< btc, kmd based coins
+ std::optional erc_fees; ///< eth based coins
+ std::optional qrc_fees; // Qtum based coin
+ };
+
+ void from_json(const nlohmann::json& j, fees_data& cfg);
+
+ struct transaction_data
+ {
+ std::size_t timestamp;
+ std::vector from;
+ std::vector to;
+ fees_data fee_details;
+ std::optional confirmations;
+ std::string coin;
+ std::size_t block_height;
+ std::string internal_id;
+ std::string spent_by_me;
+ std::string received_by_me;
+ std::string my_balance_change;
+ std::string total_amount;
+ std::string tx_hash;
+ std::string tx_hex;
+ std::string timestamp_as_date; ///< human readeable timestamp
+ };
+
+ void from_json(const nlohmann::json& j, transaction_data& cfg);
+}
\ No newline at end of file
diff --git a/src/core/atomicdex/config/addressbook.cfg.cpp b/src/core/atomicdex/config/addressbook.cfg.cpp
index 6678221360..8f01d08d98 100644
--- a/src/core/atomicdex/config/addressbook.cfg.cpp
+++ b/src/core/atomicdex/config/addressbook.cfg.cpp
@@ -13,42 +13,44 @@
* Removal or modification of this copyright notice is prohibited. *
* *
******************************************************************************/
-
-//! STD
-#include //> std::fstream, std::ifstream, std::ofstream.
+
+//! Qt
+#include
//! Project Headers
#include "addressbook.cfg.hpp"
#include "atomicdex/utilities/global.utilities.hpp"
+#include "atomicdex/utilities/qt.utilities.hpp"
namespace atomic_dex
{
nlohmann::json load_addressbook_cfg(const std::string& wallet_name)
{
- const fs::path source_folder{utils::get_atomic_dex_addressbook_folder()};
- const fs::path in_path {source_folder / wallet_name};
- std::fstream input;
+ const fs::path source_folder{utils::get_atomic_dex_addressbook_folder()};
+ const fs::path in_path {source_folder / wallet_name};
+ QFile ifs;
+ QString content;
nlohmann::json out;
utils::create_if_doesnt_exist(source_folder);
{
- //! Creates file if it does not exist.
- if (!std::ifstream(in_path.string()))
- {
- input.open(in_path.string(), std::ios::out);
- assert(input.is_open());
- input.close();
- assert(!input.is_open());
- }
- input.open(in_path.string(), std::ios::in);
- assert(input.is_open());
+ ifs.setFileName(std_path_to_qstring(in_path));
try
{
- input >> out;
+ ifs.open(QIODevice::ReadOnly | QIODevice::Text);
+ content = ifs.readAll();
+ ifs.close();
+ out = nlohmann::json::parse(content.toStdString());
+ SPDLOG_INFO("Addressbook configuration file read.");
}
catch ([[maybe_unused]] nlohmann::json::parse_error& ex)
{
- //spdlog::warn("Addressbook config file was invalid, its content will be cleaned.");
+ SPDLOG_WARN("Addressbook config file was invalid, use empty configuration: {}. Content was: {}", ex.what(), content.toStdString());
+ out = nlohmann::json::array();
+ }
+ catch (std::exception& ex)
+ {
+ SPDLOG_ERROR(ex.what());
out = nlohmann::json::array();
}
return out;
@@ -59,13 +61,21 @@ namespace atomic_dex
{
const fs::path out_folder{utils::get_atomic_dex_addressbook_folder()};
const fs::path out_path {out_folder / wallet_name};
- std::ofstream output;
-
- utils::create_if_doesnt_exist(out_path);
+ QFile output;
+
+ utils::create_if_doesnt_exist(out_folder);
{
- output.open(out_path.string(), std::ios::trunc);
- assert(output.is_open());
- output << in;
+ output.setFileName(std_path_to_qstring(out_path));
+ try
+ {
+ output.open(QIODevice::WriteOnly | QIODevice::Truncate | QIODevice::Text);
+ output.write(QString::fromStdString(in.dump()).toUtf8());
+ SPDLOG_INFO("Addressbook data successfully wrote in persistent data !");
+ }
+ catch (std::exception& ex)
+ {
+ SPDLOG_ERROR(ex.what());
+ }
}
}
}
\ No newline at end of file
diff --git a/src/core/atomicdex/config/app.cfg.cpp b/src/core/atomicdex/config/app.cfg.cpp
index 41cd3af7f6..693c84887f 100644
--- a/src/core/atomicdex/config/app.cfg.cpp
+++ b/src/core/atomicdex/config/app.cfg.cpp
@@ -14,8 +14,9 @@
* *
******************************************************************************/
-//! STD
-#include
+//! Qt
+#include
+#include
//! Deps
#include
@@ -25,18 +26,21 @@
//! Project Header
#include "atomicdex/config/app.cfg.hpp"
#include "atomicdex/utilities/global.utilities.hpp"
+#include "atomicdex/utilities/qt.utilities.hpp"
namespace
{
void
upgrade_cfg(atomic_dex::cfg& config)
{
- fs::path cfg_path = atomic_dex::utils::get_current_configs_path() / "cfg.json";
- std::ifstream ifs(cfg_path.string());
+ fs::path cfg_path = atomic_dex::utils::get_current_configs_path() / "cfg.json";
+ QFile file;
+ file.setFileName(atomic_dex::std_path_to_qstring(cfg_path));
+ file.open(QIODevice::ReadOnly | QIODevice::Text);
nlohmann::json config_json_data;
- assert(ifs.is_open());
- ifs >> config_json_data;
+ QString val = file.readAll();
+ config_json_data = nlohmann::json::parse(val.toStdString());
config_json_data["current_currency"] = config.current_currency;
config_json_data["current_fiat"] = config.current_fiat;
config_json_data["possible_currencies"] = config.possible_currencies;
@@ -45,12 +49,12 @@ namespace
config_json_data["available_signs"] = config.available_currency_signs;
config_json_data["notification_enabled"] = config.notification_enabled;
- ifs.close();
+ file.close();
//! Write contents
- std::ofstream ofs(cfg_path.string(), std::ios::trunc);
- assert(ofs.is_open());
- ofs << config_json_data;
+ file.open(QIODevice::WriteOnly | QIODevice::Text | QIODevice::Truncate);
+ file.write(QString::fromStdString(config_json_data.dump()).toUtf8());
+ file.close();
}
} // namespace
@@ -88,22 +92,24 @@ namespace atomic_dex
{
fs::path original_cfg_path{ag::core::assets_real_path() / "config" / "cfg.json"};
//! Copy our json to current version
- SPDLOG_INFO("Copying app cfg: {} to {}", original_cfg_path.string(), cfg_path.string());
-
+ LOG_PATH_CMP("Copying app cfg: {} to {}", original_cfg_path, cfg_path);
fs::copy_file(original_cfg_path, cfg_path, get_override_options());
}
- std::ifstream ifs(cfg_path.string());
- nlohmann::json config_json_data;
- assert(ifs.is_open());
- ifs >> config_json_data;
+ QFile file;
+ file.setFileName(std_path_to_qstring(cfg_path));
+ file.open(QIODevice::ReadOnly | QIODevice::Text);
+ QString val = file.readAll();
+ file.close();
+
+ nlohmann::json config_json_data = nlohmann::json::parse(val.toStdString());
from_json(config_json_data, out);
return out;
}
bool
- is_this_currency_a_fiat(const cfg& config, const std::string& currency)
+ is_this_currency_a_fiat(const cfg& config, const std::string& currency)
{
return ranges::any_of(config.available_fiat, [currency](const std::string& current_fiat) { return current_fiat == currency; });
}
@@ -134,7 +140,7 @@ namespace atomic_dex
}
std::string
- retrieve_sign_from_ticker(const cfg& config, const std::string& currency)
+ retrieve_sign_from_ticker(const cfg& config, const std::string& currency)
{
#if defined(__linux__)
if (currency == "BTC")
diff --git a/src/core/atomicdex/config/coins.cfg.cpp b/src/core/atomicdex/config/coins.cfg.cpp
index cd0a17aef4..0f996e35e9 100644
--- a/src/core/atomicdex/config/coins.cfg.cpp
+++ b/src/core/atomicdex/config/coins.cfg.cpp
@@ -62,6 +62,13 @@ namespace atomic_dex
cfg.is_custom_coin = true;
}
+ if (j.contains("is_segwit_on"))
+ {
+ cfg.segwit = true;
+ j.at("is_segwit_on").get_to(cfg.is_segwit_on);
+ SPDLOG_INFO("coin: {} support segwit with current_segwit mode: {}", cfg.ticker, cfg.is_segwit_on);
+ }
+
j.at("explorer_url").get_to(cfg.explorer_url);
if (j.contains("explorer_tx_url"))
{
diff --git a/src/core/atomicdex/config/coins.cfg.hpp b/src/core/atomicdex/config/coins.cfg.hpp
index 4256238471..b2c96281f9 100644
--- a/src/core/atomicdex/config/coins.cfg.hpp
+++ b/src/core/atomicdex/config/coins.cfg.hpp
@@ -61,6 +61,8 @@ namespace atomic_dex
bool wallet_only{false};
bool has_parent_fees_ticker{false}; ///< True if parent fees is different from current ticker eg: ERC20 tokens
std::string fees_ticker;
+ bool segwit{false};
+ bool is_segwit_on{false};
};
void from_json(const nlohmann::json& j, coin_config& cfg);
diff --git a/src/core/atomicdex/config/raw.mm2.coins.cfg.hpp b/src/core/atomicdex/config/raw.mm2.coins.cfg.hpp
index 57ce6fa18f..78a65a8383 100644
--- a/src/core/atomicdex/config/raw.mm2.coins.cfg.hpp
+++ b/src/core/atomicdex/config/raw.mm2.coins.cfg.hpp
@@ -1,5 +1,9 @@
#pragma once
+//! Qt
+#include
+#include
+
//! Deps
#include
#include
@@ -8,6 +12,7 @@
#include "atomicdex/api/mm2/mm2.constants.hpp"
#include "atomicdex/utilities/fs.prerequisites.hpp"
#include "atomicdex/utilities/global.utilities.hpp"
+#include "atomicdex/utilities/qt.utilities.hpp"
#ifndef NLOHMANN_OPT_HELPER
# define NLOHMANN_OPT_HELPER
@@ -229,30 +234,37 @@ namespace atomic_dex
inline t_mm2_raw_coins_registry
parse_raw_mm2_coins_file()
{
+ SPDLOG_INFO("parse_raw_mm2_coins_file");
t_mm2_raw_coins_registry out;
fs::path file_path{atomic_dex::utils::get_current_configs_path() / "coins.json"};
if (not fs::exists(file_path))
{
fs::path original_mm2_coins_path{ag::core::assets_real_path() / "tools" / "mm2" / "coins"};
//! Copy our json to current version
- SPDLOG_INFO("Copying mm2 coins cfg: {} to {}", original_mm2_coins_path.string(), file_path.string());
+ LOG_PATH_CMP("Copying mm2 coins cfg: {} to {}", original_mm2_coins_path, file_path);
fs::copy_file(original_mm2_coins_path, file_path, get_override_options());
}
- std::ifstream ifs(file_path.string());
- assert(ifs.is_open());
+
+ QFile file;
+ file.setFileName(std_path_to_qstring(file_path));
+ file.open(QIODevice::ReadOnly | QIODevice::Text);
+ QString val = file.readAll();
+ file.close();
+
try
{
- nlohmann::json j;
- ifs >> j;
+ nlohmann::json j = nlohmann::json::parse(val.toStdString());
+ //ifs >> j;
t_mm2_raw_coins coins = j;
out.reserve(coins.size());
for (auto&& coin: coins) { out[coin.coin] = coin; }
- SPDLOG_INFO("successfully parsed: {}, nb_coins: {}", file_path.string(), out.size());
+ LOG_PATH("successfully parsed: {}", file_path);
+ SPDLOG_INFO("coins size mm2: {}", coins.size());
}
catch (const std::exception& error)
{
- SPDLOG_ERROR("cannot parse mm2 raw cfg file: {} {}", file_path.string(), error.what());
+ LOG_PATH("cannot parse mm2 raw cfg file: {}", file_path);
}
return out;
}
diff --git a/src/core/atomicdex/constants/qt.trading.enums.hpp b/src/core/atomicdex/constants/qt.trading.enums.hpp
index f8103bc141..01efb63d21 100644
--- a/src/core/atomicdex/constants/qt.trading.enums.hpp
+++ b/src/core/atomicdex/constants/qt.trading.enums.hpp
@@ -68,8 +68,28 @@ namespace atomic_dex
private:
explicit TradingErrorGadget();
};
+
+ class ENTT_API SelectedOrderGadget
+ {
+ Q_GADGET
+
+ public:
+ enum SelectedOrderStatus
+ {
+ None = 0, /// The selected order is at the initial state
+ DataChanged = 1, ///< One of the data has changed (volume,price,min_volume...)
+ BetterPriceAvailable = 2, ///< if a asks order have a better price than the selected one
+ OrderNotExistingAnymore = 3 ///< The order has been cancelled or matched
+ };
+
+ Q_ENUM(SelectedOrderStatus)
+
+ private:
+ explicit SelectedOrderGadget();
+ };
} // namespace atomic_dex
-using MarketMode = atomic_dex::MarketModeGadget::MarketModeEnum;
-using TradingError = atomic_dex::TradingErrorGadget::TradingErrorEnum;
-using TradingMode = atomic_dex::TradingModeGadget::TradingModeEnum;
+using MarketMode = atomic_dex::MarketModeGadget::MarketModeEnum;
+using TradingError = atomic_dex::TradingErrorGadget::TradingErrorEnum;
+using TradingMode = atomic_dex::TradingModeGadget::TradingModeEnum;
+using SelectedOrderStatus = atomic_dex::SelectedOrderGadget::SelectedOrderStatus;
\ No newline at end of file
diff --git a/src/core/atomicdex/managers/qt.wallet.manager.cpp b/src/core/atomicdex/managers/qt.wallet.manager.cpp
index 9f158f1e5e..6c29772b69 100644
--- a/src/core/atomicdex/managers/qt.wallet.manager.cpp
+++ b/src/core/atomicdex/managers/qt.wallet.manager.cpp
@@ -16,6 +16,7 @@
//! Qt
#include
+#include
//! Deps
#include
@@ -27,13 +28,13 @@
namespace atomic_dex
{
QString
- qt_wallet_manager::get_wallet_default_name() const
+ qt_wallet_manager::get_wallet_default_name() const
{
return m_current_default_wallet;
}
void
- qt_wallet_manager::set_wallet_default_name(QString wallet_name)
+ qt_wallet_manager::set_wallet_default_name(QString wallet_name)
{
using namespace std::string_literals;
if (wallet_name == "")
@@ -41,18 +42,15 @@ namespace atomic_dex
fs::remove(utils::get_atomic_dex_config_folder() / "default.wallet");
return;
}
- if (not fs::exists(utils::get_atomic_dex_config_folder() / "default.wallet"s))
- {
- std::ofstream ofs((utils::get_atomic_dex_config_folder() / "default.wallet"s).string());
- ofs << wallet_name.toStdString();
- }
- else
- {
- std::ofstream ofs((utils::get_atomic_dex_config_folder() / "default.wallet"s).string(), std::ios_base::out | std::ios_base::trunc);
- ofs << wallet_name.toStdString();
- }
+ fs::path path = (utils::get_atomic_dex_config_folder() / "default.wallet"s);
+ QFile out;
+ out.setFileName(std_path_to_qstring(path));
+ out.open(QIODevice::WriteOnly | QIODevice::Text | QIODevice::Truncate);
+ out.write(wallet_name.toUtf8());
+ out.close();
this->m_current_default_wallet = std::move(wallet_name);
+ SPDLOG_INFO("new wallet name: {}", wallet_name.toStdString());
emit onWalletDefaultNameChanged();
}
@@ -90,12 +88,17 @@ namespace atomic_dex
// sodium_memzero(&seed, seed.size());
sodium_memzero(key.data(), key.size());
- std::ofstream wallet_object(wallet_object_path.string());
+ QFile wallet_object;
+ wallet_object.setFileName(std_path_to_qstring(wallet_object_path));
+ wallet_object.open(QIODevice::Text | QIODevice::WriteOnly | QIODevice::Truncate);
+
nlohmann::json wallet_object_json;
wallet_object_json["name"] = wallet_name.toStdString();
- wallet_object << wallet_object_json.dump(4);
+ wallet_object.write(QString::fromStdString(wallet_object_json.dump(4)).toUtf8());
wallet_object.close();
+ LOG_PATH("Successfully write file: {}", wallet_object_path);
+ SPDLOG_INFO("Successfully write the data: {}", wallet_object_json.dump());
return true;
}
@@ -103,7 +106,7 @@ namespace atomic_dex
}
QStringList
- qt_wallet_manager::get_wallets()
+ qt_wallet_manager::get_wallets()
{
QStringList out;
@@ -121,26 +124,30 @@ namespace atomic_dex
}
bool
- qt_wallet_manager::is_there_a_default_wallet()
+ qt_wallet_manager::is_there_a_default_wallet()
{
return fs::exists(utils::get_atomic_dex_config_folder() / "default.wallet");
}
QString
- qt_wallet_manager::get_default_wallet_name()
+ qt_wallet_manager::get_default_wallet_name()
{
if (is_there_a_default_wallet())
{
- std::ifstream ifs((utils::get_atomic_dex_config_folder() / "default.wallet").c_str());
- assert(ifs);
- std::string str((std::istreambuf_iterator(ifs)), std::istreambuf_iterator());
- return QString::fromStdString(str);
+ QFile ifs;
+ fs::path path = (utils::get_atomic_dex_config_folder() / "default.wallet");
+ ifs.setFileName(std_path_to_qstring(path));
+ ifs.open(QIODevice::ReadOnly | QIODevice::Text);
+ QString out = ifs.readAll();
+ ifs.close();
+ SPDLOG_INFO("Retrieve wallet name: {}", out.toStdString());
+ return out;
}
return "nonexistent";
}
bool
- qt_wallet_manager::delete_wallet(const QString& wallet_name)
+ qt_wallet_manager::delete_wallet(const QString& wallet_name)
{
using namespace std::string_literals;
return fs::remove(utils::get_atomic_dex_config_folder() / (wallet_name.toStdString() + ".seed"s));
@@ -176,16 +183,18 @@ namespace atomic_dex
SPDLOG_INFO("Loading wallet configuration: {}", wallet_name);
using namespace std::string_literals;
const fs::path wallet_object_path = utils::get_atomic_dex_export_folder() / (wallet_name + ".wallet.json"s);
- std::ifstream ifs(wallet_object_path.string());
+ QFile ifs;
+ ifs.setFileName(std_path_to_qstring(wallet_object_path));
+ ifs.open(QIODevice::ReadOnly | QIODevice::Text);
- if (not ifs.is_open())
+ if (not ifs.isOpen())
{
- SPDLOG_ERROR("Cannot open: {}", wallet_object_path.string());
+ LOG_PATH("Cannot open: {}", wallet_object_path);
return false;
}
- nlohmann::json j;
- ifs >> j;
+ nlohmann::json j = nlohmann::json::parse(QString(ifs.readAll()).toStdString());
m_wallet_cfg = j;
+ //SPDLOG_INFO("wallet_cfg: {}", j.dump(4));
return true;
}
@@ -197,19 +206,24 @@ namespace atomic_dex
}
bool
- qt_wallet_manager::update_wallet_cfg()
+ qt_wallet_manager::update_wallet_cfg()
{
+ SPDLOG_INFO("update_wallet_cfg");
using namespace std::string_literals;
const fs::path wallet_object_path = utils::get_atomic_dex_export_folder() / (m_wallet_cfg.name + ".wallet.json"s);
- std::ofstream ofs(wallet_object_path.string(), std::ios::trunc);
- if (not ofs.is_open())
+ QFile ofs;
+ ofs.setFileName(std_path_to_qstring(wallet_object_path));
+ ofs.open(QIODevice::WriteOnly | QIODevice::Truncate | QIODevice::Text);
+
+ if (not ofs.isOpen())
{
return false;
}
nlohmann::json j;
atomic_dex::to_json(j, m_wallet_cfg);
- ofs << j.dump(4);
+ ofs.write(QString::fromStdString(j.dump(4)).toUtf8());
+ ofs.close();
return true;
}
@@ -228,7 +242,7 @@ namespace atomic_dex
}
void
- qt_wallet_manager::update()
+ qt_wallet_manager::update()
{
//! Disabled system
}
@@ -314,13 +328,13 @@ namespace atomic_dex
}
QString
- qt_wallet_manager::get_status() const
+ qt_wallet_manager::get_status() const
{
return m_current_status;
}
void
- qt_wallet_manager::set_status(QString status)
+ qt_wallet_manager::set_status(QString status)
{
this->m_current_status = std::move(status);
emit onStatusChanged();
@@ -333,13 +347,13 @@ namespace atomic_dex
}
bool
- qt_wallet_manager::log_status() const
+ qt_wallet_manager::log_status() const
{
return m_login_status;
}
void
- qt_wallet_manager::set_log_status(bool status)
+ qt_wallet_manager::set_log_status(bool status)
{
m_login_status = status;
}
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 888d40f187..5319d11231 100644
--- a/src/core/atomicdex/models/qt.global.coins.cfg.model.cpp
+++ b/src/core/atomicdex/models/qt.global.coins.cfg.model.cpp
@@ -39,7 +39,10 @@ namespace
{"tx_uri", QString::fromStdString(coin.tx_uri)},
{"address_uri", QString::fromStdString(coin.address_url)},
{"is_custom_coin", coin.is_custom_coin},
- {"is_enabled", coin.currently_enabled}};
+ {"is_enabled", coin.currently_enabled},
+ {"has_parent_fees_ticker", coin.has_parent_fees_ticker},
+ {"is_testnet", coin.is_testnet.value_or(false)},
+ {"fees_ticker", QString::fromStdString(coin.fees_ticker)}};
return j;
}
} // namespace
@@ -299,6 +302,12 @@ namespace atomic_dex
return m_proxies[CoinType::ERC20];
}
+ global_coins_cfg_proxy_model*
+ global_coins_cfg_model::get_all_bep20_proxy() const
+ {
+ return m_proxies[CoinType::BEP20];
+ }
+
global_coins_cfg_proxy_model*
global_coins_cfg_model::get_all_smartchains_proxy() const
{
@@ -363,4 +372,11 @@ namespace atomic_dex
{
return m_enabled_coins;
}
+
+ QString
+ global_coins_cfg_model::get_parent_coin(const QString& ticker) const
+ {
+ auto cfg = get_coin_info(ticker.toStdString());
+ return QString::fromStdString(cfg.fees_ticker);
+ }
} // namespace atomic_dex
\ No newline at end of file
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 2a97921bf3..e14f5bc208 100644
--- a/src/core/atomicdex/models/qt.global.coins.cfg.model.hpp
+++ b/src/core/atomicdex/models/qt.global.coins.cfg.model.hpp
@@ -20,7 +20,7 @@
#include
//! Absl
-//TODO: When absl fix std::result_of switch to flat_hash_map
+// TODO: When absl fix std::result_of switch to flat_hash_map
#include
//#include
@@ -38,7 +38,7 @@ namespace atomic_dex
{
// Tells QT this class uses signal/slots mechanisms and/or has GUI elements.
Q_OBJECT
-
+
using t_enabled_coins_registry = std::unordered_map;
public:
@@ -60,13 +60,13 @@ namespace atomic_dex
Q_ENUMS(CoinsRoles)
// Constructor/Destructor
- explicit global_coins_cfg_model(entt::registry& entity_registry, QObject* parent = nullptr) ;
- ~global_coins_cfg_model() final = default;
+ explicit global_coins_cfg_model(entt::registry& entity_registry, QObject* parent = nullptr);
+ ~global_coins_cfg_model() final = default;
- void initialize_model(std::vector cfg) ;
+ void initialize_model(std::vector cfg);
template
- void update_status(const TArray& tickers, bool status) ;
+ void update_status(const TArray& tickers, bool status);
// QAbstractListModel functions
[[nodiscard]] QVariant data(const QModelIndex& index, int role) const final;
@@ -75,57 +75,61 @@ namespace atomic_dex
[[nodiscard]] QHash roleNames() const final;
// Getters/Setters
- [[nodiscard]] const std::vector& get_model_data() const ;
- [[nodiscard]] coin_config get_coin_info(const std::string& ticker) const ;
- [[nodiscard]] t_enabled_coins_registry get_enabled_coins() const ;
- [[nodiscard]] global_coins_cfg_proxy_model* get_all_disabled_proxy() const ;
- [[nodiscard]] global_coins_cfg_proxy_model* get_all_proxy() const ;
- [[nodiscard]] global_coins_cfg_proxy_model* get_all_qrc20_proxy() const ;
- [[nodiscard]] global_coins_cfg_proxy_model* get_all_erc20_proxy() const ;
- [[nodiscard]] global_coins_cfg_proxy_model* get_all_smartchains_proxy() const ;
- [[nodiscard]] global_coins_cfg_proxy_model* get_all_utxo_proxy() const ;
- [[nodiscard]] int get_length() const ;
- [[nodiscard]] int get_checked_nb() const ;
- void set_checked_nb(int value) ;
- [[nodiscard]] const QStringList& get_all_coin_types() const ;
+ [[nodiscard]] const std::vector& get_model_data() const;
+ [[nodiscard]] coin_config get_coin_info(const std::string& ticker) const;
+ [[nodiscard]] t_enabled_coins_registry get_enabled_coins() const;
+ [[nodiscard]] global_coins_cfg_proxy_model* get_all_disabled_proxy() const;
+ [[nodiscard]] global_coins_cfg_proxy_model* get_all_proxy() const;
+ [[nodiscard]] global_coins_cfg_proxy_model* get_all_qrc20_proxy() const;
+ [[nodiscard]] global_coins_cfg_proxy_model* get_all_erc20_proxy() const;
+ [[nodiscard]] global_coins_cfg_proxy_model* get_all_bep20_proxy() const;
+ [[nodiscard]] global_coins_cfg_proxy_model* get_all_smartchains_proxy() const;
+ [[nodiscard]] global_coins_cfg_proxy_model* get_all_utxo_proxy() const;
+ [[nodiscard]] int get_length() const;
+ [[nodiscard]] int get_checked_nb() const;
+ void set_checked_nb(int value);
+ [[nodiscard]] const QStringList& get_all_coin_types() const;
// QML API functions
- Q_INVOKABLE QStringList get_checked_coins() const ;
- Q_INVOKABLE QVariant get_coin_info(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 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)
// QML API properties
- Q_PROPERTY(global_coins_cfg_proxy_model* all_disabled_proxy READ get_all_disabled_proxy NOTIFY all_disabled_proxyChanged)
- Q_PROPERTY(global_coins_cfg_proxy_model* all_proxy READ get_all_proxy NOTIFY all_proxyChanged)
- Q_PROPERTY(global_coins_cfg_proxy_model* all_qrc20_proxy READ get_all_qrc20_proxy NOTIFY all_qrc20_proxyChanged)
- Q_PROPERTY(global_coins_cfg_proxy_model* all_erc20_proxy READ get_all_erc20_proxy NOTIFY all_erc20_proxyChanged)
+ Q_PROPERTY(global_coins_cfg_proxy_model* all_disabled_proxy READ get_all_disabled_proxy NOTIFY all_disabled_proxyChanged)
+ Q_PROPERTY(global_coins_cfg_proxy_model* all_proxy READ get_all_proxy NOTIFY all_proxyChanged)
+ Q_PROPERTY(global_coins_cfg_proxy_model* all_qrc20_proxy READ get_all_qrc20_proxy NOTIFY all_qrc20_proxyChanged)
+ Q_PROPERTY(global_coins_cfg_proxy_model* all_erc20_proxy READ get_all_erc20_proxy NOTIFY all_erc20_proxyChanged)
+ Q_PROPERTY(global_coins_cfg_proxy_model* all_bep20_proxy READ get_all_bep20_proxy NOTIFY all_bep20_proxyChanged)
Q_PROPERTY(global_coins_cfg_proxy_model* all_smartchains_proxy READ get_all_smartchains_proxy NOTIFY all_smartchains_proxyChanged)
- Q_PROPERTY(global_coins_cfg_proxy_model* all_utxo_proxy READ get_all_utxo_proxy NOTIFY all_utxo_proxyChanged)
- Q_PROPERTY(int length READ get_length NOTIFY lengthChanged)
- Q_PROPERTY(int checked_nb READ get_checked_nb WRITE set_checked_nb NOTIFY checked_nbChanged)
- Q_PROPERTY(QStringList all_coin_types READ get_all_coin_types)
-
+ Q_PROPERTY(global_coins_cfg_proxy_model* all_utxo_proxy READ get_all_utxo_proxy NOTIFY all_utxo_proxyChanged)
+ Q_PROPERTY(int length READ get_length NOTIFY lengthChanged)
+ Q_PROPERTY(int checked_nb READ get_checked_nb WRITE set_checked_nb NOTIFY checked_nbChanged)
+ Q_PROPERTY(QStringList all_coin_types READ get_all_coin_types)
+
// QML API properties signals
signals:
void all_disabled_proxyChanged();
void all_proxyChanged();
void all_qrc20_proxyChanged();
void all_erc20_proxyChanged();
+ void all_bep20_proxyChanged();
void all_smartchains_proxyChanged();
void all_utxo_proxyChanged();
void lengthChanged();
void checked_nbChanged();
-
+
private:
std::vector m_model_data; // Contains all the data
t_enabled_coins_registry m_enabled_coins; // Currently enabled_coins
-
+
std::array m_proxies;
-
+
int m_checked_nb{0}; // Number of coins that are currently checked
-
+
QStringList m_all_coin_types; // Contains every supported coin type (e.g. UTXO, SmartChain)
-
+
entt::registry& m_entity_registry;
};
} // namespace atomic_dex
\ No newline at end of file
diff --git a/src/core/atomicdex/models/qt.global.coins.cfg.proxy.filter.model.hpp b/src/core/atomicdex/models/qt.global.coins.cfg.proxy.filter.model.hpp
index efa917f2ef..49e53f92bb 100644
--- a/src/core/atomicdex/models/qt.global.coins.cfg.proxy.filter.model.hpp
+++ b/src/core/atomicdex/models/qt.global.coins.cfg.proxy.filter.model.hpp
@@ -16,6 +16,7 @@
#pragma once
+//! Qt
#include
namespace atomic_dex
@@ -37,8 +38,7 @@ namespace atomic_dex
//////// QML API
////////////////
- // Checks/Unchecks all coins
- Q_INVOKABLE void set_all_state(bool checked) ;
+ Q_INVOKABLE void set_all_state(bool checked); // Checks/Unchecks all coins
private:
Q_PROPERTY(int length READ get_length NOTIFY lengthChanged)
diff --git a/src/core/atomicdex/models/qt.orderbook.model.cpp b/src/core/atomicdex/models/qt.orderbook.model.cpp
index da88aeca57..dde3f93e07 100644
--- a/src/core/atomicdex/models/qt.orderbook.model.cpp
+++ b/src/core/atomicdex/models/qt.orderbook.model.cpp
@@ -24,7 +24,7 @@
namespace
{
- template
+ /*template
void
update_value(int role, const TValue& value, const QModelIndex& idx, TModel& model)
{
@@ -32,13 +32,13 @@ namespace
{
model.setData(idx, value, role);
}
- }
+ }*/
} // namespace
namespace atomic_dex
{
orderbook_model::orderbook_model(kind orderbook_kind, ag::ecs::system_manager& system_mgr, QObject* parent) :
- QAbstractListModel(parent), m_current_orderbook_kind(orderbook_kind), m_system_mgr(system_mgr), m_model_proxy(new orderbook_proxy_model(this))
+ QAbstractListModel(parent), m_current_orderbook_kind(orderbook_kind), m_system_mgr(system_mgr), m_model_proxy(new orderbook_proxy_model(system_mgr, this))
{
this->m_model_proxy->setSourceModel(this);
this->m_model_proxy->setDynamicSortFilter(true);
@@ -47,15 +47,16 @@ namespace atomic_dex
switch (m_current_orderbook_kind)
{
case kind::asks:
- this->m_model_proxy->sort(0, Qt::AscendingOrder);
+ this->m_model_proxy->sort(0, Qt::DescendingOrder);
break;
case kind::bids:
this->m_model_proxy->sort(0, Qt::DescendingOrder);
break;
case kind::best_orders:
- this->m_model_proxy->setSortRole(PriceFiatRole);
- this->m_model_proxy->setFilterRole(HaveCEXIDRole);
+ this->m_model_proxy->setSortRole(CEXRatesRole);
+ this->m_model_proxy->setFilterRole(NameAndTicker);
this->m_model_proxy->sort(0, Qt::DescendingOrder);
+ this->m_model_proxy->setFilterCaseSensitivity(Qt::CaseInsensitive);
break;
}
}
@@ -87,6 +88,17 @@ namespace atomic_dex
}
return QString::fromStdString(m_model_data.at(index.row()).coin);
}
+ case NameAndTicker:
+ {
+ if (m_current_orderbook_kind == kind::best_orders)
+ {
+ const auto coin = m_model_data.at(index.row()).rel_coin.value();
+ const auto& portfolio_pg = m_system_mgr.get_system();
+ const auto cfg = portfolio_pg.get_global_cfg()->get_coin_info(coin);
+ return QString::fromStdString(coin+cfg.name);
+ }
+ return QString::fromStdString(m_model_data.at(index.row()).coin);
+ }
case PriceDenomRole:
return QString::fromStdString(m_model_data.at(index.row()).price_fraction_denom);
case PriceNumerRole:
@@ -107,6 +119,28 @@ namespace atomic_dex
return QString::fromStdString(m_model_data.at(index.row()).max_volume_fraction_numer);
case BaseMinVolumeRole:
return QString::fromStdString(m_model_data.at(index.row()).base_min_volume);
+ case BaseMinVolumeDenomRole:
+ return QString::fromStdString(m_model_data.at(index.row()).base_min_volume_denom);
+ case BaseMinVolumeNumerRole:
+ return QString::fromStdString(m_model_data.at(index.row()).base_min_volume_numer);
+ case BaseMaxVolumeRole:
+ return QString::fromStdString(m_model_data.at(index.row()).base_max_volume);
+ case BaseMaxVolumeDenomRole:
+ return QString::fromStdString(m_model_data.at(index.row()).base_max_volume_denom);
+ case BaseMaxVolumeNumerRole:
+ return QString::fromStdString(m_model_data.at(index.row()).base_max_volume_numer);
+ case RelMinVolumeRole:
+ return QString::fromStdString(m_model_data.at(index.row()).rel_min_volume);
+ case RelMinVolumeDenomRole:
+ return QString::fromStdString(m_model_data.at(index.row()).rel_min_volume_denom);
+ case RelMinVolumeNumerRole:
+ return QString::fromStdString(m_model_data.at(index.row()).rel_min_volume_numer);
+ case RelMaxVolumeRole:
+ return QString::fromStdString(m_model_data.at(index.row()).rel_max_volume);
+ case RelMaxVolumeDenomRole:
+ return QString::fromStdString(m_model_data.at(index.row()).rel_max_volume_denom);
+ case RelMaxVolumeNumerRole:
+ return QString::fromStdString(m_model_data.at(index.row()).rel_max_volume_numer);
case MinVolumeRole:
{
const bool is_asks = m_current_orderbook_kind == kind::asks;
@@ -165,7 +199,10 @@ namespace atomic_dex
const auto& data = m_model_data.at(index.row());
const auto& trading_pg = m_system_mgr.get_system();
t_float_50 volume_f = safe_float(trading_pg.get_volume().toStdString());
- // const bool is_buy = trading_pg.get_market_mode() == MarketMode::Buy;
+ const bool is_buy = trading_pg.get_market_mode() == MarketMode::Buy;
+ if (!is_buy) {
+ volume_f = safe_float(data.base_max_volume);
+ }
t_float_50 total_amount_f = volume_f * safe_float(data.price);
const auto total_amount = atomic_dex::utils::format_float(total_amount_f);
return QString::fromStdString(total_amount);
@@ -252,6 +289,8 @@ namespace atomic_dex
case MinVolumeRole:
order.min_volume = value.toString().toStdString();
break;
+ case NameAndTicker:
+ break;
case EnoughFundsToPayMinVolume:
break;
case CEXRatesRole:
@@ -265,8 +304,41 @@ namespace atomic_dex
case BaseMinVolumeRole:
order.base_min_volume = value.toString().toStdString();
break;
+ case BaseMinVolumeDenomRole:
+ order.base_min_volume_denom = value.toString().toStdString();
+ break;
+ case BaseMinVolumeNumerRole:
+ order.base_min_volume_numer = value.toString().toStdString();
+ break;
+ case BaseMaxVolumeRole:
+ order.base_max_volume = value.toString().toStdString();
+ break;
+ case BaseMaxVolumeDenomRole:
+ order.base_max_volume_denom = value.toString().toStdString();
+ break;
+ case BaseMaxVolumeNumerRole:
+ order.base_max_volume_numer = value.toString().toStdString();
+ break;
+ case RelMinVolumeRole:
+ order.rel_min_volume = value.toString().toStdString();
+ break;
+ case RelMinVolumeDenomRole:
+ order.rel_min_volume_denom = value.toString().toStdString();
+ break;
+ case RelMinVolumeNumerRole:
+ order.rel_min_volume_numer = value.toString().toStdString();
+ break;
+ case RelMaxVolumeRole:
+ order.rel_max_volume = value.toString().toStdString();
+ break;
+ case RelMaxVolumeDenomRole:
+ order.rel_max_volume_denom = value.toString().toStdString();
+ break;
+ case RelMaxVolumeNumerRole:
+ order.rel_max_volume_numer = value.toString().toStdString();
+ break;
}
- emit dataChanged(index, index, {role});
+ // emit dataChanged(index, index, {role});
return true;
}
@@ -290,7 +362,18 @@ namespace atomic_dex
{CEXRatesRole, "cex_rates"},
{SendRole, "send"},
{PriceFiatRole, "price_fiat"},
- {BaseMinVolumeRole, "base_min_volume"}};
+ {BaseMinVolumeRole, "base_min_volume"},
+ {BaseMinVolumeDenomRole, "base_min_volume_denom"},
+ {BaseMinVolumeNumerRole, "base_min_volume_numer"},
+ {BaseMaxVolumeRole, "base_max_volume"},
+ {BaseMaxVolumeDenomRole, "base_max_volume_denom"},
+ {BaseMaxVolumeNumerRole, "base_max_volume_numer"},
+ {RelMinVolumeRole, "rel_min_volume"},
+ {RelMinVolumeDenomRole, "rel_min_volume_denom"},
+ {RelMinVolumeNumerRole, "rel_min_volume_numer"},
+ {RelMaxVolumeRole, "rel_max_volume"},
+ {RelMaxVolumeDenomRole, "rel_max_volume_denom"},
+ {RelMaxVolumeNumerRole, "rel_max_volume_numer"}};
}
void
@@ -298,7 +381,8 @@ namespace atomic_dex
{
if (!orderbook.empty())
{
- SPDLOG_INFO("full orderbook initialization initial size: {} target size: {}", rowCount(), orderbook.size());
+ SPDLOG_INFO(
+ "full orderbook initialization initial size: {} target size: {}, orderbook_kind: {}", rowCount(), orderbook.size(), m_current_orderbook_kind);
}
this->beginResetModel();
m_model_data = orderbook;
@@ -325,6 +409,12 @@ namespace atomic_dex
void
orderbook_model::initialize_order(const ::mm2::api::order_contents& order)
{
+ if (m_orders_id_registry.contains(order.uuid))
+ {
+ SPDLOG_WARN("Order with uuid: {} already present...skipping.", order.uuid);
+ return;
+ }
+
assert(m_model_data.size() == m_orders_id_registry.size());
beginInsertRows(QModelIndex(), m_model_data.size(), m_model_data.size());
m_model_data.push_back(order);
@@ -332,6 +422,27 @@ namespace atomic_dex
endInsertRows();
emit lengthChanged();
assert(m_model_data.size() == m_orders_id_registry.size());
+ if (m_system_mgr.has_system() && m_current_orderbook_kind == kind::bids)
+ {
+ auto& trading_pg = m_system_mgr.get_system();
+ if (trading_pg.get_market_mode() == MarketMode::Sell)
+ {
+ const auto preferred_order = trading_pg.get_preffered_order();
+ if (!preferred_order.empty())
+ {
+ const t_float_50 price_std = safe_float(order.price);
+ t_float_50 preferred_price = safe_float(preferred_order.value("price", "0").toString().toStdString());
+ if (price_std > preferred_price)
+ {
+ SPDLOG_INFO(
+ "An order with a better price is inserted, uuid: {}, new_price: {}, current_price: {}", order.uuid, utils::format_float(price_std),
+ utils::format_float(preferred_price));
+ trading_pg.set_selected_order_status(SelectedOrderStatus::BetterPriceAvailable);
+ emit betterOrderDetected(get_order_from_uuid(QString::fromStdString(order.uuid)));
+ }
+ }
+ }
+ }
}
void
@@ -340,8 +451,9 @@ namespace atomic_dex
if (const auto res = this->match(index(0, 0), UUIDRole, QString::fromStdString(order.uuid)); not res.isEmpty())
{
//! ID Found, update !
- const QModelIndex& idx = res.at(0);
- update_value(OrderbookRoles::PriceRole, QString::fromStdString(order.price), idx, *this);
+ const QModelIndex& idx = res.at(0);
+ const auto uuid_to_be_updated = this->data(idx, OrderbookRoles::UUIDRole).toString().toStdString();
+ auto&& [_, new_price, is_price_changed] = update_value(OrderbookRoles::PriceRole, QString::fromStdString(order.price), idx, *this);
update_value(OrderbookRoles::PriceNumerRole, QString::fromStdString(order.price_fraction_numer), idx, *this);
update_value(OrderbookRoles::PriceDenomRole, QString::fromStdString(order.price_fraction_denom), idx, *this);
update_value(OrderbookRoles::IsMineRole, order.is_mine, idx, *this);
@@ -349,11 +461,76 @@ namespace atomic_dex
update_value(OrderbookRoles::TotalRole, QString::fromStdString(order.total), idx, *this);
update_value(OrderbookRoles::PercentDepthRole, QString::fromStdString(order.depth_percent), idx, *this);
update_value(OrderbookRoles::BaseMinVolumeRole, QString::fromStdString(order.base_min_volume), idx, *this);
+ update_value(OrderbookRoles::BaseMinVolumeDenomRole, QString::fromStdString(order.base_min_volume_denom), idx, *this);
+ update_value(OrderbookRoles::BaseMinVolumeNumerRole, QString::fromStdString(order.base_min_volume_numer), idx, *this);
+ update_value(OrderbookRoles::BaseMaxVolumeRole, QString::fromStdString(order.base_max_volume), idx, *this);
+ update_value(OrderbookRoles::BaseMaxVolumeDenomRole, QString::fromStdString(order.base_max_volume_denom), idx, *this);
+ update_value(OrderbookRoles::BaseMaxVolumeNumerRole, QString::fromStdString(order.base_max_volume_numer), idx, *this);
+ update_value(OrderbookRoles::RelMinVolumeRole, QString::fromStdString(order.rel_min_volume), idx, *this);
+ update_value(OrderbookRoles::RelMinVolumeDenomRole, QString::fromStdString(order.rel_min_volume_denom), idx, *this);
+ update_value(OrderbookRoles::RelMinVolumeNumerRole, QString::fromStdString(order.rel_min_volume_numer), idx, *this);
+ update_value(OrderbookRoles::RelMaxVolumeRole, QString::fromStdString(order.rel_max_volume), idx, *this);
+ update_value(OrderbookRoles::RelMaxVolumeDenomRole, QString::fromStdString(order.rel_max_volume_denom), idx, *this);
+ update_value(OrderbookRoles::RelMaxVolumeNumerRole, QString::fromStdString(order.rel_max_volume_numer), idx, *this);
update_value(OrderbookRoles::MinVolumeRole, QString::fromStdString(order.min_volume), idx, *this);
update_value(OrderbookRoles::EnoughFundsToPayMinVolume, true, idx, *this);
update_value(OrderbookRoles::CEXRatesRole, "0.00", idx, *this);
update_value(OrderbookRoles::SendRole, "0.00", idx, *this);
update_value(OrderbookRoles::PriceFiatRole, "0.00", idx, *this);
+ emit dataChanged(
+ idx, idx,
+ {OrderbookRoles::UUIDRole,
+ OrderbookRoles::PriceRole,
+ OrderbookRoles::PriceNumerRole,
+ OrderbookRoles::PriceDenomRole,
+ OrderbookRoles::IsMineRole,
+ OrderbookRoles::QuantityRole,
+ OrderbookRoles::TotalRole,
+ OrderbookRoles::PercentDepthRole,
+ OrderbookRoles::BaseMinVolumeRole,
+ OrderbookRoles::BaseMinVolumeDenomRole,
+ OrderbookRoles::BaseMinVolumeNumerRole,
+ OrderbookRoles::BaseMaxVolumeRole,
+ OrderbookRoles::BaseMaxVolumeDenomRole,
+ OrderbookRoles::BaseMaxVolumeNumerRole,
+ OrderbookRoles::RelMinVolumeRole,
+ OrderbookRoles::RelMinVolumeDenomRole,
+ OrderbookRoles::RelMinVolumeNumerRole,
+ OrderbookRoles::RelMaxVolumeRole,
+ OrderbookRoles::RelMaxVolumeDenomRole,
+ OrderbookRoles::RelMaxVolumeNumerRole,
+ OrderbookRoles::MinVolumeRole,
+ OrderbookRoles::EnoughFundsToPayMinVolume,
+ OrderbookRoles::CEXRatesRole,
+ OrderbookRoles::SendRole,
+ OrderbookRoles::PriceFiatRole});
+
+ if (m_system_mgr.has_system() && m_current_orderbook_kind == kind::bids && is_price_changed)
+ {
+ auto& trading_pg = m_system_mgr.get_system