From d70f714f35817c5e96885e807fc7591482327e94 Mon Sep 17 00:00:00 2001 From: xiphon Date: Thu, 13 Dec 2018 18:45:21 +0000 Subject: [PATCH] settings-node: use StandardButton instead of custom buttons --- pages/settings/SettingsNode.qml | 90 ++++++++------------------------- 1 file changed, 20 insertions(+), 70 deletions(-) diff --git a/pages/settings/SettingsNode.qml b/pages/settings/SettingsNode.qml index 8a7b3926..342b3422 100644 --- a/pages/settings/SettingsNode.qml +++ b/pages/settings/SettingsNode.qml @@ -300,9 +300,6 @@ Rectangle{ persistentSettings.remoteNodeAddress = remoteNodeEdit.getAddress(); console.log("setting remote node to " + persistentSettings.remoteNodeAddress) } - onTextChanged: { - rectConnectRemote.enabled = remoteNodeEdit.isValid(); - } } GridLayout { @@ -333,41 +330,21 @@ Rectangle{ } } - Rectangle { - id: rectConnectRemote - Layout.topMargin: 12 * scaleRatio + MoneroComponents.StandardButton { + id: btnConnectRemote enabled: remoteNodeEdit.isValid() - color: enabled ? MoneroComponents.Style.buttonBackgroundColor : MoneroComponents.Style.buttonBackgroundColorDisabled - width: btnConnectRemote.width + 40 - height: 26 - radius: 2 + small: true + text: qsTr("Connect") + translationManager.emptyString + onClicked: { + // Update daemon login + persistentSettings.remoteNodeAddress = remoteNodeEdit.getAddress(); + persistentSettings.daemonUsername = daemonUsername.text; + persistentSettings.daemonPassword = daemonPassword.text; + persistentSettings.useRemoteNode = true - Text { - id: btnConnectRemote - anchors.verticalCenter: parent.verticalCenter - anchors.horizontalCenter: parent.horizontalCenter - color: MoneroComponents.Style.defaultFontColor - font.family: MoneroComponents.Style.fontRegular.name - font.pixelSize: 14 * scaleRatio - font.bold: true - text: qsTr("Connect") + translationManager.emptyString - } + currentWallet.setDaemonLogin(persistentSettings.daemonUsername, persistentSettings.daemonPassword); - MouseArea { - cursorShape: Qt.PointingHandCursor - visible: rectConnectRemote.enabled - anchors.fill: parent - onClicked: { - // Update daemon login - persistentSettings.remoteNodeAddress = remoteNodeEdit.getAddress(); - persistentSettings.daemonUsername = daemonUsername.text; - persistentSettings.daemonPassword = daemonPassword.text; - persistentSettings.useRemoteNode = true - - currentWallet.setDaemonLogin(persistentSettings.daemonUsername, persistentSettings.daemonPassword); - - appWindow.connectRemoteNode() - } + appWindow.connectRemoteNode() } } } @@ -381,41 +358,14 @@ Rectangle{ anchors.right: parent.right visible: !isMobile && !persistentSettings.useRemoteNode - Rectangle { - color: "transparent" - Layout.topMargin: 0 * scaleRatio - Layout.bottomMargin: 8 * scaleRatio - Layout.preferredHeight: 24 * scaleRatio - Layout.preferredWidth: parent.width - - Rectangle { - id: rectStartStopNode - color: MoneroComponents.Style.buttonBackgroundColor - width: btnStartStopNode.width + 40 - height: 24 - radius: 2 - - Text { - id: btnStartStopNode - anchors.verticalCenter: parent.verticalCenter - anchors.horizontalCenter: parent.horizontalCenter - color: MoneroComponents.Style.defaultFontColor - font.family: MoneroComponents.Style.fontRegular.name - font.pixelSize: 14 * scaleRatio - font.bold: true - text: (appWindow.daemonRunning ? qsTr("Stop local node") : qsTr("Start daemon")) + translationManager.emptyString - } - - MouseArea { - cursorShape: Qt.PointingHandCursor - anchors.fill: parent - onClicked: { - if (appWindow.daemonRunning) { - appWindow.stopDaemon(); - } else { - appWindow.startDaemon(persistentSettings.daemonFlags); - } - } + MoneroComponents.StandardButton { + small: true + text: (appWindow.daemonRunning ? qsTr("Stop local node") : qsTr("Start daemon")) + translationManager.emptyString + onClicked: { + if (appWindow.daemonRunning) { + appWindow.stopDaemon(); + } else { + appWindow.startDaemon(persistentSettings.daemonFlags); } } }