Commit d82ce3d4 authored by Nicolas Fella's avatar Nicolas Fella

Add Kirgami date picker

parent ac55986b
......@@ -20,9 +20,11 @@
import QtQuick 2.2
import QtQuick.Layouts 1.1
import QtQuick.Controls 2.4
import QtQuick.Controls 2.5
import org.kde.kirigami 2.4 as Kirigami
import org.kde.kirigamiaddons.dateandtime 0.1 as KA
Button {
signal datePicked(string theDate)
......@@ -30,6 +32,8 @@ Button {
onClicked: {
if (_isAndroid) {
_androidUtils.showDatePicker()
} else {
dialog.open()
}
}
......@@ -39,4 +43,37 @@ Button {
datePicked(date)
}
}
Dialog {
id: dialog
anchors.centerIn: parent
height: Kirigami.Units.gridUnit * 6
contentItem: KA.DateInput {
id: picker
}
footer: RowLayout {
Button {
text: i18n("Cancel")
Layout.fillWidth: true
onClicked: dialog.reject()
}
Button {
text: i18n("Accept")
Layout.fillWidth: true
onClicked: dialog.accept()
}
}
onAccepted: {
console.log("Accept")
datePicked(Qt.formatDate(picker.value, Qt.ISODate))
}
onRejected: {
console.log("Rejected")
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment