Skip to content

Commit

Permalink
Merge pull request #1835 from KomodoPlatform/fix_orderbook_overflow
Browse files Browse the repository at this point in the history
Fix orderbook overflow
  • Loading branch information
smk762 authored Jul 1, 2022
2 parents 3e6a597 + 030facf commit 7dde3ae
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 24 deletions.
6 changes: 6 additions & 0 deletions atomic_defi_design/Dex/Components/ElidableText.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import QtQuick 2.12

DefaultText
{
elide: Text.ElideRight
}
1 change: 1 addition & 0 deletions atomic_defi_design/Dex/Components/qmldir
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Button 1.0 DefaultButton.qml
ComboBox 1.0 DefaultComboBox.qml
ComboBoxWithSearchBar 1.0 ComboBoxWithSearchBar.qml
ClickableText 1.0 ClickableText.qml
ElidableText 1.0 ElidableText.qml
GradientButton 1.0 GradientButton.qml
Image 1.0 DefaultImage.qml
ListView 1.0 DefaultListView.qml
Expand Down
25 changes: 11 additions & 14 deletions atomic_defi_design/Dex/Exchange/Trade/OrderBook/Header.qml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,18 @@ import QtQuick.Controls 2.15

import Qaterial 1.0 as Qaterial

import "../../../Components"
import "../../../Constants"
import Dex.Components 1.0 as Dex

RowLayout
Row
{
width: parent.width
height: 24
spacing: 0

DexLabel
Dex.Text
{
Layout.preferredHeight: parent.height
Layout.preferredWidth: 100
width: parent.width * 0.31
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignRight
text: qsTr("Price") + " (" + atomic_qt_utilities.retrieve_main_ticker(right_ticker) + ")"
Expand All @@ -26,12 +25,11 @@ RowLayout
font.weight: Font.Black
}

Item { Layout.preferredWidth: (parent.width - 300) / 2 }
Item { width: parent.width * 0.01 }

DexLabel
Dex.Text
{
Layout.preferredHeight: parent.height
Layout.preferredWidth: 120
width: parent.width * 0.37
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignRight
text: qsTr("Quantity") + " (" + atomic_qt_utilities.retrieve_main_ticker(left_ticker) + ")"
Expand All @@ -41,12 +39,11 @@ RowLayout
font.weight: Font.Black
}

Item { Layout.preferredWidth: (parent.width - 300) / 2 }
Item { width: parent.width * 0.01 }

DexLabel
Dex.Text
{
Layout.preferredHeight: parent.height
Layout.preferredWidth: 80
width: parent.width * 0.30
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignRight
text: qsTr("Total") + " (" + atomic_qt_utilities.retrieve_main_ticker(right_ticker) + ")"
Expand All @@ -55,4 +52,4 @@ RowLayout
font.bold: true
font.weight: Font.Black
}
}
}
25 changes: 15 additions & 10 deletions atomic_defi_design/Dex/Exchange/Trade/OrderBook/ListDelegate.qml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@ import App 1.0
import bignumberjs 1.0
import "../../../Constants"
import Dex.Themes 1.0 as Dex
import Dex.Components 1.0 as Dex
import AtomicDEX.MarketMode 1.0
import AtomicDEX.TradingError 1.0


Item {
Item
{
property bool isAsk

DefaultTooltip
Expand Down Expand Up @@ -160,17 +162,18 @@ Item {
}
}

RowLayout
Row
{
id: row
anchors.fill: parent
anchors.horizontalCenter: parent.horizontalCenter
onWidthChanged: progress.width = ((depth * 100) * (width + 40)) / 100
spacing: 0

DexLabel
Dex.ElidableText
{
Layout.preferredWidth: 120
anchors.verticalCenter: parent.verticalCenter
width: parent.width * 0.31
text: { new BigNumber(price).toFixed(8) }
font.family: DexTypo.fontFamily
font.pixelSize: 12
Expand All @@ -179,12 +182,13 @@ Item {
wrapMode: Text.NoWrap
}

Item { Layout.preferredWidth: (parent.width - 320) / 2 }
Item { width: parent.width * 0.01 }

// Quantity
DexLabel
Dex.ElidableText
{
Layout.preferredWidth: 110
anchors.verticalCenter: parent.verticalCenter
width: parent.width * 0.37
text: { new BigNumber(quantity).toFixed(6) }
font.family: DexTypo.fontFamily
font.pixelSize: 12
Expand All @@ -193,12 +197,13 @@ Item {
wrapMode: Text.NoWrap
}

Item { Layout.preferredWidth: (parent.width - 320) / 2 }
Item { width: parent.width * 0.01 }

// Total
DexLabel
Dex.ElidableText
{
Layout.preferredWidth: 90
anchors.verticalCenter: parent.verticalCenter
width: parent.width * 0.30
rightPadding: (is_mine) && (mouse_area.containsMouse || cancel_button.containsMouse) ? 30 : 0
font.family: DexTypo.fontFamily
font.pixelSize: 12
Expand Down

0 comments on commit 7dde3ae

Please sign in to comment.