some experiments around therems, a request to update asset
This commit is contained in:
parent
374551d2bb
commit
aa815a5bd7
14 changed files with 229 additions and 59 deletions
|
@ -13,13 +13,14 @@ Item {
|
|||
required property color color
|
||||
required property string balance
|
||||
required property string currency
|
||||
required property int assetId
|
||||
required property int assetID
|
||||
|
||||
signal error (err:string)
|
||||
signal remove(id: int)
|
||||
signal edit(id: int)
|
||||
|
||||
Row {
|
||||
readonly property int iconSize: height
|
||||
readonly property int freespace: width - deleteButton.width - iconSize - spacing * children.length - 1
|
||||
readonly property int freespace: width - deleteButton.width - editButton.width - iconSize - spacing * children.length - 1
|
||||
|
||||
anchors.fill: parent
|
||||
spacing: 5
|
||||
|
@ -37,29 +38,34 @@ Item {
|
|||
}
|
||||
}
|
||||
|
||||
Text {
|
||||
Label {
|
||||
width: parent.freespace / 3
|
||||
height: parent.height
|
||||
text: title
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
color: palette.text
|
||||
font.bold: true
|
||||
}
|
||||
|
||||
Text {
|
||||
Label {
|
||||
width: parent.freespace / 3
|
||||
height: parent.height
|
||||
text: balance
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
color: palette.text
|
||||
}
|
||||
|
||||
Text {
|
||||
Label {
|
||||
width: parent.freespace / 3
|
||||
height: parent.height
|
||||
text: currency
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
color: palette.text
|
||||
}
|
||||
|
||||
Button {
|
||||
id: editButton
|
||||
text: qsTr("Edit")
|
||||
flat: true
|
||||
height: parent.height
|
||||
onClicked: edit(assetID)
|
||||
}
|
||||
|
||||
Button {
|
||||
|
@ -67,10 +73,7 @@ Item {
|
|||
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);
|
||||
})
|
||||
onClicked: remove(assetID)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -34,9 +34,17 @@ ComboBox {
|
|||
|
||||
onActivated: index => box.color = model[index]
|
||||
Component.onCompleted: {
|
||||
popup.background.color = box.background.color
|
||||
popup.background.border.color = box.background.border.color
|
||||
popup.background.border.width = box.background.border.width
|
||||
if (box.background.color)
|
||||
popup.background.color = box.background.color;
|
||||
|
||||
if (!box.background.border)
|
||||
return;
|
||||
|
||||
if (box.background.border.color)
|
||||
popup.background.border.color = box.background.border.color;
|
||||
|
||||
if (box.background.border.width)
|
||||
popup.background.border.width = box.background.border.width;
|
||||
}
|
||||
|
||||
popup: Popup {
|
||||
|
@ -69,8 +77,9 @@ ComboBox {
|
|||
|
||||
highlighted: view.currentIndex === index
|
||||
contentItem: Rectangle {
|
||||
anchors.fill: parent
|
||||
color: modelData
|
||||
radius: box.background.radius
|
||||
radius: box.background.radius || 0
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
|
@ -96,7 +105,7 @@ ComboBox {
|
|||
}
|
||||
|
||||
background: Rectangle {
|
||||
radius: box.background.radius
|
||||
radius: box.background.radius || 0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,10 +33,11 @@ ComboBox {
|
|||
Icon {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
iconName: icon
|
||||
color: palette.text
|
||||
color: label.color
|
||||
}
|
||||
|
||||
Label {
|
||||
id: label
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
text: icon
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue