Skip to content

Commit 6110313

Browse files
committed
Merge branch 'dev' into fix/chart-hyperlink
2 parents a952f3d + 8dbad10 commit 6110313

File tree

5 files changed

+100
-56
lines changed

5 files changed

+100
-56
lines changed

atomic_defi_design/Dex/Exchange/ProView/TradingInfo/Main.qml

+2-8
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,11 @@ import "../../../Components"
1010
import "../../Trade"
1111
import "../../ProView"
1212

13-
Widget
13+
ColumnLayout
1414
{
15-
width: 450
15+
Layout.preferredWidth: 450
1616
property alias currentIndex: tabView.currentIndex
1717

18-
title: qsTr("Trading Information")
19-
20-
background: null
21-
margins: 0
22-
23-
2418
Qaterial.LatoTabBar
2519
{
2620
id: tabView
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
import QtQuick 2.15
2+
import QtQuick.Layouts 1.15
3+
import QtQuick.Controls 2.15
4+
5+
import Qaterial 1.0 as Qaterial
6+
7+
import Dex.Themes 1.0 as Dex
8+
import "../../Components"
9+
import "../../Constants"
10+
11+
// OrderBook / Component import
12+
import "OrderBook/" as OrderBook
13+
14+
// Best Order
15+
import "BestOrder/" as BestOrder
16+
17+
18+
ColumnLayout
19+
{
20+
Layout.minimumWidth: 350
21+
Layout.fillWidth: true
22+
Layout.fillHeight: true
23+
Layout.alignment: Qt.AlignTop
24+
property alias currentIndex: marketTabView.currentIndex
25+
26+
Qaterial.LatoTabBar
27+
{
28+
id: marketTabView
29+
property int orderbook: 0
30+
property int best_orders: 1
31+
32+
background: null
33+
Layout.leftMargin: 6
34+
35+
Qaterial.LatoTabButton
36+
{
37+
text: qsTr("Orderbook")
38+
font.pixelSize: 14
39+
textColor: checked ? Dex.CurrentTheme.foregroundColor : Dex.CurrentTheme.foregroundColor2
40+
textSecondaryColor: Dex.CurrentTheme.foregroundColor2
41+
indicatorColor: Dex.CurrentTheme.foregroundColor
42+
}
43+
Qaterial.LatoTabButton
44+
{
45+
text: qsTr("Best Orders")
46+
font.pixelSize: 14
47+
textColor: checked ? Dex.CurrentTheme.foregroundColor : Dex.CurrentTheme.foregroundColor2
48+
textSecondaryColor: Dex.CurrentTheme.foregroundColor2
49+
indicatorColor: Dex.CurrentTheme.foregroundColor
50+
}
51+
}
52+
53+
Rectangle
54+
{
55+
Layout.fillHeight: true
56+
color: Dex.CurrentTheme.floatingBackgroundColor
57+
radius: 10
58+
Layout.preferredWidth: 350
59+
60+
Qaterial.SwipeView
61+
{
62+
id: marketSwipeView
63+
clip: true
64+
interactive: false
65+
currentIndex: marketTabView.currentIndex
66+
anchors.fill: parent
67+
68+
onCurrentIndexChanged:
69+
{
70+
marketSwipeView.currentItem.update();
71+
}
72+
73+
OrderBook.Vertical
74+
{
75+
id: orderBook
76+
Layout.fillHeight: true
77+
Layout.fillWidth: true
78+
}
79+
80+
// Best Orders
81+
BestOrder.List
82+
{
83+
id: bestOrders
84+
Layout.fillHeight: true
85+
Layout.fillWidth: true
86+
}
87+
}
88+
}
89+
}

atomic_defi_design/Dex/Exchange/Trade/ProView.qml

+6-39
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@ RowLayout
4242

4343
property alias tickerSelectors: selectors
4444
property alias trInfo: tradingInfo
45-
property alias orderBook: orderBook
46-
property alias bestOrders: bestOrders
45+
property alias marketsOrderBook: marketsOrderBook
4746
property alias placeOrderForm: placeOrderForm
4847

4948
function selectOrder(
@@ -112,20 +111,15 @@ RowLayout
112111
ColumnLayout
113112
{
114113
Layout.alignment: Qt.AlignTop
115-
116114
Layout.minimumWidth: selectors.visible || tradingInfo.visible ? 450 : -1
117115
Layout.maximumWidth: (!orderBook.visible && !bestOrders.visible) || (!placeOrderForm.visible) ? -1 : 450
118-
Layout.fillWidth: true
119-
120116
Layout.fillHeight: true
121-
122117
spacing: 10
123118

124119
// Ticker selectors.
125120
TickerSelectors
126121
{
127122
id: selectors
128-
129123
Layout.fillWidth: true
130124
Layout.preferredHeight: 70
131125
}
@@ -134,47 +128,20 @@ RowLayout
134128
TradingInfo.Main
135129
{
136130
id: tradingInfo
137-
138-
Layout.fillWidth: true
131+
Layout.maximumWidth: 450
139132
Layout.fillHeight: true
140-
141-
resizable: false
142133
}
143134
}
144135

145-
WidgetContainer
136+
// Best Orders & Order Book
137+
Market
146138
{
147-
property real _orderBookHeightRatio: 0.65
148-
property real _bestOrdersHeightRatio: 0.35
149-
150-
Layout.minimumWidth: orderBook.visible || bestOrders.visible ? 350 : -1
139+
id: marketsOrderBook
140+
Layout.maximumWidth: 350
151141
Layout.fillWidth: true
152142
Layout.fillHeight: true
153143
Layout.alignment: Qt.AlignTop
154144
spacing: 4
155-
156-
onHeightChanged:
157-
{
158-
orderBook.height = getHeight(_orderBookHeightRatio);
159-
bestOrders.height = getHeight(_bestOrdersHeightRatio);
160-
}
161-
162-
OrderBook.Vertical
163-
{
164-
id: orderBook
165-
166-
width: parent.width
167-
minHeight: 320
168-
}
169-
170-
// Best Orders
171-
BestOrder.List
172-
{
173-
id: bestOrders
174-
175-
width: parent.width
176-
minHeight: 140
177-
}
178145
}
179146

180147
// Place order form.

atomic_defi_design/Dex/Exchange/Trade/Trade.qml

+1-2
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,7 @@ Item
172172

173173
proViewTickerSelectors: proView.tickerSelectors
174174
proViewTrInfo: proView.trInfo
175-
proViewOrderBook: proView.orderBook
176-
proViewBestOrders: proView.bestOrders
175+
proViewMarketsOrderBook: proView.marketsOrderBook
177176
proViewPlaceOrderForm: proView.placeOrderForm
178177
}
179178

atomic_defi_design/Dex/Exchange/Trade/Trading/TradeViewHeader.qml

+2-7
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ Item
2121
// property var proViewChart
2222
property var proViewTickerSelectors
2323
property var proViewTrInfo
24-
property var proViewOrderBook
25-
property var proViewBestOrders
24+
property var proViewMarketsOrderBook
2625
property var proViewPlaceOrderForm
2726

2827
Item
@@ -131,11 +130,7 @@ Item
131130

132131
HorizontalLine { width: parent.width - 20; anchors.horizontalCenter: parent.horizontalCenter; opacity: .4 }
133132

134-
CheckEye { text: qsTr("Order Book"); target: proViewOrderBook }
135-
136-
HorizontalLine { width: parent.width - 20; anchors.horizontalCenter: parent.horizontalCenter; opacity: .4 }
137-
138-
CheckEye { text: qsTr("Best Orders"); target: proViewBestOrders }
133+
CheckEye { text: qsTr("Markets"); target: proViewMarketsOrderBook }
139134

140135
HorizontalLine { width: parent.width - 20; anchors.horizontalCenter: parent.horizontalCenter; opacity: .4 }
141136

0 commit comments

Comments
 (0)