2024-01-18 22:14:33 +00:00
|
|
|
// SPDX-FileCopyrightText: 2023 Yury Gubich <blue@macaw.me>
|
|
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
|
|
|
import QtQuick
|
|
|
|
import QtQuick.Controls
|
2024-04-09 21:04:07 +00:00
|
|
|
import QtQuick.Layouts
|
2024-01-18 22:14:33 +00:00
|
|
|
|
2024-01-21 19:22:56 +00:00
|
|
|
import magpie
|
|
|
|
|
2024-01-20 21:17:21 +00:00
|
|
|
Item {
|
2024-01-18 22:14:33 +00:00
|
|
|
id: line
|
|
|
|
required property string title
|
|
|
|
required property string icon
|
2024-01-20 21:17:21 +00:00
|
|
|
required property color color
|
|
|
|
required property string balance
|
2024-03-29 22:00:17 +00:00
|
|
|
required property string currency
|
2024-04-07 20:07:52 +00:00
|
|
|
required property int assetID
|
2024-01-21 19:22:56 +00:00
|
|
|
|
2024-04-07 20:07:52 +00:00
|
|
|
signal remove(id: int)
|
|
|
|
signal edit(id: int)
|
2024-01-18 22:14:33 +00:00
|
|
|
|
2024-04-09 21:04:07 +00:00
|
|
|
RowLayout {
|
2024-01-18 22:14:33 +00:00
|
|
|
anchors.fill: parent
|
2024-01-20 21:17:21 +00:00
|
|
|
spacing: 5
|
|
|
|
|
|
|
|
Rectangle {
|
2024-04-09 21:04:07 +00:00
|
|
|
Layout.preferredWidth: parent.height
|
|
|
|
Layout.fillHeight: true
|
2024-01-20 21:17:21 +00:00
|
|
|
color: line.color
|
|
|
|
|
2024-04-03 23:51:08 +00:00
|
|
|
Icon {
|
2024-01-20 21:17:21 +00:00
|
|
|
anchors.fill: parent
|
2024-04-05 16:17:24 +00:00
|
|
|
anchors.margins: 2
|
2024-04-03 23:51:08 +00:00
|
|
|
iconName: line.icon
|
|
|
|
color: pickColor(line.color)
|
2024-01-20 21:17:21 +00:00
|
|
|
}
|
2024-01-18 22:14:33 +00:00
|
|
|
}
|
|
|
|
|
2024-04-07 20:07:52 +00:00
|
|
|
Label {
|
2024-04-09 21:04:07 +00:00
|
|
|
Layout.fillHeight: true
|
|
|
|
Layout.preferredWidth: Infinity
|
2024-01-18 22:14:33 +00:00
|
|
|
text: title
|
2024-01-20 21:17:21 +00:00
|
|
|
verticalAlignment: Text.AlignVCenter
|
|
|
|
font.bold: true
|
|
|
|
}
|
|
|
|
|
2024-04-07 20:07:52 +00:00
|
|
|
Label {
|
2024-04-09 21:04:07 +00:00
|
|
|
Layout.fillHeight: true
|
|
|
|
Layout.preferredWidth: Infinity
|
2024-01-20 21:17:21 +00:00
|
|
|
text: balance
|
|
|
|
verticalAlignment: Text.AlignVCenter
|
2024-01-18 22:14:33 +00:00
|
|
|
}
|
2024-01-21 19:22:56 +00:00
|
|
|
|
2024-04-07 20:07:52 +00:00
|
|
|
Label {
|
2024-04-09 21:04:07 +00:00
|
|
|
Layout.fillHeight: true
|
|
|
|
Layout.preferredWidth: Infinity
|
2024-03-29 22:00:17 +00:00
|
|
|
text: currency
|
|
|
|
verticalAlignment: Text.AlignVCenter
|
2024-04-07 20:07:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Button {
|
|
|
|
id: editButton
|
2024-04-09 21:04:07 +00:00
|
|
|
Layout.fillHeight: true
|
2024-04-07 20:07:52 +00:00
|
|
|
text: qsTr("Edit")
|
2024-04-07 23:02:00 +00:00
|
|
|
icon.name: "entry-edit"
|
2024-04-07 20:07:52 +00:00
|
|
|
flat: true
|
|
|
|
onClicked: edit(assetID)
|
2024-03-29 22:00:17 +00:00
|
|
|
}
|
|
|
|
|
2024-01-21 19:22:56 +00:00
|
|
|
Button {
|
|
|
|
id: deleteButton
|
2024-04-09 21:04:07 +00:00
|
|
|
Layout.fillHeight: true
|
2024-01-21 19:22:56 +00:00
|
|
|
text: qsTr("Delete")
|
2024-04-07 23:02:00 +00:00
|
|
|
icon.name: "delete"
|
2024-04-07 20:07:52 +00:00
|
|
|
onClicked: remove(assetID)
|
2024-04-07 23:02:00 +00:00
|
|
|
palette { //unfortunately doesn't work anymore
|
|
|
|
button: "red"
|
|
|
|
}
|
2024-01-21 19:22:56 +00:00
|
|
|
}
|
2024-01-18 22:14:33 +00:00
|
|
|
}
|
|
|
|
}
|