diff --git a/KelvinDashboardGUI/DapUiQmlScreenDashboard.qml b/KelvinDashboardGUI/DapUiQmlScreenDashboard.qml deleted file mode 100755 index 0d56a0eb4741d46c8e40c11228d7a015385b2eb9..0000000000000000000000000000000000000000 --- a/KelvinDashboardGUI/DapUiQmlScreenDashboard.qml +++ /dev/null @@ -1,187 +0,0 @@ -import QtQuick 2.9 -import QtQuick.Controls 1.4 -import QtQuick.Controls 2.2 -import QtQuick.Controls.Styles 1.4 - -Page { - id: dapUiQmlScreenDashboard - title: qsTr("General") - - Rectangle - { - id: rectangleTabsBorder - anchors.top: parent.top - anchors.bottom: parent.bottom - anchors.left: parent.left - color: "#B5B5B5" - width: 150 - Rectangle { - id: rectangleTabs - anchors.fill: parent - anchors.leftMargin: 1 - anchors.rightMargin: 1 - - color: "#E1E4E6" - ListView { - id: listViewTabs - anchors.fill: parent - model: listModelTabs - spacing: 3 - - ListModel { - id: listModelTabs - - ListElement { - name: qsTr("Home") - page: "DapUiQmlScreenDialog.qml" - source: "qrc:/Resources/Icons/defaul_icon.png" - } - ListElement { - name: qsTr("Exchange") - page: "DapUiQmlScreenExchangeForm.ui.qml" - source: "qrc:/Resources/Icons/defaul_icon.png" - } - ListElement { - name: qsTr("Settings") - page: "DapQmlScreenAbout.qml" - source: "qrc:/Resources/Icons/defaul_icon.png" - } - ListElement { - name: qsTr("Logs") - page: "DapUiQmlWidgetChainNodeLogs.qml" - source: "qrc:/Resources/Icons/defaul_icon.png" - } - ListElement { - name: qsTr("History") - page: "DapUiQmlScreenHistory.qml" - source: "qrc:/Resources/Icons/defaul_icon.png" - } - ListElement { - name: qsTr("About") - page: "DapQmlScreenAbout.qml" - source: "qrc:/Resources/Icons/defaul_icon.png" - } - } - - - - delegate: - Column { - id: componentTab - height: 148 - Rectangle { - id: componentItem - property bool isPushed: listViewTabs.currentIndex === index - - width: listViewTabs.width - height: 150 - color: "transparent" - Rectangle - { - id: spacerItem1 - height: 25 - anchors.top: parent.top - } - Image - { - id: imageItem - anchors.top: spacerItem1.bottom - source: model.source - height: 60 - width: 60 - anchors.horizontalCenter: parent.horizontalCenter - } - Rectangle - { - id: spacerItem2 - anchors.top: imageItem.bottom - height: 16 - } - Text - { - id: textItemMenu - anchors.top: spacerItem2.bottom - text: qsTr(name) - color: "#505559" - anchors.horizontalCenter: parent.horizontalCenter - font.family: "Roboto" - font.weight: componentItem.isPushed ? Font.Normal : Font.Light - font.pointSize: 16 - } - Rectangle - { - id: spacerItem3 - anchors.top: textItemMenu.bottom - height: 30 - } - MouseArea { - anchors.fill: parent - hoverEnabled: true - onEntered: - { - textItemMenu.font.weight = Font.Normal - if(!componentItem.isPushed) componentItem.color ="#B0B0B5" - } - onExited: - { - textItemMenu.font.weight = Font.Light - if(!componentItem.isPushed) componentItem.color = "transparent" - } - - onClicked: - { - listViewTabs.currentIndex = index - stackViewScreenDashboard.setSource(Qt.resolvedUrl(page)) - } - } - - onIsPushedChanged: { - componentItem.color = (isPushed ? "#D0D3D6" : "transparent"); - } - } - Rectangle - { - id: borderItem - height: 1 - color: "#B5B5B5" - width: parent.width - } - } - } - focus: true - } - } - - Rectangle - { - id: rectangleStatusBar - anchors.left: rectangleTabsBorder.right - anchors.top: parent.top - anchors.right: parent.right - color: "#B5B5B5" - height: 60 - Rectangle - { - anchors.fill: parent - anchors.bottomMargin: 1 - color: "#F2F2F4" - } - } - - Rectangle { - id: mainDashboard - anchors.left: rectangleTabsBorder.right - anchors.top: rectangleStatusBar.bottom - anchors.bottom: parent.bottom - anchors.right: parent.right - border.color: "whitesmoke" - - Loader { - id: stackViewScreenDashboard - clip: true - anchors.fill: parent - source: "DapUiQmlScreenDialog.qml" - } - } -} - diff --git a/KelvinDashboardGUI/DapUiQmlScreenExchangeForm.ui.qml b/KelvinDashboardGUI/DapUiQmlScreenExchangeForm.ui.qml index 6cf2560f0c3b019b5f4c217547c1cbe6f6d50e09..7e796a587da699b94c49f35573c5fa321f35e87b 100644 --- a/KelvinDashboardGUI/DapUiQmlScreenExchangeForm.ui.qml +++ b/KelvinDashboardGUI/DapUiQmlScreenExchangeForm.ui.qml @@ -12,13 +12,20 @@ Page { anchors.bottomMargin: 42 * pt spacing: 68 * pt - DapUiQmlWidgetExchangeOrder { + DapUiQmlWidgetExchangeOrderForm { titleOrder: qsTr("Buy") } - DapUiQmlWidgetExchangeOrder { + DapUiQmlWidgetExchangeOrderForm { titleOrder: qsTr("Sell") } } } + + + +/*##^## Designer { + D{i:0;autoSize:true;height:480;width:640} +} + ##^##*/ diff --git a/KelvinDashboardGUI/DapUiQmlScreenHistory.qml b/KelvinDashboardGUI/DapUiQmlScreenHistory.qml index 71473ee8c45de898c060d4ed2a2a5a36442f5b1a..286a6cd3ad28004095ed5eef44b9ce61855d5d81 100644 --- a/KelvinDashboardGUI/DapUiQmlScreenHistory.qml +++ b/KelvinDashboardGUI/DapUiQmlScreenHistory.qml @@ -5,19 +5,11 @@ import QtQuick.Layouts 1.12 import DapTransactionHistory 1.0 -Page { - ListView { - id: dapListView - anchors.fill: parent - model: dapHistoryModel - delegate: dapDelegate - section.property: "date" - section.criteria: ViewSection.FullString - section.delegate: dapDate - } +DapUiQmlScreenHistoryForm { + id: dapUiQmlScreenHistory Component { - id: dapDate + id: delDate Rectangle { width: dapListView.width height: 30 * pt @@ -36,8 +28,9 @@ Page { } } + Component { - id: dapDelegate + id: delegateD Column { Rectangle { @@ -249,4 +242,11 @@ Page { } } } + + +} + +/*##^## Designer { + D{i:0;autoSize:true;height:480;width:640} } + ##^##*/ diff --git a/KelvinDashboardGUI/DapUiQmlScreenHistoryForm.ui.qml b/KelvinDashboardGUI/DapUiQmlScreenHistoryForm.ui.qml new file mode 100644 index 0000000000000000000000000000000000000000..816540d0ccfdd2c934e4f46a29da607a4dde2af0 --- /dev/null +++ b/KelvinDashboardGUI/DapUiQmlScreenHistoryForm.ui.qml @@ -0,0 +1,18 @@ +import QtQuick 2.9 +import QtQml 2.12 +import QtQuick.Controls 2.2 +import QtQuick.Layouts 1.12 + +import DapTransactionHistory 1.0 + +Page { + ListView { + id: dapListView + anchors.fill: parent + model: dapHistoryModel + delegate: delegateD + section.property: "date" + section.criteria: ViewSection.FullString + section.delegate: delDate + } +} diff --git a/KelvinDashboardGUI/DapUiQmlScreenMainWindow.qml b/KelvinDashboardGUI/DapUiQmlScreenMainWindow.qml new file mode 100644 index 0000000000000000000000000000000000000000..3e3535ac0ec40c26713dd48fc2bec6f685182c7c --- /dev/null +++ b/KelvinDashboardGUI/DapUiQmlScreenMainWindow.qml @@ -0,0 +1,102 @@ +import QtQuick 2.9 +import QtQuick.Controls 1.4 + +DapUiQmlScreenMainWindowForm { + id: dapQmlScreenMainWindow + + Component{ + id: componentItemMainMenuTab + Column { + id: columnTab + height: 148 + Rectangle { + id: componentItem + property bool isPushed: listViewTabs.currentIndex === index + + width: listViewTabs.width + height: 150 + color: "transparent" + Rectangle + { + id: spacerItem1 + height: 25 + anchors.top: parent.top + } + Image + { + id: imageItem + anchors.top: spacerItem1.bottom + source: model.source + height: 60 + width: 60 + anchors.horizontalCenter: parent.horizontalCenter + } + Rectangle + { + id: spacerItem2 + anchors.top: imageItem.bottom + height: 16 + } + Text + { + id: textItemMenu + anchors.top: spacerItem2.bottom + text: qsTr(name) + color: "#505559" + anchors.horizontalCenter: parent.horizontalCenter + font.family: "Roboto" + font.weight: componentItem.isPushed ? Font.Normal : Font.Light + font.pointSize: 16 + } + Rectangle + { + id: spacerItem3 + anchors.top: textItemMenu.bottom + height: 30 + } + MouseArea { + anchors.fill: parent + hoverEnabled: true + onEntered: + { + textItemMenu.font.weight = Font.Normal + if(!componentItem.isPushed) componentItem.color ="#B0B0B5" + } + onExited: + { + textItemMenu.font.weight = Font.Light + if(!componentItem.isPushed) componentItem.color = "transparent" + } + + onClicked: + { + listViewTabs.currentIndex = index + stackViewScreenDashboard.setSource(Qt.resolvedUrl(page)) + } + } + + onIsPushedChanged: { + componentItem.color = (isPushed ? "#D0D3D6" : "transparent"); + } + } + Rectangle + { + id: borderItem + height: 1 + color: "#B5B5B5" + width: parent.width + } + } + } +} + + + + + + + +/*##^## Designer { + D{i:0;autoSize:true;height:480;width:640} +} + ##^##*/ diff --git a/KelvinDashboardGUI/DapUiQmlScreenMainWindow.ui.qml b/KelvinDashboardGUI/DapUiQmlScreenMainWindow.ui.qml deleted file mode 100644 index 4f6d67ec1377c3aaf98d75915fa1422af5ff32fd..0000000000000000000000000000000000000000 --- a/KelvinDashboardGUI/DapUiQmlScreenMainWindow.ui.qml +++ /dev/null @@ -1,8 +0,0 @@ -import QtQuick 2.9 -import QtQuick.Controls 1.4 -import QtQuick.Controls 2.2 - -Page { - - title: qsTr("General") -} diff --git a/KelvinDashboardGUI/DapUiQmlScreenMainWindowForm.ui.qml b/KelvinDashboardGUI/DapUiQmlScreenMainWindowForm.ui.qml new file mode 100644 index 0000000000000000000000000000000000000000..855645840a27e330e332fddd63199b1fa42c2718 --- /dev/null +++ b/KelvinDashboardGUI/DapUiQmlScreenMainWindowForm.ui.qml @@ -0,0 +1,117 @@ +import QtQuick 2.9 +import QtQuick.Controls 1.4 +import QtQuick.Controls 2.2 +import QtQuick.Controls.Styles 1.4 + +import KelvinDashboard 1.0 + +Page { + id: dapUiQmlScreenMainWindow + title: qsTr("General") + + property alias listViewTabs: listViewTabs + property alias stackViewScreenDashboard: stackViewScreenDashboard + + + Rectangle + { + id: rectangleTabsBorder + anchors.top: parent.top + anchors.bottom: parent.bottom + anchors.left: parent.left + color: "#B5B5B5" + width: 150 + Rectangle { + id: rectangleTabs + anchors.fill: parent + anchors.leftMargin: 1 + anchors.rightMargin: 1 + + color: "#E1E4E6" + ListView { + id: listViewTabs + anchors.fill: parent + model: listModelTabs + spacing: 3 + + ListModel { + id: listModelTabs + + ListElement { + name: qsTr("Dashboard") + page: "DapUiQmlScreenDialog.qml" + source: "qrc:/Resources/Icons/defaul_icon.png" + } + ListElement { + name: qsTr("Exchange") + page: "DapUiQmlScreenExchangeForm.ui.qml" + source: "qrc:/Resources/Icons/defaul_icon.png" + } + ListElement { + name: qsTr("Settings") + page: "DapQmlScreenAbout.qml" + source: "qrc:/Resources/Icons/defaul_icon.png" + } + ListElement { + name: qsTr("Logs") + page: "DapUiQmlWidgetChainNodeLogs.qml" + source: "qrc:/Resources/Icons/defaul_icon.png" + } + ListElement { + name: qsTr("History") + page: "DapUiQmlScreenHistory.qml" + source: "qrc:/Resources/Icons/defaul_icon.png" + } + ListElement { + name: qsTr("About") + page: "DapQmlScreenAbout.qml" + source: "qrc:/Resources/Icons/defaul_icon.png" + } + } + delegate: componentItemMainMenuTab + + } + focus: true + } + } + + Rectangle + { + id: rectangleStatusBar + anchors.left: rectangleTabsBorder.right + anchors.top: parent.top + anchors.right: parent.right + color: "#B5B5B5" + height: 60 + Rectangle + { + anchors.fill: parent + anchors.bottomMargin: 1 + color: "#F2F2F4" + } + } + + Rectangle { + id: mainDashboard + anchors.left: rectangleTabsBorder.right + anchors.top: rectangleStatusBar.bottom + anchors.bottom: parent.bottom + anchors.right: parent.right + border.color: "whitesmoke" + + Loader { + id: stackViewScreenDashboard + clip: true + anchors.fill: parent + source: "DapUiQmlScreenDialog.qml" + } + } +} + + + + +/*##^## Designer { + D{i:0;autoSize:true;height:480;width:640} +} + ##^##*/ diff --git a/KelvinDashboardGUI/DapUiQmlWidgetExchangeOrderButton.ui.qml b/KelvinDashboardGUI/DapUiQmlWidgetExchangeOrderButtonForm.ui.qml similarity index 100% rename from KelvinDashboardGUI/DapUiQmlWidgetExchangeOrderButton.ui.qml rename to KelvinDashboardGUI/DapUiQmlWidgetExchangeOrderButtonForm.ui.qml diff --git a/KelvinDashboardGUI/DapUiQmlWidgetExchangeOrderContent.ui.qml b/KelvinDashboardGUI/DapUiQmlWidgetExchangeOrderContentForm.ui.qml similarity index 97% rename from KelvinDashboardGUI/DapUiQmlWidgetExchangeOrderContent.ui.qml rename to KelvinDashboardGUI/DapUiQmlWidgetExchangeOrderContentForm.ui.qml index 78a5461c41c69881b502902d9f29820a56af9e37..3fc8fb2bbc03e42886f797da2c83e8e3f960c916 100644 --- a/KelvinDashboardGUI/DapUiQmlWidgetExchangeOrderContent.ui.qml +++ b/KelvinDashboardGUI/DapUiQmlWidgetExchangeOrderContentForm.ui.qml @@ -63,7 +63,7 @@ Item { color: currencyTextInput.readOnly ? "#ACACAF" : "#737880" font.family: fontExchange.name font.pixelSize: 12 * pt - text: index === 0 ? currencyName : "USD" + text: index === 0 ? currencyName : qsTr("USD") } } } diff --git a/KelvinDashboardGUI/DapUiQmlWidgetExchangeOrder.ui.qml b/KelvinDashboardGUI/DapUiQmlWidgetExchangeOrderForm.ui.qml similarity index 78% rename from KelvinDashboardGUI/DapUiQmlWidgetExchangeOrder.ui.qml rename to KelvinDashboardGUI/DapUiQmlWidgetExchangeOrderForm.ui.qml index 2a3bdecbb40ef2e9b27fd054892c6ac508217ae6..52ef1c08598c30086a323bae20531e9df866e5bb 100644 --- a/KelvinDashboardGUI/DapUiQmlWidgetExchangeOrder.ui.qml +++ b/KelvinDashboardGUI/DapUiQmlWidgetExchangeOrderForm.ui.qml @@ -5,7 +5,7 @@ import QtQuick.Layouts 1.12 Item { property alias titleOrder: orderTitle.orderText - property string currencyName: "KLVN" + property string currencyName: qsTr("KLVN") property string balance: "0" width: childrenRect.width @@ -18,13 +18,13 @@ Item { ColumnLayout { - DapUiQmlWidgetExchangeOrderTitle { + DapUiQmlWidgetExchangeOrderTitleForm { id: orderTitle orderFont: fontExchange.name } Text { - text: "Balance: " + balance + " " + currencyName + text: qsTr("Balance: ") + balance + " " + currencyName color: "#ACACAF" font.family: fontExchange.name font.pixelSize: 12 * pt @@ -36,7 +36,7 @@ Item { } - DapUiQmlWidgetExchangeOrderContent { + DapUiQmlWidgetExchangeOrderContentForm { contentFont: fontExchange.name } @@ -45,7 +45,7 @@ Item { width: parent.width } - DapUiQmlWidgetExchangeOrderButton { + DapUiQmlWidgetExchangeOrderButtonForm { buttonFont: fontExchange.name buttonText: titleOrder } diff --git a/KelvinDashboardGUI/DapUiQmlWidgetExchangeOrderTitle.ui.qml b/KelvinDashboardGUI/DapUiQmlWidgetExchangeOrderTitleForm.ui.qml similarity index 100% rename from KelvinDashboardGUI/DapUiQmlWidgetExchangeOrderTitle.ui.qml rename to KelvinDashboardGUI/DapUiQmlWidgetExchangeOrderTitleForm.ui.qml diff --git a/KelvinDashboardGUI/main.qml b/KelvinDashboardGUI/main.qml index 5fb41f07e5aa83c52a99947a036421c6769508d7..7a9e4cb62177127555645e9b6aed14705cf14b6b 100755 --- a/KelvinDashboardGUI/main.qml +++ b/KelvinDashboardGUI/main.qml @@ -17,10 +17,10 @@ ApplicationWindow { console.log("Close") window.hide() } - + Connections { target: dapServiceController - + onActivateWindow: { if(window.visibility === Window.Hidden) { window.show() @@ -30,7 +30,7 @@ ApplicationWindow { window.hide() } } - + // onErrorConnect: { // imageNetwork.visible = false // if(imageErrorNetwork.visible) @@ -38,15 +38,15 @@ ApplicationWindow { // else // imageErrorNetwork.visible = true // } - + // onConnectedToService: { // imageNetwork.visible = true // imageErrorNetwork.visible = false // console.log("Connected") // } } - - + + // header: // Column // { @@ -125,7 +125,7 @@ ApplicationWindow { // color: "green" // } // } - + Drawer { id: drawerMenu width: window.width * 0.3 @@ -197,7 +197,7 @@ ApplicationWindow { StackView { id: stackView - initialItem: "DapUiQmlScreenDashboard.qml" + initialItem: "DapUiQmlScreenMainWindow.qml" anchors.fill: parent } } diff --git a/KelvinDashboardGUI/qml.qrc b/KelvinDashboardGUI/qml.qrc index ba29b8fc130b5ec40a77da84a9c215befa103968..c5fbd286bdbebda49a7922eda9a5173bf3f449c7 100755 --- a/KelvinDashboardGUI/qml.qrc +++ b/KelvinDashboardGUI/qml.qrc @@ -1,8 +1,6 @@ <RCC> <qresource prefix="/"> <file>main.qml</file> - <file>DapUiQmlScreenDashboard.qml</file> - <file>DapUiQmlScreenMainWindow.ui.qml</file> <file>KelvinDashboardGUI.conf</file> <file>DapUiQmlWidgetChainBlockExplorer.ui.qml</file> <file>DapUiQmlWidgetChainExchanges.ui.qml</file> @@ -27,7 +25,6 @@ <file>DapUiQmlWidgetConsoleForm.ui.qml</file> <file>DapUiQmlWidgetConsole.qml</file> <file>DapUiQmlWidgetNodeNetworkExplorer.qml</file> - <file>DapUiQmlScreenHistory.qml</file> <file>Resources/Icons/defaul_icon.png</file> <file>DapUiQmlScreenExchangeForm.ui.qml</file> <file>Resources/Fonts/roboto_black.ttf</file> @@ -42,9 +39,13 @@ <file>Resources/Fonts/roboto_regular.ttf</file> <file>Resources/Fonts/roboto_thin.ttf</file> <file>Resources/Fonts/roboto_thin_italic.ttf</file> - <file>DapUiQmlWidgetExchangeOrder.ui.qml</file> - <file>DapUiQmlWidgetExchangeOrderTitle.ui.qml</file> - <file>DapUiQmlWidgetExchangeOrderContent.ui.qml</file> - <file>DapUiQmlWidgetExchangeOrderButton.ui.qml</file> + <file>DapUiQmlWidgetExchangeOrderForm.ui.qml</file> + <file>DapUiQmlWidgetExchangeOrderTitleForm.ui.qml</file> + <file>DapUiQmlWidgetExchangeOrderContentForm.ui.qml</file> + <file>DapUiQmlWidgetExchangeOrderButtonForm.ui.qml</file> + <file>DapUiQmlScreenHistory.qml</file> + <file>DapUiQmlScreenHistoryForm.ui.qml</file> + <file>DapUiQmlScreenMainWindow.qml</file> + <file>DapUiQmlScreenMainWindowForm.ui.qml</file> </qresource> </RCC>