35
35
color: Qaterial .Colors .amber
36
36
}
37
37
38
+ // Insufficient funds tooltip
38
39
DexLabel
39
40
{
40
41
id: tooltip_text
105
106
anchors .fill : parent
106
107
hoverEnabled: true
107
108
109
+ // Populate form with selected order
108
110
onClicked:
109
111
{
110
112
if (is_mine) return
124
126
}
125
127
}
126
128
129
+ // Highlight row on mouseover
127
130
AnimatedRectangle
128
131
{
129
132
visible: mouse_area .containsMouse
@@ -133,16 +136,6 @@ Item
133
136
opacity: 0.1
134
137
}
135
138
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
-
146
139
// Progress bar
147
140
Rectangle
148
141
{
@@ -166,98 +159,111 @@ Item
166
159
}
167
160
}
168
161
169
- Row
162
+ // Price, Qty & Total text values
163
+ RowLayout
170
164
{
171
165
id: row
172
166
anchors .fill : parent
173
- anchors .horizontalCenter : parent .horizontalCenter
174
167
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
+ }
176
181
182
+ // Price
177
183
Dex .ElidableText
178
184
{
179
- anchors .verticalCenter : parent .verticalCenter
180
- width: parent .width * 0.31
185
+ Layout .fillHeight : true
186
+ Layout .minimumWidth : 90
187
+ Layout .alignment : Qt .AlignVCenter
181
188
text: { new BigNumber (price).toFixed (8 ) }
182
189
font .family : DexTypo .fontFamily
183
190
font .pixelSize : 12
184
191
color: isAsk ? Dex .CurrentTheme .warningColor : Dex .CurrentTheme .okColor
185
192
horizontalAlignment: Text .AlignRight
193
+ verticalAlignment: Text .AlignVCenter
186
194
wrapMode: Text .NoWrap
187
195
}
188
196
189
- Item { width: parent .width * 0.01 }
190
-
191
197
// Quantity
192
198
Dex .ElidableText
193
199
{
194
- anchors .verticalCenter : parent .verticalCenter
195
- width: parent .width * 0.37
200
+ Layout .fillHeight : true
201
+ Layout .minimumWidth : 90
202
+ Layout .alignment : Qt .AlignVCenter
196
203
text: { new BigNumber (base_max_volume).toFixed (6 ) }
197
204
font .family : DexTypo .fontFamily
198
205
font .pixelSize : 12
199
206
horizontalAlignment: Text .AlignRight
207
+ verticalAlignment: Text .AlignVCenter
200
208
onTextChanged: depth_bar .width = ((depth * 100 ) * (mouse_area .width + 40 )) / 100
201
209
wrapMode: Text .NoWrap
202
210
}
203
211
204
- Item { width: parent .width * 0.01 }
205
-
206
212
// Total
207
213
Dex .ElidableText
208
214
{
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
212
220
font .family : DexTypo .fontFamily
213
221
font .pixelSize : 12
214
222
text: { new BigNumber (total).toFixed (6 ) }
215
223
horizontalAlignment: Text .AlignRight
224
+ verticalAlignment: Text .AlignVCenter
216
225
wrapMode: Text .NoWrap
217
-
218
- Behavior on rightPadding { NumberAnimation { duration: 150 } }
219
226
}
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
229
227
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
234
228
235
- Behavior on iconSize
236
- {
237
- NumberAnimation
229
+ // Cancel button
230
+ Item
238
231
{
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
244
236
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
+ }
248
244
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
254
251
255
- onClicked:
256
- {
257
- if ( ! is_mine) return
252
+ onClicked: {
253
+ if (uuid) cancelOrder (uuid);
254
+ }
258
255
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
+ }
261
267
}
262
268
}
263
269
}
0 commit comments