From c40944144abba11d97647ddab38309cf900a0130 Mon Sep 17 00:00:00 2001 From: Sander Ferdinand Date: Sat, 28 Apr 2018 16:40:01 +0200 Subject: [PATCH] Radio buttons for the welcome wizard --- components/RadioButton.qml | 7 +++++-- wizard/WizardOptions.qml | 19 +++++++------------ 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/components/RadioButton.qml b/components/RadioButton.qml index dbf8e865..083cb301 100644 --- a/components/RadioButton.qml +++ b/components/RadioButton.qml @@ -39,6 +39,9 @@ RowLayout { property alias fontColor: label.color signal clicked() height: 26 * scaleRatio + // legacy properties + property var checkedColor: "white" + property var borderColor: checked ? Qt.rgba(1, 1, 1, 0.35) : Qt.rgba(1, 1, 1, 0.25) function toggle(){ radioButton.checked = !radioButton.checked @@ -52,7 +55,7 @@ RowLayout { anchors.left: parent.left y: 0 color: "transparent" - border.color: radioButton.checked ? Qt.rgba(1, 1, 1, 0.35) : Qt.rgba(1, 1, 1, 0.25) + border.color: borderColor width: radioButton.height height: radioButton.height radius: radioButton.height @@ -61,7 +64,7 @@ RowLayout { visible: radioButton.checked anchors.horizontalCenter: parent.horizontalCenter anchors.verticalCenter: parent.verticalCenter - color: "white" + color: checkedColor width: 10 * scaleRatio height: 10 * scaleRatio radius: 10 diff --git a/wizard/WizardOptions.qml b/wizard/WizardOptions.qml index ef9a4d1c..b19a9559 100644 --- a/wizard/WizardOptions.qml +++ b/wizard/WizardOptions.qml @@ -227,9 +227,6 @@ ColumnLayout { wrapMode: Text.WordWrap } } - - - } ColumnLayout { @@ -238,18 +235,17 @@ ColumnLayout { Layout.topMargin: 30 * scaleRatio Layout.alignment: Qt.AlignCenter Layout.fillWidth: true - spacing: 50 * scaleRatio + spacing: 38 * scaleRatio Rectangle { width: 100 * scaleRatio - CheckBox { + RadioButton { id: testNet text: qsTr("Testnet") + translationManager.emptyString - background: "#FFFFFF" + checkedColor: Qt.rgba(0, 0, 0, 0.75) + borderColor: Qt.rgba(0, 0, 0, 0.45) fontColor: "#4A4646" fontSize: 16 * scaleRatio - checkedIcon: "../images/checkedBlackIcon.png" - uncheckedIcon: "../images/uncheckedIcon.png" checked: appWindow.persistentSettings.nettype == NetworkType.TESTNET; onClicked: { persistentSettings.nettype = testNet.checked ? NetworkType.TESTNET : NetworkType.MAINNET @@ -261,14 +257,13 @@ ColumnLayout { Rectangle { width: 100 * scaleRatio - CheckBox { + RadioButton { id: stageNet text: qsTr("Stagenet") + translationManager.emptyString - background: "#FFFFFF" + checkedColor: Qt.rgba(0, 0, 0, 0.75) + borderColor: Qt.rgba(0, 0, 0, 0.45) fontColor: "#4A4646" fontSize: 16 * scaleRatio - checkedIcon: "../images/checkedBlackIcon.png" - uncheckedIcon: "../images/uncheckedIcon.png" checked: appWindow.persistentSettings.nettype == NetworkType.STAGENET; onClicked: { persistentSettings.nettype = stageNet.checked ? NetworkType.STAGENET : NetworkType.MAINNET