42608e8b00
This shows a selector with only relevant wallet choices and no unneeded details.
75 lines
2.2 KiB
QML
75 lines
2.2 KiB
QML
/*
|
|
* This file is part of the Flowee project
|
|
* Copyright (C) 2024-2025 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 QtQuick.Controls as QQC2;
|
|
import "../Flowee" as Flowee;
|
|
|
|
Flowee.Dialog {
|
|
id: root
|
|
property var current: null
|
|
property var selected: null
|
|
property var accounts: []
|
|
|
|
contentComponent: ListView {
|
|
model: root.accounts
|
|
implicitWidth: 200
|
|
implicitHeight: Math.min(model.length * 50, 600)
|
|
|
|
delegate: Rectangle {
|
|
width: ListView.view.width
|
|
height: nameLabel.height + 20
|
|
color: (index % 2) == 0 ? palette.base : palette.light
|
|
border.width: modelData === root.current ? 2 : 0
|
|
border.color: mainWindow.floweeGreen
|
|
radius: 7
|
|
|
|
Flowee.ArrowPoint {
|
|
id: point
|
|
x: 1.3
|
|
visible: root.current === modelData;
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
color: parent.border.color
|
|
}
|
|
|
|
Flowee.Label {
|
|
id: nameLabel
|
|
x: 10
|
|
y: 10
|
|
text: modelData.name
|
|
}
|
|
|
|
MouseArea {
|
|
anchors.fill: parent
|
|
onClicked: {
|
|
root.selected = modelData;
|
|
closeTimer.running = true;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
standardButtons: QQC2.DialogButtonBox.NoButton
|
|
Timer {
|
|
id: closeTimer
|
|
interval: 300
|
|
onTriggered: {
|
|
running = false;
|
|
root.close()
|
|
}
|
|
}
|
|
}
|