some little refactor, deleting assets

This commit is contained in:
Blue 2024-01-21 16:22:56 -03:00
parent 7a116bfdf2
commit 5c4bd18cdc
Signed by: blue
GPG key ID: 9B203B252A63EE38
21 changed files with 139 additions and 36 deletions

View file

@ -4,16 +4,21 @@
import QtQuick
import QtQuick.Controls
import magpie
Item {
id: line
required property string title
required property string icon
required property color color
required property string balance
required property int assetId
signal error (err:string)
Row {
readonly property int iconSize: height
readonly property int freespace: width - iconSize - spacing * children.length - 1
readonly property int freespace: width - deleteButton.width - iconSize - spacing * children.length - 1
anchors.fill: parent
spacing: 5
@ -49,5 +54,16 @@ Item {
verticalAlignment: Text.AlignVCenter
color: palette.text
}
Button {
id: deleteButton
text: qsTr("Delete")
flat: true
height: parent.height
onClicked: API.deleteAsset(line.assetId, function(err) {
if (err)
Magpie.displayError("Error deleting asset " + line.title + ": " + err);
})
}
}
}