Move qml files to their own folder
This commit is contained in:
parent
20f459ddad
commit
ad4f429cd9
2 changed files with 1 additions and 1 deletions
91
src/leek/qml/Main.qml
Normal file
91
src/leek/qml/Main.qml
Normal file
|
|
@ -0,0 +1,91 @@
|
|||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Controls as Controls
|
||||
import org.kde.kirigami as Kirigami
|
||||
import Leek
|
||||
|
||||
Kirigami.ApplicationWindow {
|
||||
id: root
|
||||
|
||||
title: "Leek"
|
||||
|
||||
pageStack.initialPage: Kirigami.ScrollablePage {
|
||||
title: "Mods"
|
||||
|
||||
Kirigami.CardsListView {
|
||||
id: modsView
|
||||
|
||||
delegate: ModCardDelegate {
|
||||
}
|
||||
model: QModListModel {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
component ModCardDelegate: Kirigami.AbstractCard {
|
||||
required property QMod mod
|
||||
|
||||
// headerOrientation: Qt.Horizontal
|
||||
contentItem: Item {
|
||||
implicitHeight: modCardLayout.implicitHeight
|
||||
implicitWidth: modCardLayout.implicitWidth
|
||||
|
||||
GridLayout {
|
||||
id: modCardLayout
|
||||
|
||||
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 {
|
||||
implicitHeight: Kirigami.Units.iconSizes.huge
|
||||
implicitWidth: implicitHeight
|
||||
source: "package-x-generic"
|
||||
}
|
||||
}
|
||||
ColumnLayout {
|
||||
Kirigami.Heading {
|
||||
Layout.fillWidth: true
|
||||
text: mod.name
|
||||
type: Kirigami.Heading.Type.Primary
|
||||
}
|
||||
Kirigami.Separator {
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
Controls.Label {
|
||||
property string desc: mod.description
|
||||
|
||||
Layout.fillWidth: true
|
||||
font.italic: desc ? false : true
|
||||
text: desc ? desc : "No description available"
|
||||
wrapMode: Text.WordWrap
|
||||
}
|
||||
}
|
||||
ColumnLayout {
|
||||
Layout.alignment: Qt.AlignRight
|
||||
|
||||
Controls.Switch {
|
||||
checked: mod.enabled
|
||||
Layout.alignment: Qt.AlignCenter
|
||||
|
||||
onClicked: mod.enabled = checked
|
||||
}
|
||||
Controls.Button {
|
||||
text: "Delete"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue