QModListModel: return QMod to qml instead of individual properties
This commit is contained in:
parent
058a8346bd
commit
669dd9168d
2 changed files with 14 additions and 22 deletions
|
|
@ -17,9 +17,7 @@ Kirigami.ApplicationWindow {
|
|||
}
|
||||
}
|
||||
component ModCardDelegate: Kirigami.AbstractCard {
|
||||
required property string name
|
||||
required property string description
|
||||
required property bool modEnabled
|
||||
required property QMod mod
|
||||
// headerOrientation: Qt.Horizontal
|
||||
contentItem: Item {
|
||||
implicitWidth: modCardLayout.implicitWidth
|
||||
|
|
@ -49,24 +47,25 @@ Kirigami.ApplicationWindow {
|
|||
ColumnLayout {
|
||||
Kirigami.Heading {
|
||||
Layout.fillWidth: true
|
||||
text: name
|
||||
text: mod.name
|
||||
type: Kirigami.Heading.Type.Primary
|
||||
}
|
||||
Kirigami.Separator {
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
Controls.Label {
|
||||
property string desc: mod.description
|
||||
Layout.fillWidth: true
|
||||
wrapMode: Text.WordWrap
|
||||
text: description ? description : "No description available"
|
||||
font.italic: description ? false : true
|
||||
text: desc ? desc : "No description available"
|
||||
font.italic: desc ? false : true
|
||||
}
|
||||
}
|
||||
ColumnLayout {
|
||||
Layout.alignment: Qt.AlignRight
|
||||
Controls.Switch {
|
||||
text: "Enabled"
|
||||
checked: modEnabled
|
||||
checked: mod.enabled
|
||||
}
|
||||
Controls.Button {
|
||||
text: "Delete"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue