Qml: run qmlformat

This commit is contained in:
Toast 2025-06-05 13:23:47 +02:00
parent e17cc20cdb
commit 15a00512a8
2 changed files with 14 additions and 18 deletions

View file

@ -27,10 +27,8 @@ Kirigami.ApplicationWindow {
Kirigami.CardsListView { Kirigami.CardsListView {
id: modsView id: modsView
delegate: ModCardDelegate { delegate: ModCardDelegate {}
} model: QModListModel {}
model: QModListModel {
}
} }
} }
@ -38,7 +36,9 @@ Kirigami.ApplicationWindow {
required property QMod mod required property QMod mod
showClickFeedback: true showClickFeedback: true
onClicked: pageStack.push(Qt.resolvedUrl("ModPage.qml"), {mod: mod}) onClicked: pageStack.push(Qt.resolvedUrl("ModPage.qml"), {
mod: mod
})
// headerOrientation: Qt.Horizontal // headerOrientation: Qt.Horizontal
contentItem: Item { contentItem: Item {

View file

@ -10,9 +10,9 @@ Kirigami.Page {
title: "Local mod" title: "Local mod"
onBackRequested: (event) => { onBackRequested: event => {
event.accepted = true event.accepted = true;
applicationWindow().pageStack.pop() applicationWindow().pageStack.pop();
} }
ColumnLayout { ColumnLayout {
@ -38,11 +38,7 @@ Kirigami.Page {
implicitHeight: headerContents.implicitHeight + (headerContents.anchors.topMargin * 2) implicitHeight: headerContents.implicitHeight + (headerContents.anchors.topMargin * 2)
// Tint the header with the dominant color of the mod's icon // Tint the header with the dominant color of the mod's icon
color: Kirigami.ColorUtils.tintWithAlpha( color: Kirigami.ColorUtils.tintWithAlpha(Kirigami.Theme.backgroundColor, iconColors.dominant, 0.1)
Kirigami.Theme.backgroundColor,
iconColors.dominant,
0.1
)
GridLayout { GridLayout {
id: headerContents id: headerContents
@ -74,10 +70,10 @@ Kirigami.Page {
Controls.Label { Controls.Label {
property bool hasAuthors: mod.authors.length > 0 property bool hasAuthors: mod.authors.length > 0
function joinAuthors() { function joinAuthors() {
return mod.authors.join(", ") return mod.authors.join(", ");
} }
text: hasAuthors ? joinAuthors() : "Unknown author" text: hasAuthors ? joinAuthors() : "Unknown author"
} }
} }
} }
@ -101,12 +97,12 @@ Kirigami.Page {
text: { text: {
if (hasDescription) { if (hasDescription) {
if (mod.longDescription) { if (mod.longDescription) {
text = mod.longDescription text = mod.longDescription;
} else { } else {
text = mod.description text = mod.description;
} }
} else { } else {
text = "The description for this mod is not available" text = "The description for this mod is not available";
} }
} }
} }