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

0001 /*
0002  * SPDX-FileCopyrightText: 2018 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 ColumnLayout {
0013     id: root
0014 
0015     property date headerDate
0016     property int headerTodosCount
0017     property int headerEventsCount
0018     property var applicationLocale: Qt.locale()
0019 
0020     RowLayout {
0021         id: selectedDayHeading
0022 
0023         spacing: Kirigami.Units.largeSpacing
0024 
0025         Controls2.Label {
0026             font.pointSize: Kirigami.Units.fontMetrics.font.pointSize * 4
0027             text: root.headerDate.getDate()
0028             opacity: 0.6
0029         }
0030 
0031         ColumnLayout {
0032             spacing: Kirigami.Units.smallSpacing
0033 
0034             Controls2.Label {
0035                 text: root.headerDate.toLocaleDateString(applicationLocale, "dddd")
0036                 font.pointSize: Kirigami.Units.fontMetrics.font.pointSize * 1.5
0037             }
0038 
0039             Controls2.Label {
0040                 text: root.headerDate.toLocaleDateString(applicationLocale, "MMMM") + " " + root.headerDate.getFullYear()
0041                 font.pointSize: Kirigami.Units.fontMetrics.font.pointSize
0042             }
0043         }
0044     }
0045 
0046     Controls2.Label {
0047         Layout.bottomMargin: Kirigami.Units.largeSpacing
0048         text: ((root.headerTodosCount > 0) ? i18np("%1 task", "%1 tasks",root.headerTodosCount) : "") +
0049                 ((root.headerTodosCount > 0 && root.headerEventsCount > 0) ? " and " : "") +
0050                     ((root.headerEventsCount > 0) ? i18np("%1 event", "%1 events",root.headerEventsCount) : "")
0051         opacity: 0.6
0052     }
0053 }