From 84a60424efb90c680137294cb7338f41f8c9fe9d Mon Sep 17 00:00:00 2001 From: mmbyday Date: Sat, 15 Dec 2018 20:10:12 -0800 Subject: mining: add visual icon/indicator that mining is enabled, visible on all the screens --- components/NetworkStatusItem.qml | 36 ++++++++++++++++++++++++++++++------ 1 file changed, 30 insertions(+), 6 deletions(-) (limited to 'components/NetworkStatusItem.qml') diff --git a/components/NetworkStatusItem.qml b/components/NetworkStatusItem.qml index edc22595..965948bd 100644 --- a/components/NetworkStatusItem.qml +++ b/components/NetworkStatusItem.qml @@ -43,7 +43,7 @@ Rectangle { return qsTr("Synchronizing") if(appWindow.remoteNodeConnected) return qsTr("Remote node") - return qsTr("Connected") + return appWindow.isMining ? qsTr("Connected") + " + " + qsTr("Mining"): qsTr("Connected") } if (status == Wallet.ConnectionStatus_WrongVersion) return qsTr("Wrong version") @@ -69,16 +69,30 @@ Rectangle { Image { anchors.top: parent.top - anchors.topMargin: 6 + anchors.topMargin: !appWindow.isMining ? 6 * scaleRatio : 4 * scaleRatio anchors.right: parent.right - anchors.rightMargin: 11 + anchors.rightMargin: !appWindow.isMining ? 11 * scaleRatio : 0 source: { - if(item.connected == Wallet.ConnectionStatus_Connected){ + if(appWindow.isMining) { + return "../images/miningxmr.png" + } else if(item.connected == Wallet.ConnectionStatus_Connected) { return "../images/lightning.png" } else { return "../images/lightning-white.png" } } + MouseArea { + anchors.fill: parent + cursorShape: Qt.PointingHandCursor + onClicked: { + if(!appWindow.isMining) { + middlePanel.settingsView.settingsStateViewState = "Node"; + appWindow.showPageRequest("Settings"); + } else { + appWindow.showPageRequest("Mining") + } + } + } } } @@ -108,9 +122,19 @@ Rectangle { font.pixelSize: 20 * scaleRatio color: "white" text: getConnectionStatusString(item.connected) + translationManager.emptyString + MouseArea { + anchors.fill: parent + cursorShape: Qt.PointingHandCursor + onClicked: { + if(!appWindow.isMining) { + middlePanel.settingsView.settingsStateViewState = "Node"; + appWindow.showPageRequest("Settings"); + } else { + appWindow.showPageRequest("Mining") + } + } + } } } } - - } -- cgit v1.2.3