Skip to content

Commit 2bd2120

Browse files
committed
Merge branch 'dev' into add/order-options
2 parents e5f4fbb + da0f8ff commit 2bd2120

18 files changed

+345
-942
lines changed

atomic_defi_design/Dex/Exchange/ProView/Chart.qml

+11
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ Item
7070
transform: scale(${Math.min(scale_x, scale_y)});
7171
transform-origin: top left;
7272
}
73+
a { pointer-events: none; }
7374
</style>
7475
<script defer src="https://www.livecoinwatch.com/static/lcw-widget.js"></script>
7576
<div class="livecoinwatch-widget-1" lcw-coin="${rel_ticker}" lcw-base="${base_ticker}" lcw-secondary="USDC" lcw-period="w" lcw-color-tx="${Dex.CurrentTheme.foregroundColor}" lcw-color-pr="#58c7c5" lcw-color-bg="${Dex.CurrentTheme.comboBoxBackgroundColor}" lcw-border-w="0" lcw-digits="8" ></div>
@@ -226,6 +227,16 @@ Item
226227
}
227228
}
228229

230+
MouseArea {
231+
id: chart_mousearea
232+
anchors.fill: webEngineViewPlaceHolder
233+
onClicked: {
234+
if (webEngineView.visible) {
235+
Qt.openUrlExternally("https://www.livecoinwatch.com")
236+
}
237+
}
238+
}
239+
229240
Connections
230241
{
231242
target: app

atomic_defi_design/Dex/Exchange/Trade/OrderBook/ListDelegate.qml

+66-60
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ Item
3535
color: Qaterial.Colors.amber
3636
}
3737

38+
// Insufficient funds tooltip
3839
DexLabel
3940
{
4041
id: tooltip_text
@@ -105,6 +106,7 @@ Item
105106
anchors.fill: parent
106107
hoverEnabled: true
107108

109+
// Populate form with selected order
108110
onClicked:
109111
{
110112
if (is_mine) return
@@ -124,6 +126,7 @@ Item
124126
}
125127
}
126128

129+
// Highlight row on mouseover
127130
AnimatedRectangle
128131
{
129132
visible: mouse_area.containsMouse
@@ -133,16 +136,6 @@ Item
133136
opacity: 0.1
134137
}
135138

136-
Rectangle
137-
{
138-
anchors.verticalCenter: parent.verticalCenter
139-
width: 6
140-
height: 6
141-
radius: width / 2
142-
visible: is_mine
143-
color: isAsk ? Dex.CurrentTheme.warningColor : Dex.CurrentTheme.okColor
144-
}
145-
146139
// Progress bar
147140
Rectangle
148141
{
@@ -166,98 +159,111 @@ Item
166159
}
167160
}
168161

169-
Row
162+
// Price, Qty & Total text values
163+
RowLayout
170164
{
171165
id: row
172166
anchors.fill: parent
173-
anchors.horizontalCenter: parent.horizontalCenter
174167
onWidthChanged: progress.width = ((depth * 100) * (width + 40)) / 100
175-
spacing: 0
168+
spacing: 3
169+
170+
// Dot on the left side of the row to indicate own order
171+
Rectangle
172+
{
173+
Layout.leftMargin: 6
174+
Layout.alignment: Qt.AlignVCenter
175+
opacity: is_mine ? 1 : 0
176+
width: 6
177+
height: 6
178+
radius: 3
179+
color: isAsk ? Dex.CurrentTheme.warningColor : Dex.CurrentTheme.okColor
180+
}
176181

182+
// Price
177183
Dex.ElidableText
178184
{
179-
anchors.verticalCenter: parent.verticalCenter
180-
width: parent.width * 0.31
185+
Layout.fillHeight: true
186+
Layout.minimumWidth: 90
187+
Layout.alignment: Qt.AlignVCenter
181188
text: { new BigNumber(price).toFixed(8) }
182189
font.family: DexTypo.fontFamily
183190
font.pixelSize: 12
184191
color: isAsk ? Dex.CurrentTheme.warningColor : Dex.CurrentTheme.okColor
185192
horizontalAlignment: Text.AlignRight
193+
verticalAlignment: Text.AlignVCenter
186194
wrapMode: Text.NoWrap
187195
}
188196

189-
Item { width: parent.width * 0.01 }
190-
191197
// Quantity
192198
Dex.ElidableText
193199
{
194-
anchors.verticalCenter: parent.verticalCenter
195-
width: parent.width * 0.37
200+
Layout.fillHeight: true
201+
Layout.minimumWidth: 90
202+
Layout.alignment: Qt.AlignVCenter
196203
text: { new BigNumber(base_max_volume).toFixed(6) }
197204
font.family: DexTypo.fontFamily
198205
font.pixelSize: 12
199206
horizontalAlignment: Text.AlignRight
207+
verticalAlignment: Text.AlignVCenter
200208
onTextChanged: depth_bar.width = ((depth * 100) * (mouse_area.width + 40)) / 100
201209
wrapMode: Text.NoWrap
202210
}
203211

204-
Item { width: parent.width * 0.01 }
205-
206212
// Total
207213
Dex.ElidableText
208214
{
209-
anchors.verticalCenter: parent.verticalCenter
210-
width: parent.width * 0.30
211-
rightPadding: (is_mine) && (mouse_area.containsMouse || cancel_button.containsMouse) ? 30 : 0
215+
id: total_text
216+
Layout.fillHeight: true
217+
Layout.minimumWidth: 90
218+
Layout.fillWidth: true
219+
Layout.alignment: Qt.AlignVCenter
212220
font.family: DexTypo.fontFamily
213221
font.pixelSize: 12
214222
text: { new BigNumber(total).toFixed(6) }
215223
horizontalAlignment: Text.AlignRight
224+
verticalAlignment: Text.AlignVCenter
216225
wrapMode: Text.NoWrap
217-
218-
Behavior on rightPadding { NumberAnimation { duration: 150 } }
219226
}
220-
}
221-
}
222-
223-
Qaterial.ColorIcon
224-
{
225-
id: cancel_button_text
226-
property bool requested_cancel: false
227-
228-
visible: is_mine && !requested_cancel
229227

230-
anchors.verticalCenter: parent.verticalCenter
231-
anchors.verticalCenterOffset: 1
232-
anchors.right: parent.right
233-
anchors.rightMargin: mouse_area.containsMouse || cancel_button.containsMouse ? 12 : 6
234228

235-
Behavior on iconSize
236-
{
237-
NumberAnimation
229+
// Cancel button
230+
Item
238231
{
239-
duration: 200
240-
}
241-
}
242-
243-
iconSize: mouse_area.containsMouse || cancel_button.containsMouse? 16 : 0
232+
id: cancel_flat_btn
233+
Layout.fillHeight: true
234+
width: 30
235+
Layout.alignment: Qt.AlignVCenter
244236

245-
color: cancel_button.containsMouse ?
246-
Qaterial.Colors.red : mouse_area.containsMouse ?
247-
DexTheme.foregroundColor: Qaterial.Colors.red
237+
MouseArea
238+
{
239+
id: cancel_mouse_area
240+
anchors.fill: parent
241+
cursorShape: Qt.PointingHandCursor
242+
hoverEnabled: true
243+
}
248244

249-
DefaultMouseArea
250-
{
251-
id: cancel_button
252-
anchors.fill: parent
253-
hoverEnabled: true
245+
Qaterial.FlatButton
246+
{
247+
id: cancel_button_orderbook
248+
anchors.centerIn: parent
249+
anchors.fill: parent
250+
opacity: is_mine ? 1 : 0
254251

255-
onClicked:
256-
{
257-
if (!is_mine) return
252+
onClicked: {
253+
if (uuid) cancelOrder(uuid);
254+
}
258255

259-
cancel_button_text.requested_cancel = true
260-
cancelOrder(uuid)
256+
Qaterial.ColorIcon
257+
{
258+
anchors.centerIn: parent
259+
iconSize: 16
260+
color: Dex.CurrentTheme.warningColor
261+
source: Qaterial.Icons.close
262+
visible: is_mine
263+
scale: is_mine && mouse_area.containsMouse ? 1 : 0
264+
Behavior on scale { NumberAnimation { duration: 150 } }
265+
}
266+
}
261267
}
262268
}
263269
}

0 commit comments

Comments
 (0)