Files

89 lines
2.9 KiB
QML
Raw Permalink Normal View History

2023-05-17 15:43:25 +02:00
/*
* This file is part of the Flowee project
* Copyright (C) 2023 Tom Zander <tom@flowee.org>
*
* 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/>.
*/
import QtQuick
import "../Flowee" as Flowee
Page {
headerText: qsTr("Select Wallet")
Flowee.Label {
id: introText
anchors.left: parent.left
anchors.right: parent.right
anchors.top: parent.top
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
text: qsTr("Pick which wallet will be selected on starting Flowee Pay")
}
ListView {
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.bottom
anchors.top: introText.bottom
anchors.topMargin: 10
clip: true
model: portfolio.accounts
delegate: Item {
width: ListView.view.width
height: column.height + 20
Rectangle {
anchors.fill: parent
color: (index % 2) == 0 ? palette.base : palette.alternateBase
}
MouseArea {
anchors.fill: parent
2026-03-14 21:14:42 +01:00
onClicked: modelData.isPrimaryAccount = true
2023-05-17 15:43:25 +02:00
}
Column {
id: column
y: 10
x: 10
width: parent.width - 20
Flowee.Label {
2023-05-17 23:42:07 +02:00
id: mainText
2023-05-17 15:43:25 +02:00
text: modelData.name
font.bold: true
}
Flowee.Label {
text: {
if (modelData.allowInstaPay) {
2026-03-14 21:14:42 +01:00
var cur = Fiat.currencyName
var limit = modelData.fiatInstaPayLimit(cur)
2023-05-17 15:43:25 +02:00
if (limit === 0)
2026-03-14 21:14:42 +01:00
return qsTr("No InstaPay limit set")
return qsTr("InstaPay till %1").arg(Fiat.formattedPrice(limit))
2023-05-17 15:43:25 +02:00
}
2026-03-14 21:14:42 +01:00
return qsTr("InstaPay is turned off")
2023-05-17 15:43:25 +02:00
}
2025-10-31 17:24:01 +01:00
font.pixelSize: mainText.font.pixelSize * 0.8
2023-05-17 23:42:07 +02:00
color: palette.brightText
2023-05-17 15:43:25 +02:00
}
}
Flowee.Label {
2026-03-14 21:14:42 +01:00
text: "✷"
2023-05-17 15:43:25 +02:00
y: 10
anchors.right: parent.right
anchors.rightMargin: 5
visible: modelData.isPrimaryAccount
}
}
}
}