add an action to the Kirigami app
This commit is contained in:
parent
ce52d1970c
commit
f1dfd94f06
1 changed files with 23 additions and 2 deletions
|
@ -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()
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue