Skip to content

Commit b52849a

Browse files
authored
Merge branch 'dev' into add/order-info
2 parents 85e69fd + da0f8ff commit b52849a

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
@@ -101,6 +102,7 @@ Item
101102
anchors.fill: parent
102103
hoverEnabled: true
103104

105+
// Populate form with selected order
104106
onClicked:
105107
{
106108
if (is_mine) return
@@ -119,6 +121,7 @@ Item
119121
}
120122
}
121123

124+
// Highlight row on mouseover
122125
AnimatedRectangle
123126
{
124127
visible: mouse_area.containsMouse
@@ -128,16 +131,6 @@ Item
128131
opacity: 0.1
129132
}
130133

131-
Rectangle
132-
{
133-
anchors.verticalCenter: parent.verticalCenter
134-
width: 6
135-
height: 6
136-
radius: width / 2
137-
visible: is_mine
138-
color: isAsk ? Dex.CurrentTheme.warningColor : Dex.CurrentTheme.okColor
139-
}
140-
141134
// Progress bar
142135
Rectangle
143136
{
@@ -161,98 +154,111 @@ Item
161154
}
162155
}
163156

164-
Row
157+
// Price, Qty & Total text values
158+
RowLayout
165159
{
166160
id: row
167161
anchors.fill: parent
168-
anchors.horizontalCenter: parent.horizontalCenter
169162
onWidthChanged: progress.width = ((depth * 100) * (width + 40)) / 100
170-
spacing: 0
163+
spacing: 3
164+
165+
// Dot on the left side of the row to indicate own order
166+
Rectangle
167+
{
168+
Layout.leftMargin: 6
169+
Layout.alignment: Qt.AlignVCenter
170+
opacity: is_mine ? 1 : 0
171+
width: 6
172+
height: 6
173+
radius: 3
174+
color: isAsk ? Dex.CurrentTheme.warningColor : Dex.CurrentTheme.okColor
175+
}
171176

177+
// Price
172178
Dex.ElidableText
173179
{
174-
anchors.verticalCenter: parent.verticalCenter
175-
width: parent.width * 0.31
180+
Layout.fillHeight: true
181+
Layout.minimumWidth: 90
182+
Layout.alignment: Qt.AlignVCenter
176183
text: { new BigNumber(price).toFixed(8) }
177184
font.family: DexTypo.fontFamily
178185
font.pixelSize: 12
179186
color: isAsk ? Dex.CurrentTheme.warningColor : Dex.CurrentTheme.okColor
180187
horizontalAlignment: Text.AlignRight
188+
verticalAlignment: Text.AlignVCenter
181189
wrapMode: Text.NoWrap
182190
}
183191

184-
Item { width: parent.width * 0.01 }
185-
186192
// Quantity
187193
Dex.ElidableText
188194
{
189-
anchors.verticalCenter: parent.verticalCenter
190-
width: parent.width * 0.37
195+
Layout.fillHeight: true
196+
Layout.minimumWidth: 90
197+
Layout.alignment: Qt.AlignVCenter
191198
text: { new BigNumber(base_max_volume).toFixed(6) }
192199
font.family: DexTypo.fontFamily
193200
font.pixelSize: 12
194201
horizontalAlignment: Text.AlignRight
202+
verticalAlignment: Text.AlignVCenter
195203
onTextChanged: depth_bar.width = ((depth * 100) * (mouse_area.width + 40)) / 100
196204
wrapMode: Text.NoWrap
197205
}
198206

199-
Item { width: parent.width * 0.01 }
200-
201207
// Total
202208
Dex.ElidableText
203209
{
204-
anchors.verticalCenter: parent.verticalCenter
205-
width: parent.width * 0.30
206-
rightPadding: (is_mine) && (mouse_area.containsMouse || cancel_button.containsMouse) ? 30 : 0
210+
id: total_text
211+
Layout.fillHeight: true
212+
Layout.minimumWidth: 90
213+
Layout.fillWidth: true
214+
Layout.alignment: Qt.AlignVCenter
207215
font.family: DexTypo.fontFamily
208216
font.pixelSize: 12
209217
text: { new BigNumber(total).toFixed(6) }
210218
horizontalAlignment: Text.AlignRight
219+
verticalAlignment: Text.AlignVCenter
211220
wrapMode: Text.NoWrap
212-
213-
Behavior on rightPadding { NumberAnimation { duration: 150 } }
214221
}
215-
}
216-
}
217-
218-
Qaterial.ColorIcon
219-
{
220-
id: cancel_button_text
221-
property bool requested_cancel: false
222-
223-
visible: is_mine && !requested_cancel
224222

225-
anchors.verticalCenter: parent.verticalCenter
226-
anchors.verticalCenterOffset: 1
227-
anchors.right: parent.right
228-
anchors.rightMargin: mouse_area.containsMouse || cancel_button.containsMouse ? 12 : 6
229223

230-
Behavior on iconSize
231-
{
232-
NumberAnimation
224+
// Cancel button
225+
Item
233226
{
234-
duration: 200
235-
}
236-
}
237-
238-
iconSize: mouse_area.containsMouse || cancel_button.containsMouse? 16 : 0
227+
id: cancel_flat_btn
228+
Layout.fillHeight: true
229+
width: 30
230+
Layout.alignment: Qt.AlignVCenter
239231

240-
color: cancel_button.containsMouse ?
241-
Qaterial.Colors.red : mouse_area.containsMouse ?
242-
DexTheme.foregroundColor: Qaterial.Colors.red
232+
MouseArea
233+
{
234+
id: cancel_mouse_area
235+
anchors.fill: parent
236+
cursorShape: Qt.PointingHandCursor
237+
hoverEnabled: true
238+
}
243239

244-
DefaultMouseArea
245-
{
246-
id: cancel_button
247-
anchors.fill: parent
248-
hoverEnabled: true
240+
Qaterial.FlatButton
241+
{
242+
id: cancel_button_orderbook
243+
anchors.centerIn: parent
244+
anchors.fill: parent
245+
opacity: is_mine ? 1 : 0
249246

250-
onClicked:
251-
{
252-
if (!is_mine) return
247+
onClicked: {
248+
if (uuid) cancelOrder(uuid);
249+
}
253250

254-
cancel_button_text.requested_cancel = true
255-
cancelOrder(uuid)
251+
Qaterial.ColorIcon
252+
{
253+
anchors.centerIn: parent
254+
iconSize: 16
255+
color: Dex.CurrentTheme.warningColor
256+
source: Qaterial.Icons.close
257+
visible: is_mine
258+
scale: is_mine && mouse_area.containsMouse ? 1 : 0
259+
Behavior on scale { NumberAnimation { duration: 150 } }
260+
}
261+
}
256262
}
257263
}
258264
}

0 commit comments

Comments
 (0)