Warning, /plasma-mobile/calindori/src/contents/ui/DatePickerSheet.qml is written in an unsupported language. File is not indexed.

0001 /*
0002  * SPDX-FileCopyrightText: 2019 Dimitris Kardarakos <dimkard@posteo.net>
0003  *
0004  * SPDX-License-Identifier: GPL-3.0-or-later
0005  */
0006 
0007 import QtQuick 2.7
0008 import QtQuick.Controls 2.0 as Controls2
0009 import QtQuick.Layouts 1.3
0010 import org.kde.kirigami 2.0 as Kirigami
0011 
0012 Kirigami.OverlaySheet {
0013     id: datePickerSheet
0014 
0015     property alias selectedDate: calendarMonth.selectedDate
0016     property string headerText
0017 
0018     signal datePicked
0019 
0020 
0021     header: Kirigami.Heading {
0022         level:1
0023         text: datePickerSheet.headerText
0024     }
0025 
0026     ColumnLayout {
0027         Layout.preferredWidth: calendarMonth.dayRectWidth * 8
0028 
0029         PickerMonthView {
0030             id: calendarMonth
0031 
0032             Layout.fillWidth: true
0033         }
0034 
0035         RowLayout {
0036             spacing: Kirigami.Units.largeSpacing
0037             Layout.alignment : Qt.AlignHCenter
0038 
0039             RowLayout {
0040                 spacing: 0
0041 
0042                 Controls2.ToolButton {
0043                     icon.name: "go-previous"
0044 
0045                     onClicked: calendarMonth.previousMonth()
0046                 }
0047 
0048                 Controls2.ToolButton {
0049                     text: "Previous"
0050 
0051                     onClicked: calendarMonth.previousMonth()
0052                 }
0053             }
0054 
0055             RowLayout {
0056                 spacing: 0
0057 
0058                 Controls2.ToolButton {
0059                     text: "Next"
0060 
0061                     onClicked: calendarMonth.nextMonth()
0062                 }
0063 
0064                 Controls2.ToolButton {
0065                     icon.name: "go-next"
0066 
0067                     onClicked: calendarMonth.nextMonth()
0068                 }
0069             }
0070         }
0071     }
0072 
0073     footer: RowLayout {
0074 
0075         Item {
0076             Layout.fillWidth: true
0077         }
0078 
0079         Controls2.ToolButton {
0080             text: "OK"
0081 
0082             onClicked: {
0083                 datePickerSheet.datePicked();
0084                 datePickerSheet.close();
0085             }
0086         }
0087 
0088         Controls2.ToolButton {
0089             text: "Cancel"
0090 
0091             onClicked: datePickerSheet.close()
0092         }
0093     }
0094 }