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