add an action to the Kirigami app

This commit is contained in:
Fries 2023-06-27 19:04:51 -07:00
parent ce52d1970c
commit f1dfd94f06

View file

@ -20,8 +20,6 @@ Kirigami.ApplicationWindow {
id: kountdownDelegate
Kirigami.AbstractCard {
contentItem: Item {
implicitWidth: delegateLayout.implicitWidth
implicitHeight: delegateLayout.implicitHeight
GridLayout {
id: delegateLayout
anchors {
@ -63,6 +61,8 @@ Kirigami.ApplicationWindow {
text: i18n("Edit")
}
}
implicitWidth: delegateLayout.implicitWidth
implicitHeight: delegateLayout.implicitHeight
}
}
}
@ -74,5 +74,26 @@ Kirigami.ApplicationWindow {
model: kountdownModel
delegate: kountdownDelegate
}
actions.main: Kirigami.Action {
id: addAction
icon.name: "list-add"
text: i18nc("@action:button", "Add meowdown")
onTriggered: kountdownModel.append({
name: "Meowy",
description: "you just added a meowdown",
date: 21
})
}
}
globalDrawer: Kirigami.GlobalDrawer {
isMenu: true
actions: [
Kirigami.Action {
text: i18n("Quit")
icon.name: "gtk-quit"
shortcut: StandardKey.Quit
onTriggered: Qt.quit()
}
]
}
}