Debian Codegraph @

rc/qml/Components/EventCard.qml

raw
1 /*
2 * Copyright (C) 2012-2015 Canonical Ltd.
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as
6 * published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors:
17 * Jim Nelson <[email protected]>
18 * Charles Lindsay <[email protected]>
19 * Clint Rogers <[email protected]>
20 * Lucas Beeler <[email protected]>
21 */
22
23 import QtQuick 2.9
24 import Lomiri.Components 1.3
25 import "../../js/Gallery.js" as Gallery
26 import "../Utility"
27
28 /*!
29 */
30 LomiriShape {
31 id: eventCard
32
33 /*!
34 */
35 property variant event
36 /*!
37 */
38
39 radius: "medium"
40 backgroundColor: theme.palette.normal.base
41
42 width: units.gu(12)
43 height: units.gu(12)
44
45 Label {
46 id: eventMonthYear
47
48 y: units.gu(1.5)
49 width: parent.width - units.gu(2)
50 height: units.gu(1)
51 anchors.horizontalCenter: parent.horizontalCenter
52
53 font.pixelSize: units.dp(12)
54
55 font.capitalization: Font.AllUppercase
56 horizontalAlignment: Text.AlignHCenter
57
58 /// The event lomirishape's month/year part, keep as is unless you know what you're doing
59 text: (event) ? Qt.formatDate(event.date, i18n.tr("MMM yyyy")) : ""
60 color: theme.palette.normal.baseText
61 }
62
63 Label {
64 id: eventDay
65
66 anchors.top: eventMonthYear.bottom
67 width: parent.width
68
69 font.pixelSize: units.dp(67)
70
71 horizontalAlignment: Text.AlignHCenter
72
73 /// The event lomirishape's day part, keep as is unless you know what you're doing
74 text: (event) ? Qt.formatDate(event.date, i18n.tr("dd")) : ""
75 color: theme.palette.normal.baseText
76 }
77 }