Format code

This commit is contained in:
Toast 2025-05-28 10:50:13 +02:00
parent 669dd9168d
commit f3650c10a9
3 changed files with 32 additions and 17 deletions

View file

@ -6,44 +6,54 @@ import Leek
Kirigami.ApplicationWindow {
id: root
title: "Leek"
pageStack.initialPage: Kirigami.ScrollablePage {
title: "Mods"
Kirigami.CardsListView {
id: modsView
model: QModListModel {}
delegate: ModCardDelegate {}
delegate: ModCardDelegate {
}
model: QModListModel {
}
}
}
component ModCardDelegate: Kirigami.AbstractCard {
required property QMod mod
// headerOrientation: Qt.Horizontal
contentItem: Item {
implicitWidth: modCardLayout.implicitWidth
implicitHeight: modCardLayout.implicitHeight
implicitWidth: modCardLayout.implicitWidth
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
rowSpacing: Kirigami.Units.largeSpacing
anchors {
left: parent.left
right: parent.right
top: parent.top
}
// TODO: Replace this with an image once we can get them
Kirigami.Padding {
padding: Kirigami.Units.largeSpacing
contentItem: Kirigami.Icon {
source: "package-x-generic"
implicitHeight: Kirigami.Units.iconSizes.huge
implicitWidth: implicitHeight
source: "package-x-generic"
}
}
ColumnLayout {
Kirigami.Heading {
Layout.fillWidth: true
@ -55,17 +65,19 @@ Kirigami.ApplicationWindow {
}
Controls.Label {
property string desc: mod.description
Layout.fillWidth: true
wrapMode: Text.WordWrap
text: desc ? desc : "No description available"
font.italic: desc ? false : true
text: desc ? desc : "No description available"
wrapMode: Text.WordWrap
}
}
ColumnLayout {
Layout.alignment: Qt.AlignRight
Controls.Switch {
text: "Enabled"
checked: mod.enabled
text: "Enabled"
}
Controls.Button {
text: "Delete"