-
Notifications
You must be signed in to change notification settings - Fork 50
Add and demo ConnectionSettings and ContinueButton components #101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// Copyright (c) 2022 The Bitcoin Core developers | ||
// Distributed under the MIT software license, see the accompanying | ||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||
|
||
import QtQuick 2.15 | ||
import QtQuick.Controls 2.15 | ||
import QtQuick.Layouts 1.15 | ||
import "../controls" | ||
|
||
ColumnLayout { | ||
spacing: 20 | ||
Setting { | ||
Layout.fillWidth: true | ||
header: "Use cellular data" | ||
} | ||
Setting { | ||
Layout.fillWidth: true | ||
header: "Daily upload limit" | ||
} | ||
Setting { | ||
Layout.fillWidth: true | ||
header: "Connection limit" | ||
} | ||
Setting { | ||
Layout.fillWidth: true | ||
header: "Listening enabled" | ||
description: "Reduces data usage." | ||
} | ||
Setting { | ||
last: true | ||
Layout.fillWidth: true | ||
header: "Blocks Only" | ||
description: "Do not transfer unconfirmed transactions. Also disabled listening." | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Copyright (c) 2022 The Bitcoin Core developers | ||
// Distributed under the MIT software license, see the accompanying | ||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||
|
||
import QtQuick 2.15 | ||
import QtQuick.Controls 2.15 | ||
|
||
Button { | ||
font.family: "Inter" | ||
font.styleName: "Semi Bold" | ||
font.pointSize: 18 | ||
contentItem: Text { | ||
text: parent.text | ||
font: parent.font | ||
color: "white" | ||
horizontalAlignment: Text.AlignHCenter | ||
verticalAlignment: Text.AlignVCenter | ||
} | ||
background: Rectangle { | ||
implicitHeight: 46 | ||
implicitWidth: 300 | ||
color: "#F7931A" | ||
radius: 5 | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Copyright (c) 2022 The Bitcoin Core developers | ||
// Distributed under the MIT software license, see the accompanying | ||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||
|
||
import QtQuick 2.15 | ||
import QtQuick.Controls 2.15 | ||
|
||
Switch { | ||
id: root | ||
indicator: Rectangle { | ||
implicitWidth: 45 | ||
implicitHeight: 28 | ||
x: root.leftPadding | ||
y: parent.height / 2 - height / 2 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Math.round((parent.height - height) / 2) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Addressed in #111 |
||
radius: 18 | ||
color: root.checked ? "#F7931A" : "#DDDDDD" | ||
Rectangle { | ||
id: indicatorButton | ||
y: parent.height / 2 - height / 2 | ||
x: root.checked ? parent.width - width - 4 : 0 + 4 | ||
width: 20 | ||
height: 20 | ||
radius: 18 | ||
color: "#ffffff" | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// Copyright (c) 2022 The Bitcoin Core developers | ||
// Distributed under the MIT software license, see the accompanying | ||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||
|
||
import QtQuick 2.15 | ||
import QtQuick.Controls 2.15 | ||
import QtQuick.Layouts 1.15 | ||
|
||
Control { | ||
id: root | ||
property bool last: false | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This could be automatic, here's a simple approach that doesn't take into account if property bool last: parent && root == parent.children[parent.children.length - 1] There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Addressed in #111 |
||
property string header | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Might want these required? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Addressed in #111 |
||
property string description | ||
contentItem: GridLayout { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not really a grid. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What would be a more appropriate Layout for it? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A ColumnLayout with a nested RowLayout |
||
columns: 2 | ||
rowSpacing: 20 | ||
width: parent.width | ||
Header { | ||
Layout.fillWidth: true | ||
center: false | ||
header: root.header | ||
headerSize: 18 | ||
description: root.description | ||
descriptionSize: 15 | ||
descriptionMargin: 0 | ||
} | ||
OptionSwitch { | ||
Layout.alignment: Qt.AlignRight | ||
} | ||
Loader { | ||
Layout.fillWidth:true | ||
Layout.columnSpan: 2 | ||
active: !last | ||
visible: active | ||
sourceComponent: Rectangle { | ||
height: 1 | ||
color: "#777777" | ||
} | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't forget about translations? Use
qsTr()
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed in #111