Begin move to kde configuration
This commit is contained in:
parent
a068fe8afc
commit
a6f818864a
11 changed files with 58 additions and 198 deletions
|
@ -6,7 +6,7 @@ import org.kde.kirigami as Kirigami
|
|||
Kirigami.ApplicationWindow {
|
||||
id: root
|
||||
|
||||
title: i18nc("@title:window", "Hello World")
|
||||
title: i18nc("@title:window", "My Application")
|
||||
|
||||
globalDrawer: Kirigami.GlobalDrawer {
|
||||
isMenu: true
|
||||
|
@ -20,51 +20,12 @@ Kirigami.ApplicationWindow {
|
|||
]
|
||||
}
|
||||
|
||||
ListModel {
|
||||
id: kountdownModel
|
||||
}
|
||||
|
||||
AddEditSheet {
|
||||
id: addEditSheet
|
||||
onAdded: kountdownModel.append({
|
||||
"name": name,
|
||||
"description": description,
|
||||
"date": Date.parse(kdate)
|
||||
});
|
||||
onEdited: kountdownModel.set(index, {
|
||||
"name": name,
|
||||
"description": description,
|
||||
"date": Date.parse(kdate)
|
||||
});
|
||||
onRemoved: kountdownModel.remove(index, 1)
|
||||
}
|
||||
|
||||
function openPopulatedSheet(mode, index = -1, listName = "", listDesc = "", listDate = "") {
|
||||
addEditSheet.mode = mode
|
||||
addEditSheet.index = index;
|
||||
addEditSheet.name = listName
|
||||
addEditSheet.description = listDesc
|
||||
addEditSheet.kdate = listDate
|
||||
|
||||
addEditSheet.open()
|
||||
}
|
||||
|
||||
pageStack.initialPage: Kirigami.ScrollablePage {
|
||||
title: i18nc("@title", "Kountdown")
|
||||
title: i18nc("@title", "Main Page")
|
||||
|
||||
actions: [
|
||||
Kirigami.Action {
|
||||
id: addAction
|
||||
icon.name: "list-add"
|
||||
text: i18nc("@action:button", "Add kountdown")
|
||||
onTriggered:openPopulatedSheet("add")
|
||||
}
|
||||
]
|
||||
|
||||
Kirigami.CardsListView {
|
||||
id: cardsView
|
||||
model: kountdownModel
|
||||
delegate: KountdownDelegate {}
|
||||
}
|
||||
Item {}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue