Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/dev' into nogeo
Browse files Browse the repository at this point in the history
  • Loading branch information
cipig committed Apr 4, 2024
2 parents 6a3ada5 + da0f8ff commit e180c61
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 60 deletions.
11 changes: 11 additions & 0 deletions atomic_defi_design/Dex/Exchange/ProView/Chart.qml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ Item
transform: scale(${Math.min(scale_x, scale_y)});
transform-origin: top left;
}
a { pointer-events: none; }
</style>
<script defer src="https://www.livecoinwatch.com/static/lcw-widget.js"></script>
<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>
Expand Down Expand Up @@ -226,6 +227,16 @@ Item
}
}

MouseArea {
id: chart_mousearea
anchors.fill: webEngineViewPlaceHolder
onClicked: {
if (webEngineView.visible) {
Qt.openUrlExternally("https://www.livecoinwatch.com")
}
}
}

Connections
{
target: app
Expand Down
126 changes: 66 additions & 60 deletions atomic_defi_design/Dex/Exchange/Trade/OrderBook/ListDelegate.qml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ Item
color: Qaterial.Colors.amber
}

// Insufficient funds tooltip
DexLabel
{
id: tooltip_text
Expand Down Expand Up @@ -101,6 +102,7 @@ Item
anchors.fill: parent
hoverEnabled: true

// Populate form with selected order
onClicked:
{
if (is_mine) return
Expand All @@ -119,6 +121,7 @@ Item
}
}

// Highlight row on mouseover
AnimatedRectangle
{
visible: mouse_area.containsMouse
Expand All @@ -128,16 +131,6 @@ Item
opacity: 0.1
}

Rectangle
{
anchors.verticalCenter: parent.verticalCenter
width: 6
height: 6
radius: width / 2
visible: is_mine
color: isAsk ? Dex.CurrentTheme.warningColor : Dex.CurrentTheme.okColor
}

// Progress bar
Rectangle
{
Expand All @@ -161,98 +154,111 @@ Item
}
}

Row
// Price, Qty & Total text values
RowLayout
{
id: row
anchors.fill: parent
anchors.horizontalCenter: parent.horizontalCenter
onWidthChanged: progress.width = ((depth * 100) * (width + 40)) / 100
spacing: 0
spacing: 3

// Dot on the left side of the row to indicate own order
Rectangle
{
Layout.leftMargin: 6
Layout.alignment: Qt.AlignVCenter
opacity: is_mine ? 1 : 0
width: 6
height: 6
radius: 3
color: isAsk ? Dex.CurrentTheme.warningColor : Dex.CurrentTheme.okColor
}

// Price
Dex.ElidableText
{
anchors.verticalCenter: parent.verticalCenter
width: parent.width * 0.31
Layout.fillHeight: true
Layout.minimumWidth: 90
Layout.alignment: Qt.AlignVCenter
text: { new BigNumber(price).toFixed(8) }
font.family: DexTypo.fontFamily
font.pixelSize: 12
color: isAsk ? Dex.CurrentTheme.warningColor : Dex.CurrentTheme.okColor
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
wrapMode: Text.NoWrap
}

Item { width: parent.width * 0.01 }

// Quantity
Dex.ElidableText
{
anchors.verticalCenter: parent.verticalCenter
width: parent.width * 0.37
Layout.fillHeight: true
Layout.minimumWidth: 90
Layout.alignment: Qt.AlignVCenter
text: { new BigNumber(base_max_volume).toFixed(6) }
font.family: DexTypo.fontFamily
font.pixelSize: 12
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
onTextChanged: depth_bar.width = ((depth * 100) * (mouse_area.width + 40)) / 100
wrapMode: Text.NoWrap
}

Item { width: parent.width * 0.01 }

// Total
Dex.ElidableText
{
anchors.verticalCenter: parent.verticalCenter
width: parent.width * 0.30
rightPadding: (is_mine) && (mouse_area.containsMouse || cancel_button.containsMouse) ? 30 : 0
id: total_text
Layout.fillHeight: true
Layout.minimumWidth: 90
Layout.fillWidth: true
Layout.alignment: Qt.AlignVCenter
font.family: DexTypo.fontFamily
font.pixelSize: 12
text: { new BigNumber(total).toFixed(6) }
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
wrapMode: Text.NoWrap

Behavior on rightPadding { NumberAnimation { duration: 150 } }
}
}
}

Qaterial.ColorIcon
{
id: cancel_button_text
property bool requested_cancel: false

visible: is_mine && !requested_cancel

anchors.verticalCenter: parent.verticalCenter
anchors.verticalCenterOffset: 1
anchors.right: parent.right
anchors.rightMargin: mouse_area.containsMouse || cancel_button.containsMouse ? 12 : 6

Behavior on iconSize
{
NumberAnimation
// Cancel button
Item
{
duration: 200
}
}

iconSize: mouse_area.containsMouse || cancel_button.containsMouse? 16 : 0
id: cancel_flat_btn
Layout.fillHeight: true
width: 30
Layout.alignment: Qt.AlignVCenter

color: cancel_button.containsMouse ?
Qaterial.Colors.red : mouse_area.containsMouse ?
DexTheme.foregroundColor: Qaterial.Colors.red
MouseArea
{
id: cancel_mouse_area
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
hoverEnabled: true
}

DefaultMouseArea
{
id: cancel_button
anchors.fill: parent
hoverEnabled: true
Qaterial.FlatButton
{
id: cancel_button_orderbook
anchors.centerIn: parent
anchors.fill: parent
opacity: is_mine ? 1 : 0

onClicked:
{
if (!is_mine) return
onClicked: {
if (uuid) cancelOrder(uuid);
}

cancel_button_text.requested_cancel = true
cancelOrder(uuid)
Qaterial.ColorIcon
{
anchors.centerIn: parent
iconSize: 16
color: Dex.CurrentTheme.warningColor
source: Qaterial.Icons.close
visible: is_mine
scale: is_mine && mouse_area.containsMouse ? 1 : 0
Behavior on scale { NumberAnimation { duration: 150 } }
}
}
}
}
}
Expand Down

0 comments on commit e180c61

Please sign in to comment.