Skip to content

Commit 7a6e41d

Browse files
authored
Merge pull request #2465 from KomodoPlatform/fix/dexpro/orderbook/bignum-alignment
Fix/dexpro/orderbook/bignum alignment
2 parents eeb767c + f9e8dad commit 7a6e41d

File tree

3 files changed

+25
-16
lines changed

3 files changed

+25
-16
lines changed

atomic_defi_design/Dex/Constants/General.qml

+9
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,15 @@ QtObject {
442442
return feetype + " " + amount + " " + ticker + " (" + fiat_text + ")"
443443
}
444444

445+
function reducedBignum(text, decimals=8, max_length=12) {
446+
let val = new BigNumber(text).toFixed(decimals)
447+
if (val.length > max_length)
448+
{
449+
return val.substring(0, max_length)
450+
}
451+
return val
452+
}
453+
445454
function getSimpleFromPlaceholder(selectedTicker, selectedOrder, sell_ticker_balance) {
446455
if (privacy_mode)
447456
{

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

+14-14
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ Item
2121
DefaultTooltip
2222
{
2323
visible: mouse_area.containsMouse && (tooltip_text.text_value != "")
24-
width: 300
24+
width: 340
2525

2626
contentItem: RowLayout
2727
{
28-
width: 290
28+
width: 330
2929

3030
Qaterial.ColorIcon
3131
{
@@ -175,22 +175,22 @@ Item
175175
// Dot on the left side of the row to indicate own order
176176
Rectangle
177177
{
178-
Layout.leftMargin: 6
178+
Layout.leftMargin: 4
179179
Layout.alignment: Qt.AlignVCenter
180180
opacity: is_mine ? 1 : 0
181-
width: 6
182-
height: 6
183-
radius: 3
181+
width: 4
182+
height: 4
183+
radius: 2
184184
color: isAsk ? Dex.CurrentTheme.warningColor : Dex.CurrentTheme.okColor
185185
}
186186

187187
// Price
188188
Dex.ElidableText
189189
{
190190
Layout.fillHeight: true
191-
Layout.minimumWidth: 90
191+
Layout.minimumWidth: 100
192192
Layout.alignment: Qt.AlignVCenter
193-
text: { new BigNumber(price).toFixed(8) }
193+
text: General.reducedBignum(price, 8)
194194
font.family: DexTypo.fontFamily
195195
font.pixelSize: 12
196196
color: isAsk ? Dex.CurrentTheme.warningColor : Dex.CurrentTheme.okColor
@@ -203,9 +203,9 @@ Item
203203
Dex.ElidableText
204204
{
205205
Layout.fillHeight: true
206-
Layout.minimumWidth: 90
206+
Layout.minimumWidth: 100
207207
Layout.alignment: Qt.AlignVCenter
208-
text: { new BigNumber(base_max_volume).toFixed(6) }
208+
text: General.reducedBignum(base_max_volume, 6)
209209
font.family: DexTypo.fontFamily
210210
font.pixelSize: 12
211211
horizontalAlignment: Text.AlignRight
@@ -219,12 +219,12 @@ Item
219219
{
220220
id: total_text
221221
Layout.fillHeight: true
222-
Layout.minimumWidth: 90
222+
Layout.minimumWidth: 100
223223
Layout.fillWidth: true
224224
Layout.alignment: Qt.AlignVCenter
225225
font.family: DexTypo.fontFamily
226226
font.pixelSize: 12
227-
text: { new BigNumber(total).toFixed(6) }
227+
text: General.reducedBignum(total, 6)
228228
horizontalAlignment: Text.AlignRight
229229
verticalAlignment: Text.AlignVCenter
230230
wrapMode: Text.NoWrap
@@ -236,7 +236,7 @@ Item
236236
{
237237
id: cancel_flat_btn
238238
Layout.fillHeight: true
239-
width: 30
239+
width: 20
240240
Layout.alignment: Qt.AlignVCenter
241241

242242
MouseArea
@@ -261,7 +261,7 @@ Item
261261
Qaterial.ColorIcon
262262
{
263263
anchors.centerIn: parent
264-
iconSize: 16
264+
iconSize: 14
265265
color: Dex.CurrentTheme.warningColor
266266
source: Qaterial.Icons.close
267267
visible: is_mine

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ Widget
1616
readonly property string pair_volume_24hr: API.app.trading_pg.pair_volume_24hr
1717
readonly property string pair: atomic_qt_utilities.retrieve_main_ticker(left_ticker) + "/" + atomic_qt_utilities.retrieve_main_ticker(right_ticker)
1818

19-
margins: 10
20-
spacing: 10
19+
margins: 8
20+
spacing: 8
2121
collapsable: false
2222

2323
Header

0 commit comments

Comments
 (0)