Warning, /pim/itinerary/src/app/EventDelegate.qml is written in an unsupported language. File is not indexed.
0001 /*
0002 SPDX-FileCopyrightText: 2018 Volker Krause <vkrause@kde.org>
0003
0004 SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006
0007 import QtQuick
0008 import QtQuick.Layouts
0009 import QtQuick.Controls as QQC2
0010 import org.kde.kirigami as Kirigami
0011 import org.kde.itinerary
0012
0013 TimelineDelegate {
0014 id: root
0015
0016 headerIconSource: "meeting-attending"
0017 headerItem: RowLayout {
0018 QQC2.Label {
0019 id: headerLabel
0020 text: root.rangeType == TimelineElement.RangeEnd ?
0021 i18n("End: %1", reservationFor.name) : reservationFor.name
0022 color: root.headerTextColor
0023 elide: Text.ElideRight
0024 wrapMode: Text.WordWrap
0025 maximumLineCount: 2
0026 Layout.fillWidth: true
0027 Accessible.ignored: true
0028 }
0029 QQC2.Label {
0030 text: {
0031 if (root.rangeType == TimelineElement.RangeEnd)
0032 return Localizer.formatTime(reservationFor, "endDate");
0033 if (reservationFor.doorTime > 0)
0034 return Localizer.formatTime(reservationFor, "doorTime");
0035 return Localizer.formatTime(reservationFor, "startDate");
0036 }
0037 color: root.headerTextColor
0038 }
0039 }
0040
0041 contentItem: Column {
0042 id: topLayout
0043 spacing: Kirigami.Units.smallSpacing
0044
0045 QQC2.Label {
0046 text: reservationFor.location != undefined ? reservationFor.location.name : ""
0047 visible: text !== ""
0048 wrapMode: Text.WordWrap
0049 width: topLayout.width
0050 }
0051 QQC2.Label {
0052 visible: reservationFor.location != undefined && !reservationFor.location.address.isEmpty
0053 width: topLayout.width
0054 text: Localizer.formatAddressWithContext(reservationFor.location.address, null, Settings.homeCountryIsoCode)
0055 }
0056 QQC2.Label {
0057 text: i18n("Start time: %1", Localizer.formatDateTime(reservationFor, "startDate"))
0058 visible: root.rangeType != TimelineElement.RangeEnd && reservationFor.doorTime > 0
0059 }
0060 QQC2.Label {
0061 text: i18n("End time: %1", Localizer.formatDateTime(reservationFor, "endDate"));
0062 visible: root.rangeType != TimelineElement.RangeEnd && reservationFor.endDate > 0
0063 }
0064 }
0065
0066 onClicked: showDetailsPage(eventDetailsPage, root.batchId)
0067
0068 Accessible.name: headerLabel.text
0069 }