Add basic mod listing

This commit is contained in:
Toast 2025-05-16 17:19:40 +02:00
parent ef25e8a026
commit 620acbeb30

View file

@ -7,11 +7,84 @@ Kirigami.ApplicationWindow {
id: root id: root
title: "Leek" title: "Leek"
pageStack.initialPage: Kirigami.Page { pageStack.initialPage: Kirigami.ScrollablePage {
title: "Mods"
Kirigami.CardsListView {
id: modsView
model: modListModel
delegate: modCardDelegate
}
}
Component {
id: modCardDelegate
Kirigami.AbstractCard {
// headerOrientation: Qt.Horizontal
contentItem: Item {
implicitWidth: modCardLayout.implicitWidth
implicitHeight: modCardLayout.implicitHeight
GridLayout {
id: modCardLayout
anchors {
left: parent.left
top: parent.top
right: parent.right
}
rowSpacing: Kirigami.Units.largeSpacing
columnSpacing: Kirigami.Units.largeSpacing
columns: root.wideScreen ? 4 : 2
// TODO: Replace this with an image once we can get them
Controls.BusyIndicator {
running: true
}
ColumnLayout {
Kirigami.Heading {
Layout.fillWidth: true
text: name
type: Kirigami.Heading.Type.Primary
}
Kirigami.Separator {
Layout.fillWidth: true
}
Controls.Label { Controls.Label {
anchors.centerIn: parent Layout.fillWidth: true
text: "Hello world" wrapMode: Text.WordWrap
text: description ? description : "No description available"
}
}
ColumnLayout {
Layout.alignment: Qt.AlignRight
Controls.Switch {
text: "Enabled"
checked: true
}
Controls.Button {
text: "Delete"
}
}
}
}
}
}
ListModel {
id: modListModel
ListElement {
name: "DivaNoSpy"
description: "Disables project diva's telemetry"
}
ListElement {
name: "exPatch"
description: "Unlocks extreme difficulty immediately"
}
ListElement {
name: "Mod with no description"
}
ListElement {
name: "Very long description"
description: "
()"
} }
} }
} }