Files

220 lines
6.9 KiB
QML
Raw Permalink Normal View History

2021-11-03 13:33:49 +01:00
/*
* This file is part of the Flowee project
2024-02-12 19:19:01 +01:00
* Copyright (C) 2020-2024 Tom Zander <tom@flowee.org>
2021-11-03 13:33:49 +01:00
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
2022-11-26 10:46:57 +01:00
import QtQuick
2025-06-18 17:48:29 +02:00
import QtQuick.Controls.Basic as QQC2
2022-11-26 10:46:57 +01:00
import QtQuick.Layouts
2021-08-09 18:46:38 +02:00
2022-11-14 21:19:31 +01:00
import "../ControlColors.js" as ControlColors
import "../Flowee" as Flowee
2021-08-09 18:46:38 +02:00
2025-11-12 00:18:14 +01:00
Rectangle {
2021-08-09 18:46:38 +02:00
property string title: qsTr("Settings")
2021-11-02 19:38:36 +01:00
property string icon: "qrc:/settingsIcon-light.png"
2025-11-12 00:18:14 +01:00
color: palette.window
2021-08-09 18:46:38 +02:00
GridLayout {
columns: 3
2023-03-21 22:25:41 +01:00
rowSpacing: 10
columnSpacing: 6
2024-02-12 19:19:01 +01:00
width: parent.width
2025-01-09 18:24:58 +01:00
y: 10
2021-08-09 18:46:38 +02:00
2024-05-28 23:23:31 +02:00
Flowee.Label {
2021-08-09 18:46:38 +02:00
text: qsTr("Unit") + ":"
Layout.alignment: Qt.AlignRight
2021-08-09 18:46:38 +02:00
}
2021-11-03 13:33:49 +01:00
Flowee.ComboBox {
id: unitSelector
2021-08-09 18:46:38 +02:00
width: 210
model: {
var answer = [];
for (let i = 0; i < 5; ++i) {
2021-11-02 19:29:14 +01:00
answer[i] = Pay.nameOfUnit(i);
2021-08-09 18:46:38 +02:00
}
return answer;
}
2021-11-02 19:29:14 +01:00
currentIndex: Pay.unit
2021-11-03 13:33:49 +01:00
onCurrentIndexChanged: Pay.unit = currentIndex
2021-08-09 18:46:38 +02:00
}
2025-11-12 00:18:14 +01:00
Item {
2021-08-09 18:46:38 +02:00
implicitHeight: units.height + 10
implicitWidth: units.width + 10
2025-11-12 00:18:14 +01:00
Layout.fillWidth: true
2021-08-09 18:46:38 +02:00
GridLayout {
id: units
columns: 3
x: 5; y: 5
rowSpacing: 0
2024-05-28 23:23:31 +02:00
Flowee.Label {
2021-08-09 18:46:38 +02:00
text: {
var answer = "1";
2021-11-02 19:29:14 +01:00
for (let i = Pay.unitAllowedDecimals; i < 8; ++i) {
2021-08-09 18:46:38 +02:00
answer += "0";
}
2021-11-02 19:29:14 +01:00
return answer + " " + Pay.unitName;
2021-08-09 18:46:38 +02:00
}
Layout.alignment: Qt.AlignRight
}
2024-05-28 23:23:31 +02:00
Flowee.Label { text: "=" }
Flowee.Label { text: "1 Bitcoin Cash" }
2021-08-09 18:46:38 +02:00
2024-05-28 23:23:31 +02:00
Flowee.Label { text: "1 " + Pay.unitName; Layout.alignment: Qt.AlignRight; visible: Pay.isMainChain}
Flowee.Label { text: "="; visible: Pay.isMainChain}
Flowee.Label {
2021-08-09 18:46:38 +02:00
text: {
var amount = 1;
2021-11-02 19:29:14 +01:00
for (let i = 0; i < Pay.unitAllowedDecimals; ++i) {
2021-08-09 18:46:38 +02:00
amount = amount * 10;
}
return Fiat.formattedPrice(amount, Fiat.price);
}
2021-11-02 19:29:14 +01:00
visible: Pay.isMainChain
2021-08-09 18:46:38 +02:00
}
}
}
2023-03-21 22:25:41 +01:00
Flowee.CheckBox {
id: showBchOnActivity
Layout.alignment: Qt.AlignRight
checked: Pay.activityShowsBch
onCheckedChanged: Pay.activityShowsBch = checked
2023-05-02 11:14:15 +02:00
visible: Pay.isMainChain
2023-03-21 22:25:41 +01:00
}
Flowee.CheckBoxLabel {
Layout.columnSpan: 2
2024-02-12 19:19:01 +01:00
Layout.fillWidth: true
2023-03-21 22:25:41 +01:00
buddy: showBchOnActivity
text: qsTr("Show Bitcoin Cash value on Activity page")
2023-05-02 11:14:15 +02:00
visible: Pay.isMainChain
2023-03-21 22:25:41 +01:00
}
Flowee.CheckBox {
id: darkSkinChooser
Layout.alignment: Qt.AlignRight
checked: Pay.useDarkSkin
onCheckedChanged: {
Pay.useDarkSkin = checked
ControlColors.applySkin(mainWindow);
}
}
Flowee.CheckBoxLabel {
Layout.columnSpan: 2
buddy: darkSkinChooser
text: qsTr("Night Mode")
}
2023-05-16 19:55:52 +02:00
Flowee.CheckBox {
id: privateModeCB
Layout.alignment: Qt.AlignRight
checked: Pay.privateMode
onCheckedChanged: Pay.privateMode = checked
}
Flowee.CheckBoxLabel {
Layout.columnSpan: 2
buddy: privateModeCB
text: qsTr("Private Mode")
toolTipText: qsTr("Hides private wallets while enabled")
}
2024-02-12 19:19:01 +01:00
Flowee.Label {
id: fontSizingLabel
Layout.alignment: Qt.AlignRight | Qt.AlignTop
text: qsTr("Font sizing") + ":"
}
Item {
Layout.fillWidth: true
Layout.columnSpan: 2
height: 30 + fontSizingLabel.height * 0.75
id: fontSizing
property double buttonWidth: width / 6
Repeater {
model: 6
delegate: Item {
width: fontSizing.buttonWidth
anchors.bottom: parent.bottom
height: 30
x: width * index
property int target: index * 25 + 75
Rectangle {
width: parent.width - 5
x: 2.5
height: 5
color: Pay.fontScaling === target ? palette.highlight : palette.button
}
Flowee.Label {
font.pixelSize: 15
text: "" + target
anchors.bottom: parent.bottom
anchors.horizontalCenter: parent.horizontalCenter
}
MouseArea {
anchors.fill: parent
anchors.topMargin: -18
2024-02-12 19:19:01 +01:00
onClicked: Pay.fontScaling = target
cursorShape: Qt.PointingHandCursor
2024-02-12 19:19:01 +01:00
}
}
}
}
2024-05-28 23:23:31 +02:00
Flowee.Label {
2021-08-09 18:46:38 +02:00
text: qsTr("Version") + ":"
Layout.alignment: Qt.AlignRight
2021-08-09 18:46:38 +02:00
}
2024-05-28 23:23:31 +02:00
Flowee.Label {
2021-11-02 19:29:14 +01:00
text: Pay.version
2021-08-09 18:46:38 +02:00
Layout.columnSpan: 2
}
2024-05-28 23:23:31 +02:00
Flowee.Label {
2021-08-09 18:46:38 +02:00
text: qsTr("Library Version") + ":"
Layout.alignment: Qt.AlignRight
2021-08-09 18:46:38 +02:00
}
2024-05-28 23:23:31 +02:00
Flowee.Label {
2021-11-02 19:29:14 +01:00
text: Pay.libsVersion
2021-08-09 18:46:38 +02:00
Layout.columnSpan: 2
}
2024-05-28 23:23:31 +02:00
Flowee.Label {
2024-02-12 19:19:01 +01:00
Layout.alignment: Qt.AlignRight
2022-08-18 19:48:06 +02:00
text: qsTr("Synchronization") + ":"
}
2021-08-09 18:46:38 +02:00
2024-05-28 23:23:31 +02:00
Flowee.Button {
2022-08-18 19:48:06 +02:00
Layout.columnSpan: 2
text: qsTr("Network Status")
onClicked: {
netView.source = "./NetView.qml"
netView.item.show();
}
2021-08-09 18:46:38 +02:00
}
2024-01-06 21:33:28 +01:00
Item { width: 1; height: 1 } // empty row
2024-05-28 23:23:31 +02:00
Flowee.Button {
2024-01-06 21:33:28 +01:00
Layout.columnSpan: 2
text: qsTr("Address Stats")
onClicked: {
netView.source = "./AddressDbStats.qml"
netView.item.show();
}
}
2021-08-09 18:46:38 +02:00
}
}