diff --git a/CellFrameDashboardGUI/qml.qrc b/CellFrameDashboardGUI/qml.qrc index 871e8d518fd7d2166c565ed70e37adad825a9b10..4c146773938f73aaeea929fe758dda70630efa6b 100755 --- a/CellFrameDashboardGUI/qml.qrc +++ b/CellFrameDashboardGUI/qml.qrc @@ -125,5 +125,10 @@ <file>screen/desktop/Console/DapConsoleTopPanel.qml</file> <file>screen/desktop/Console/DapConsoleTopPanelForm.ui.qml</file> <file>res/icons/icon.ico</file> + <file>res/icons/ic_flag.png</file> + <file>res/icons/buy_icon.png</file> + <file>res/icons/ic_arrow_drop_down_dark_blue.png</file> + <file>res/icons/ic_arrow_drop_up_dark_blue.png</file> + <file>res/icons/sell_icon.png</file> </qresource> </RCC> diff --git a/CellFrameDashboardGUI/res/icons/buy_icon.png b/CellFrameDashboardGUI/res/icons/buy_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..73059a679d93adf2fe007130dfac72d0f5b4a5d8 Binary files /dev/null and b/CellFrameDashboardGUI/res/icons/buy_icon.png differ diff --git a/CellFrameDashboardGUI/res/icons/ic_arrow_drop_down_dark_blue.png b/CellFrameDashboardGUI/res/icons/ic_arrow_drop_down_dark_blue.png new file mode 100644 index 0000000000000000000000000000000000000000..1ac87aaa588bca2ae4b208cab2e93b3606f7b1e3 Binary files /dev/null and b/CellFrameDashboardGUI/res/icons/ic_arrow_drop_down_dark_blue.png differ diff --git a/CellFrameDashboardGUI/res/icons/ic_arrow_drop_up_dark_blue.png b/CellFrameDashboardGUI/res/icons/ic_arrow_drop_up_dark_blue.png new file mode 100644 index 0000000000000000000000000000000000000000..3fe34c8940c90afcecbe24eefd9a9db045be19fb Binary files /dev/null and b/CellFrameDashboardGUI/res/icons/ic_arrow_drop_up_dark_blue.png differ diff --git a/CellFrameDashboardGUI/res/icons/ic_flag.png b/CellFrameDashboardGUI/res/icons/ic_flag.png new file mode 100644 index 0000000000000000000000000000000000000000..679d3b98ace1a9f868f7f05b4ea0642056df065c Binary files /dev/null and b/CellFrameDashboardGUI/res/icons/ic_flag.png differ diff --git a/CellFrameDashboardGUI/res/icons/sell_icon.png b/CellFrameDashboardGUI/res/icons/sell_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..bf39ea660064efbbf5708841662ee5a6b50aa971 Binary files /dev/null and b/CellFrameDashboardGUI/res/icons/sell_icon.png differ diff --git a/CellFrameDashboardGUI/screen/desktop/Exchange/DapExchangeRightPanelForm.ui.qml b/CellFrameDashboardGUI/screen/desktop/Exchange/DapExchangeRightPanelForm.ui.qml index 30854206e6f566b91165ea20266419ec6970da86..67cd44497c5d67ae7013b7feb78821aa8175238f 100644 --- a/CellFrameDashboardGUI/screen/desktop/Exchange/DapExchangeRightPanelForm.ui.qml +++ b/CellFrameDashboardGUI/screen/desktop/Exchange/DapExchangeRightPanelForm.ui.qml @@ -3,7 +3,7 @@ import "../../" DapAbstractRightPanel { - dapFrame.color: "yellow" + visible: false } /*##^## diff --git a/CellFrameDashboardGUI/screen/desktop/Exchange/DapExchangeScreen.qml b/CellFrameDashboardGUI/screen/desktop/Exchange/DapExchangeScreen.qml index e3fb119f13ce3cdb71f114d48b2af96baa796a23..d522f19abbdd78238ddbaf43db55cc74d2092714 100644 --- a/CellFrameDashboardGUI/screen/desktop/Exchange/DapExchangeScreen.qml +++ b/CellFrameDashboardGUI/screen/desktop/Exchange/DapExchangeScreen.qml @@ -1,4 +1,645 @@ import QtQuick 2.4 +import QtQuick.Controls 2.0 +import QtQuick.Layouts 1.0 +import "qrc:/widgets" -DapExchangeScreenForm { + +DapExchangeScreenForm +{ + ListModel{ + id:candleModel + ListElement{time:1546543400;minimum:10000;maximum:10550;open:10050;close:10100;} + ListElement{time:1546543700;minimum:10200;maximum:10450;open:10350;close:10400;} + ListElement{time:1546544000;minimum:10200;maximum:10450;open:10350;close:10400;} + ListElement{time:1546544300;minimum:10200;maximum:10450;open:10350;close:10400;} + ListElement{time:1546544600;minimum:10200;maximum:10450;open:10350;close:10400;} + ListElement{time:1546544900;minimum:10200;maximum:10450;open:10350;close:10400;} + ListElement{time:1546545200;minimum:10200;maximum:10450;open:10350;close:10400;} + ListElement{time:1546545500;minimum:10200;maximum:10450;open:10350;close:10400;} + ListElement{time:1546545800;minimum:10200;maximum:10450;open:10350;close:10400;} + ListElement{time:1546546100;minimum:10200;maximum:10450;open:10350;close:10400;} + ListElement{time:1546546400;minimum:10200;maximum:10450;open:10350;close:10400;} + ListElement{time:1546546700;minimum:10300;maximum:10550;open:10450;close:10400;} + ListElement{time:1546547000;minimum:10200;maximum:10650;open:10350;close:10400;} + ListElement{time:1546547300;minimum:10200;maximum:10450;open:10350;close:10400;} + ListElement{time:1546547600;minimum:10200;maximum:10450;open:10350;close:10400;} + ListElement{time:1546547900;minimum:10200;maximum:10450;open:10350;close:10400;} + ListElement{time:1546548200;minimum:10200;maximum:10450;open:10350;close:10400;} + ListElement{time:1546548500;minimum:10200;maximum:10450;open:10350;close:10400;} + ListElement{time:1546548800;minimum:10200;maximum:10450;open:10350;close:10400;} + ListElement{time:1546549100;minimum:10200;maximum:10450;open:10350;close:10400;} + ListElement{time:1546549400;minimum:10300;maximum:10650;open:10450;close:10400;} + ListElement{time:1546549700;minimum:10200;maximum:10450;open:10350;close:10400;} + ListElement{time:1546550000;minimum:10200;maximum:10450;open:10350;close:10400;} + ListElement{time:1546550300;minimum:10200;maximum:10450;open:10350;close:10400;} + ListElement{time:1546550600;minimum:10200;maximum:10450;open:10350;close:10400;} + ListElement{time:1546550900;minimum:10500;maximum:10650;open:10550;close:10580;} + ListElement{time:1546551200;minimum:10200;maximum:10450;open:10350;close:10400;} + ListElement{time:1546551500;minimum:10200;maximum:10450;open:10350;close:10400;} + ListElement{time:1546551800;minimum:10200;maximum:10450;open:10350;close:10400;} + ListElement{time:1546552100;minimum:10200;maximum:10450;open:10350;close:10400;} + ListElement{time:1546552400;minimum:10200;maximum:10450;open:10350;close:10400;} + ListElement{time:1546552700;minimum:10200;maximum:10450;open:10350;close:10400;} + ListElement{time:1546553000;minimum:10200;maximum:10450;open:10350;close:10400;} + ListElement{time:1546553300;minimum:10200;maximum:10450;open:10350;close:10400;} + ListElement{time:1546553600;minimum:10650;maximum:10950;open:10800;close:10750;} + ListElement{time:1546553900;minimum:10200;maximum:10450;open:10350;close:10400;} + ListElement{time:1546554200;minimum:10200;maximum:10450;open:10350;close:10400;} + ListElement{time:1546554500;minimum:10200;maximum:10450;open:10350;close:10400;} + ListElement{time:1546554800;minimum:10200;maximum:10450;open:10350;close:10400;} + } + //=====================================DapChartCandleStick========================================================= + Component + { + id:candleChart + + + Canvas + { + + id: chartCanvas + + //@detalis rightTime Indicates the completion time of the graph on the display. + property var rightTime: 1546564800 + ///@detalis maxXLine Indicates the maximum number of vertical lines. + property int maxXLine: 6 + ///@detalis maxYLine Indicates the maximum number of horisontal lines. + property int maxYLine: 10 + ///@detalis heightNoLine Indicates an indentation at the top where horizontal lines are not displayed. + property int heightNoLine: 40*pt + ///@detalis marginHorizontalLineToYAxisText Indicates the indent between text and lines. + property int marginHorizontalLineToYAxisText:14 * pt + ///@detalis rightTextField Width of the right text box. + property int rightTextField: 31 * pt + ///@detalis bottomOutLine The height of the line protrusion below the graph field. + property int bottomOutLine: 4 * pt + ///@detalis fontColorArea Axial font color. + property string fontColorArea: "#757184" + ///@detalis fontSizeArea Size font. + property int fontSizeArea: 10 * pt + ///@detalis topMarginXAxisText Indicates the indent between text and lines. + property int topMarginXAxisText: 8 * pt + ///@detalis lineColorArea Line color. + property string lineColorArea: "#C7C6CE" + ///@detalis lineWidthArea Width color. + property int lineWidthArea: 1 + ///@detalis candleColorUp Bull color. + property string candleColorUp:"#6F9F00" + ///@detalis candleColorDown Bear candle color + property string candleColorDown:"#EB4D4B" + ///@detalis candleWidthLine Width candle. + property int candleWidthLine: 1 * pt + ///@detalis candleWidth Width body candle. + property int candleWidth: 5 * pt + ///@detalis imageCursorPath Path icon flug current. + property string imageCursorPath: "qrc:/res/icons/ic_flag.png" + ///@detalis imageCursorWidth Width icon. + property int imageCursorWidth: 44 * pt + ///@detalis imageCursorHeight Height icon. + property int imageCursorHeight: 16 * pt + ///@detalis colorCursorLine Cursor line color. + property string colorCursorLine:"#070023" + ///@detalis colorCursorFont Cursor font color. + property string colorCursorFont: "#FFFFFF" + ///@detalis fontSizeCursor Cursor font size. + property int fontSizeCursor: 10*pt + ///@detalis currentValue Current value price. + property int currentValue: 10236 + ///@detalis stepTime Time step for vertical line. + property int stepTime:thisProperty.hour + ///@detalis cashCandle The number of candles outside the screen from the right and left. + property int cashCandle: 5 + ///@detalis isRightTimeCurrent Graphic redraw resolution for offset + property bool isRightTimeCurrent: false + ///@detalis moveTimeForVisual Time offset for visualization of vertical stripes + property var moveTimeForVisual: 20*thisProperty.minute + ///@detalis currentValueTime Data update time for the current price value. + property alias currentValueTime:currentTimer.interval + ///@detalis timeReloadCanvas Screen refresh time when the graph is shifted. + property alias timeReloadCanvas:moveTimer.interval + + //For private values. + QtObject + { + id: thisProperty + ///@detalis minValuePrice Axis minimum value. + property int minValuePrice: 10000 + ///@detalis maxValuePrice Axis maximum value. + property int maxValuePrice: 10800 + //Graphics working field. + ///@detalis fieldXMin Minimum value x. + property int fieldXMin: 0 + ///@detalis fieldXMax Maximum value x. + property int fieldXMax: 100 + ///@detalis fieldYMin Minimum value y. + property int fieldYMin: 0 + ///@detalis fieldYMax Maximum value y. + property int fieldYMax: 100 + //Variables for setting time. + //Year. + property int year: 31556926; + //Month. + property int month: 2629743; + //Week. + property int week: 604800; + //Day. + property int day: 86400; + //Hour. + property int hour: 3600; + //Minute. + property int minute: 60; + ///@detalis yRealFactor Coordinate multiplier y. + property var yRealFactor: 0.0 + ///@detalis xRealFactor Coordinate multiplier x. + property var xRealFactor: 0.0 + ///@detalis intervalPrice The gap between the minimum and maximum values on the y axis. + property var intervalPrice: 0.0 + ///@detalis positionMouseX Temporarily remembers the position of the mouse to calculate the offset. + property int positionMouseX:0 + ///@detalis modelCountMin The minimum value of the counter for the passage of values (constantly recounted). + property int modelCountMin: 0 + ///@detalis modelCountMax The maximum value of the counter for the passage of values (constantly recounted). + property int modelCountMax: candleModel.count + ///@detalis currentTime Time current. + property var currentTime: new Date() + + } + + Component.onCompleted: + { + loadImage(imageCursorPath); + } + + onPaint: + { + canvasPaint(); + } + + //Price change timer. + Timer + { + id:currentTimer + repeat: true + interval: 10000 + onTriggered: + { + thisProperty.currentTime = new Date(); + if(isRightTimeCurrent)rightTime = thisProperty.currentTime; + canvasPaint(); + } + } + + MouseArea + { + id:areaCanvas + anchors.fill: parent + + //Image refresh timer. + Timer + { + id:moveTimer + repeat: true + interval: 30 + onTriggered: + { + if(rightTime < thisProperty.currentTime) + { + rightTime = rightTime + (thisProperty.positionMouseX-areaCanvas.mouseX)*thisProperty.xRealFactor; + canvasPaint(); + thisProperty.positionMouseX = areaCanvas.mouseX + isRightTimeCurrent = true; + } + else + { var tmpRightTime = (thisProperty.positionMouseX-areaCanvas.mouseX)*thisProperty.xRealFactor; + if(tmpRightTime<0) + { + rightTime = rightTime + (thisProperty.positionMouseX-areaCanvas.mouseX)*thisProperty.xRealFactor; + canvasPaint(); + thisProperty.positionMouseX = areaCanvas.mouseX + isRightTimeCurrent = false; + } + } + } + } + + onPressed: + { + if(mouse.button === Qt.LeftButton) + { + thisProperty.positionMouseX = mouseX; + moveTimer.start(); + } + } + + onReleased: + { + moveTimer.stop(); + autoSetDisplayCandle(); + } + } + + //Drawing a graph on the screen. + function canvasPaint() + { + autoSetWidthPrice() + init(); + var ctx = getContext("2d"); + ctx.clearRect(0,0,parent.width,parent.height) + timeToXLineChart(ctx); + valuePriceYLineChart(ctx); + fillCandle(ctx); + chartCanvas.requestPaint(); + } + + //Configuring candlestick options for rendering. + function autoSetDisplayCandle() + { + var valueActualTime = stepTime*maxXLine; + var minTime = rightTime - valueActualTime; + var isFirst = false; + var isEnded = false; + var firstCandle = 0; + var endedCandle = thisProperty.modelCountMax; + for (var count = thisProperty.modelCountMin;count<thisProperty.modelCountMax;count++) + { + if(!isFirst | minTime > candleModel.get(count).time) + { + isFirst = true; + if(count>10)thisProperty.modelCountMin = count-cashCandle; + else thisProperty.modelCountMin = 0; + } + if(!isEnded | rightTime>candleModel.get(count).time) + { + isEnded = true; + if(count < candleModel.count-10)thisProperty.modelCountMax = count+cashCandle; + else thisProperty.modelCountMax = candleModel.count; + } + } + } + + ///Auto selection of the lower and upper limit. + function autoSetWidthPrice() + { + autoSetDisplayCandle(); + var minPrice = candleModel.get(thisProperty.modelCountMin).minimum; + var maxPrice = candleModel.get(thisProperty.modelCountMin).maximum; + + for(var count = thisProperty.modelCountMin; count < thisProperty.modelCountMax; count++) + { + + if(minPrice > candleModel.get(count).minimum) minPrice = candleModel.get(count).minimum; + if(maxPrice < candleModel.get(count).maximum) maxPrice = candleModel.get(count).maximum; + } + if(currentValue>maxPrice)maxPrice=currentValue; + if(currentValue<minPrice)minPrice=currentValue; + thisProperty.maxValuePrice = maxPrice; + thisProperty.minValuePrice = minPrice; + } + + ///Initiation property. + function init() + { + thisProperty.fieldYMin = imageCursorHeight/2; + thisProperty.fieldXMax = chartCanvas.width - rightTextField - marginHorizontalLineToYAxisText; + thisProperty.fieldYMax = chartCanvas.height - fontSizeArea - topMarginXAxisText - bottomOutLine; + thisProperty.intervalPrice = thisProperty.maxValuePrice - thisProperty.minValuePrice; + thisProperty.yRealFactor = thisProperty.intervalPrice / (thisProperty.fieldYMax - thisProperty.fieldYMin); + thisProperty.xRealFactor = (stepTime*maxXLine)/(thisProperty.fieldXMax-thisProperty.fieldXMin); + } + + //Time conversion. + function timeToXChart(TimeX) + { + var a = new Date(TimeX * 1000); + var hour = a.getHours(); + if(hour<10)hour = '0'+hour; + var min = a.getMinutes(); + if(min<10)min='0'+min; + var time = hour + ':' + min; + return time; + } + + //X grid calculation and drawing. + function timeToXLineChart(ctx) + { + for(var count = 0; count < maxXLine; count++) + { + var timeRound = rightTime%stepTime + var timeLine = rightTime - (stepTime*count)-timeRound; + var timeXAxis = ((stepTime * count) + timeRound + moveTimeForVisual)/thisProperty.xRealFactor; + verticalLineChart(ctx,thisProperty.fieldXMax - timeXAxis,timeToXChart(timeLine + moveTimeForVisual)); + } + } + + //Y grid calculation and drawing. + function valuePriceYLineChart(ctx) + { + var realInterval = (thisProperty.fieldYMax - thisProperty.fieldYMin)/maxYLine; + var stepPrise = 10; + + for(var scanStep = 1; scanStep < 100000;scanStep*=10) + { + if(thisProperty.intervalPrice /scanStep <= maxYLine) {stepPrise = scanStep; break;} + if(thisProperty.intervalPrice /(scanStep*5) <= maxYLine) {stepPrise = scanStep*5;break;} + } + for(var count = 0; count<maxYLine;count++) + { + if(count === 0) + { + horizontalLineChart(ctx,thisProperty.fieldYMax,""); + } + else + if(thisProperty.fieldYMax-((stepPrise*count/thisProperty.yRealFactor))>heightNoLine) + { + var stepTo = stepPrise*count - thisProperty.minValuePrice%stepPrise; + horizontalLineChart(ctx,thisProperty.fieldYMax-((stepTo/thisProperty.yRealFactor)),thisProperty.minValuePrice+stepTo); + } + } + horizontalLineCurrentLevelChart(ctx,thisProperty.fieldYMax - (currentValue - thisProperty.minValuePrice)/thisProperty.yRealFactor,currentValue); + } + + //Candle drawing. + function fillCandle(ctx) + { + + for(var count = thisProperty.modelCountMin; count< thisProperty.modelCountMax ; count++) + { + + candleVisual(ctx,candleModel.get(count).time,candleModel.get(count).minimum, + candleModel.get(count).maximum,candleModel.get(count).open,candleModel.get(count).close); + } + } + + //Vertical line draw. + function verticalLineChart(ctx,x,text) + { + ctx.beginPath() + ctx.lineWidth = lineWidthArea; + ctx.strokeStyle = lineColorArea; + ctx.moveTo(x, chartCanvas.height-fontSizeArea-topMarginXAxisText); + ctx.lineTo(x, thisProperty.fieldYMin); + ctx.font = "normal "+fontSizeArea+ "px Roboto"; + ctx.fillStyle = fontColorArea; + ctx.fillText(text,x-13,chartCanvas.height); + ctx.stroke(); + } + + //horizontal line draw. + function horizontalLineChart(ctx,y,text) + { + ctx.beginPath(); + //ctx.save(); + ctx.lineWidth = lineWidthArea; + ctx.strokeStyle = lineColorArea; + ctx.moveTo(thisProperty.fieldXMax, y); + ctx.lineTo(0, y); + ctx.font = "normal "+fontSizeArea+ "px Roboto"; + ctx.fillStyle = fontColorArea; + ctx.fillText(text,chartCanvas.width - rightTextField,y+3); + ctx.stroke(); + } + + //Candle draw. + function candleVisual(ctx,pointTime,minimum,maximum,open,close) + { + var timeXAxis = thisProperty.fieldXMax-(rightTime-pointTime)/thisProperty.xRealFactor; + if(thisProperty.fieldXMax>timeXAxis) + { + ctx.beginPath() + ctx.lineWidth = candleWidthLine; + if(open < close) + { + ctx.strokeStyle = candleColorUp; + ctx.fillStyle = candleColorUp; + }else + { + ctx.strokeStyle = candleColorDown; + ctx.fillStyle = candleColorDown; + } + + ctx.moveTo(timeXAxis,getYValue(minimum)); + ctx.lineTo(timeXAxis, getYValue(maximum)); + ctx.moveTo(timeXAxis-(candleWidth/2), getYValue(open)); + ctx.lineTo(timeXAxis-(candleWidth/2), getYValue(close)); + ctx.lineTo(timeXAxis+(candleWidth/2), getYValue(close)); + ctx.lineTo(timeXAxis+(candleWidth/2), getYValue(open)); + ctx.lineTo(timeXAxis-(candleWidth/2), getYValue(open)); + ctx.stroke(); + ctx.fill(); + } + } + + //Converting Values to Coordinates. + function getYValue(value) + { + return thisProperty.fieldYMax - (value - thisProperty.minValuePrice)/thisProperty.yRealFactor; + } + + //Draw a line with the current value. + function horizontalLineCurrentLevelChart(ctx,y,text) + { + ctx.beginPath() + ctx.lineWidth = lineWidthArea; + ctx.strokeStyle = colorCursorLine; + ctx.moveTo(0, y); + ctx.lineTo(chartCanvas.width - imageCursorWidth + 4, y); + ctx.drawImage(imageCursorPath, chartCanvas.width-imageCursorWidth, y-imageCursorHeight/2,imageCursorWidth,imageCursorHeight); + ctx.font = "normal " +fontSizeCursor+ "px Roboto"; + ctx.fillStyle = colorCursorFont; + ctx.fillText(text,chartCanvas.width - rightTextField - (5*pt),y+imageCursorHeight/5); + ctx.stroke(); + chartCanvas.requestPaint(); + } + + } + } +///===============================DapChartCandleStick================================================================ + +///===============================DapUiQmlWidgetChainExchanges======================================================= + + Component + { + id: delegateOrderPanel + ///Order panel + Item + { + + ///@detalis currencyName + property string currencyName: qsTr("KLVN") + ///@detalis balance Balance. + property string balance: "0" + ///@detalis fontStyleOrder Font style. + property string fontStyleOrder: "Roboto" + width: 312 * pt + height: 292 * pt + + ColumnLayout + { + anchors.top: parent.top + anchors.topMargin: 16 * pt + + ///The header of the panel + Item + { + width: childrenRect.width + height: childrenRect.height + + RowLayout + { + spacing: 8 * pt + Rectangle + { + width: 32 + height: 32 + + Image + { + source: path + anchors.fill: parent + } + } + + Text + { + color: "#4F5357" + font.pixelSize: 14 * pt + font.family: fontStyleOrder + font.bold: true + text: titleOrder + } + } + } + + Text + { + text: qsTr("Balance: ") + balance + " " + currencyName + color: "#ACACAF" + font.family: "Roboto" + font.pixelSize: 12 * pt + } + + Rectangle + { + width: parent.width + height: 6 * pt + + } + + + Item + { + width: childrenRect.width + height: childrenRect.height + + ///Input fields via repeater + ColumnLayout + { + spacing: 16 * pt + + Repeater + { + model: [qsTr("Ammount"), qsTr("Price"), qsTr("Total"), qsTr("Fee (0.2%)"), qsTr("Total+Fee")] + RowLayout + { + spacing: 0 + Rectangle + { + height: childrenRect.height + width: 120 * pt + + Text + { + text: modelData + color: "#ACACAF" + font.family: fontStyleOrder + font.pixelSize: 12 * pt + } + } + + + Rectangle + { + width: 130 * pt + height: 22 * pt + border.width: 1 * pt + border.color: "#B0B1B5" + + TextInput + { + id: currencyTextInput + anchors.left: parent.left + anchors.top: parent.top + anchors.bottom: parent.bottom + anchors.right: textCurrency.left + anchors.leftMargin: 6 * pt + anchors.rightMargin: 6 * pt + color: readOnly ? "#ACACAF" : "#737880" + font.family: fontStyleOrder + font.pixelSize: 12 * pt + verticalAlignment: Qt.AlignVCenter + validator: RegExpValidator{ regExp: /\d+/ } + clip: true + readOnly: index === 3 || index === 4 + text: readOnly ? "0" : "" + } + + Text + { + id: textCurrency + anchors.right: parent.right + anchors.top: parent.top + anchors.bottom: parent.bottom + anchors.rightMargin: 6 * pt + verticalAlignment: Text.AlignVCenter + horizontalAlignment: Text.AlignRight + color: currencyTextInput.readOnly ? "#ACACAF" : "#737880" + font.family: fontStyleOrder + font.pixelSize: 12 * pt + text: index === 0 ? currencyName : qsTr("USD") + } + } + } + } + } + + } + + + Rectangle + { + height: 12 * pt + width: parent.width + } + ///Order button + DapButton + { + anchors.right: parent.right + textButton: titleOrder + widthButton: 130 * pt + heightButton: 30 * pt + fontButton.pixelSize: 13 * pt + colorBackgroundNormal: "#3E3853" + colorBackgroundHover: "#3E3853" + horizontalAligmentText:Qt.AlignHCenter + borderColorButton: "#000000" + borderWidthButton: 0 + fontButton.family: "Roboto" + fontButton.weight: Font.Normal + colorTextButton: "#FFFFFF" + + } + + } + } + + } + + + +///===============================DapUiQmlWidgetChainExchanges======================================================= +} +/*##^## +Designer { + D{i:0;autoSize:true;height:480;width:640} } +##^##*/ diff --git a/CellFrameDashboardGUI/screen/desktop/Exchange/DapExchangeScreenForm.ui.qml b/CellFrameDashboardGUI/screen/desktop/Exchange/DapExchangeScreenForm.ui.qml index 020f0bf98e06b658d7c94a246603f3c5290abb26..17dc8bc5f107d04a6f33af9734e33f8f48882ce7 100644 --- a/CellFrameDashboardGUI/screen/desktop/Exchange/DapExchangeScreenForm.ui.qml +++ b/CellFrameDashboardGUI/screen/desktop/Exchange/DapExchangeScreenForm.ui.qml @@ -1,7 +1,308 @@ import QtQuick 2.4 +import QtQuick.Controls 2.0 +import "qrc:/widgets" import "../../" DapAbstractScreen { - dapFrame.color: "magenta" + ///Top panel in tab Exchange + Rectangle + { + id: topPanelExchange + anchors.left: parent.left + anchors.right: parent.right + anchors.top: parent.top + anchors.leftMargin: 24 * pt + anchors.topMargin: 12 * pt + anchors.rightMargin: 24 * pt + height: 30 * pt + + ///Token ComboBox + Rectangle + { + id: leftComboBox + anchors.top: topPanelExchange.top + anchors.left: topPanelExchange.left + width: 112 * pt + height: parent.height + + DapComboBox + { + model: + ListModel + { + id: ÑonversionList + ListElement + { + text: "TKN1/NGD" + } + ListElement + { + text: "TKN2/NGD" + } + ListElement + { + text: "NGD/KLVN" + } + ListElement + { + text: "KLVN/USD" + } + } + widthPopupComboBoxActive: 144 * pt + widthPopupComboBoxNormal: 112 * pt + sidePaddingActive: 16 * pt + sidePaddingNormal: 0 + x: popup.visible ? sidePaddingActive * (-1) : sidePaddingNormal + heightComboBoxNormal: 24 * pt + heightComboBoxActive: 44 * pt + bottomIntervalListElement: 6 * pt + indicatorImageNormal: "qrc:/res/icons/ic_arrow_drop_down_dark_blue.png" + indicatorImageActive: "qrc:/res/icons/ic_arrow_drop_up_dark_blue.png" + fontComboBox.pixelSize: 16 * pt + fontComboBox.family: "Roboto" + normalColor: "#FFFFFF" + hilightColor: "#330F54" + normalTopColor: "#FFFFFF" + hilightTopColor: normalTopColor + normalColorText: "#070023" + hilightColorText: "#FFFFFF" + normalColorTopText: "#070023" + hilightColorTopText: "#070023" + paddingTopItemDelegate: 8 * pt + heightListElement: 32 * pt + intervalListElement: 10 * pt + indicatorWidth: 24 * pt + indicatorHeight: indicatorWidth + indicatorLeftInterval: 8 * pt + colorTopNormalDropShadow: "#00000000" + colorDropShadow: "#40ABABAB" + topEffect: true + } + } + + ///Time ComboBox + Rectangle + { + id: rightComboBox + anchors.left: leftComboBox.right + anchors.leftMargin: 72 * pt + anchors.top: topPanelExchange.top + width: 100 * pt + height: parent.height + DapComboBox + { + model: + ListModel + { + ListElement + { + text: "1 minute" + } + ListElement + { + text: "5 minute" + } + ListElement + { + text: "15 minute" + } + ListElement + { + text: "30 minute" + } + ListElement { + text: "1 hour" + } + ListElement + { + text: "4 hour" + } + ListElement + { + text: "12 hour" + } + ListElement + { + text: "24 hour" + } + } + + widthPopupComboBoxActive: 132 * pt + widthPopupComboBoxNormal: 100 * pt + sidePaddingActive: 16 * pt + sidePaddingNormal: 0 + x: popup.visible ? sidePaddingActive * (-1) : sidePaddingNormal + heightComboBoxNormal: 24 * pt + heightComboBoxActive: 44 * pt + bottomIntervalListElement: 6 * pt + indicatorImageNormal: "qrc:/res/icons/ic_arrow_drop_down_dark_blue.png" + indicatorImageActive: "qrc:/res/icons/ic_arrow_drop_up_dark_blue.png" + fontComboBox.pixelSize: 14 * pt + fontComboBox.family: "Roboto" + normalColor: "#FFFFFF" + hilightColor: "#330F54" + normalTopColor: "#FFFFFF" + hilightTopColor: normalTopColor + normalColorText: "#070023" + hilightColorText: "#FFFFFF" + normalColorTopText: "#070023" + hilightColorTopText: "#070023" + paddingTopItemDelegate: 8 * pt + heightListElement: 32 * pt + intervalListElement: 10 * pt + indicatorWidth: 24 * pt + indicatorHeight: indicatorWidth + indicatorLeftInterval: 8 * pt + colorTopNormalDropShadow: "#00000000" + colorDropShadow: "#40ABABAB" + topEffect: true + } + } + + ///Value Last price + Rectangle + { + id: lastPrice + height: parent.height + width: 150 * pt + anchors.right: volume24.left + anchors.rightMargin: 30 * pt + + Text + { + anchors.left: lastPrice.left + anchors.bottom: value_lastPrice.top + anchors.bottomMargin: 6 * pt + color: "#757184" + font.pixelSize: 10 * pt + font.family: "Roboto" + text: qsTr("Last price") + } + Text + { + id: value_lastPrice + anchors.left: lastPrice.left + anchors.bottom: lastPrice.bottom + color: "#070023" + font.pixelSize: 12 * pt + font.family: "Roboto" + text: qsTr("$ 10 807.35 NGD") + } + Text + { + anchors.left: value_lastPrice.right + anchors.bottom: lastPrice.bottom + anchors.leftMargin: 6 * pt + color: "#6F9F00" + font.pixelSize: 10 * pt + font.family: "Roboto" + text: qsTr("+3.59%") + } + } + ///Value 24h volume + Rectangle + { + id: volume24 + + height: parent.height + width: 75 * pt + anchors.right: topPanelExchange.right + + Text + { + anchors.right: volume24.right + anchors.bottom: value_valume24.top + anchors.bottomMargin: 6 * pt + color: "#757184" + font.pixelSize: 10 * pt + font.family: "Roboto" + text: qsTr("24h volume") + } + Text + { + id: value_valume24 + anchors.right: volume24.right + anchors.bottom: volume24.bottom + color: "#070023" + font.pixelSize: 12 * pt + font.family: "Roboto" + text: qsTr("9 800 TKN1") + } + } + } + + ///Candlestick chart loader + Loader + { + id: loaderCandleStick + sourceComponent: candleChart + anchors.top: topPanelExchange.bottom + anchors.left: parent.left + anchors.right:parent.right + anchors.leftMargin: 24 * pt + anchors.rightMargin: 24 * pt + anchors.topMargin: 16 * pt + height: 282 * pt + } + + ///Dividing horizontal line + Rectangle + { + id:horizontalLine + anchors.top: loaderCandleStick.bottom + anchors.topMargin: 24 * pt + height: 1*pt + width: parent.width + color: "#E3E2E6" + } + ///Model with a list of orders + ListModel + { + id: orderModel + ListElement{titleOrder:"Buy"; path:"qrc:/res/icons/buy_icon.png"} + ListElement{titleOrder:"Sell"; path:"qrc:/res/icons/sell_icon.png"} + } + ///Left down panel + Rectangle + { + id:exchangeBottomPanel + anchors.top: horizontalLine.bottom + anchors.right: parent.right + anchors.left: parent.left + anchors.bottom: parent.bottom + anchors.leftMargin: 24 * pt + anchors.rightMargin: 24 * pt + ///List of orders + ListView + { + id: orderListView + anchors.left: parent.left + anchors.top: parent.top + anchors.bottom: parent.bottom + orientation: ListView.Horizontal + interactive: false + model: orderModel + delegate: delegateOrderPanel + width: childrenRect.width + } + ///Dividing vertical line + Rectangle + { + id:verticalLine + anchors.left: orderListView.right + height: parent.height + width: 1 * pt + color: "#E3E2E6" + } + ///frame for the history widget + Rectangle + { + width:430 * pt + anchors.top: parent.top + anchors.bottom: parent.bottom + anchors.left: verticalLine.right + anchors.right: parent.right + } + } } diff --git a/CellFrameDashboardGUI/screen/desktop/Exchange/DapExchangeTopPanelForm.ui.qml b/CellFrameDashboardGUI/screen/desktop/Exchange/DapExchangeTopPanelForm.ui.qml index 4684bbd8e0d2e4b43855ef20c2f7051699a8665b..0917d206a7ce7d402e776663af456b89dbfd8481 100644 --- a/CellFrameDashboardGUI/screen/desktop/Exchange/DapExchangeTopPanelForm.ui.qml +++ b/CellFrameDashboardGUI/screen/desktop/Exchange/DapExchangeTopPanelForm.ui.qml @@ -1,9 +1,98 @@ import QtQuick 2.4 +import QtQuick.Controls 2.0 +import "qrc:/widgets" import "../../" DapAbstractTopPanelForm { + anchors.fill: parent + // Static text "Wallet" + Label + { + id: textHeaderWallet + text: qsTr("Wallet") + anchors.left: parent.left + anchors.leftMargin: 24 * pt + anchors.verticalCenter: parent.verticalCenter + font.family: "Roboto" + font.pixelSize: 12 * pt + color: "#ACAAB5" + } + + // Wallet selection combo box + Rectangle + { + id: frameComboBox + + anchors.left: textHeaderWallet.right + anchors.verticalCenter: parent.verticalCenter + anchors.leftMargin: 30 * pt + width: 148 * pt + color: "transparent" + + DapComboBox + { + id: comboboxWallet + //model: modelWallets + indicatorImageNormal: "qrc:/res/icons/ic_arrow_drop_down.png" + indicatorImageActive: "qrc:/res/icons/ic_arrow_drop_up.png" + sidePaddingNormal: 0 * pt + sidePaddingActive: 16 * pt + normalColorText: "#070023" + hilightColorText: "#FFFFFF" + normalColorTopText: "#FFFFFF" + hilightColorTopText: "#070023" + hilightColor: "#330F54" + normalTopColor: "#070023" + widthPopupComboBoxNormal: 148 * pt + widthPopupComboBoxActive: 180 * pt + heightComboBoxNormal: 24 * pt + heightComboBoxActive: 44 * pt + bottomIntervalListElement: 8 * pt + topEffect: false + x: popup.visible ? sidePaddingActive * (-1) : sidePaddingNormal + normalColor: "#FFFFFF" + hilightTopColor: normalColor + paddingTopItemDelegate: 8 * pt + heightListElement: 32 * pt + intervalListElement: 10 * pt + indicatorWidth: 24 * pt + indicatorHeight: indicatorWidth + indicatorLeftInterval: 8 * pt + colorTopNormalDropShadow: "#00000000" + colorDropShadow: "#40ABABAB" + fontComboBox.pixelSize: 14 * pt + fontComboBox.family: "Roboto" + + } + } + + // Static wallet balance text "Wallet balance" + Label + { + id: headerWalletBalance + text: qsTr("Wallet balance") + anchors.left: frameComboBox.right + anchors.leftMargin: 70 * pt + anchors.verticalCenter: parent.verticalCenter + font.family: "Roboto" + font.pixelSize: 12 * pt + color: "#ACAAB5" + } + + // Dynamic wallet balance text + Label + { + id: textWalletBalance + text: "$ 3 050 745.3453289 USD" + anchors.left: headerWalletBalance.right + anchors.leftMargin: 18 * pt + anchors.verticalCenter: parent.verticalCenter + font.family: "Roboto" + font.pixelSize: 16 * pt + color: "#FFFFFF" + } } diff --git a/libdap-qt-ui-qml b/libdap-qt-ui-qml index bca1afe6ba3bbf9ef85bfaa64b679d99265ea7e8..ab16ad669cfc09a69d071a88add98110d473010e 160000 --- a/libdap-qt-ui-qml +++ b/libdap-qt-ui-qml @@ -1 +1 @@ -Subproject commit bca1afe6ba3bbf9ef85bfaa64b679d99265ea7e8 +Subproject commit ab16ad669cfc09a69d071a88add98110d473010e