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

0001 /*
0002 * SPDX-FileCopyrightText: 2021 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.14 as Controls2
0009 import QtQuick.Layouts 1.3
0010 import org.kde.kirigami 2.12 as Kirigami
0011 import org.kde.calindori 0.1 as Calindori
0012 
0013 ColumnLayout {
0014     id: root
0015 
0016     property var alarmsModel
0017 
0018     Controls2.ToolButton {
0019         text: i18n("Add")
0020         icon.name: 'list-add'
0021 
0022         onClicked: reminderEditor.open()
0023     }
0024 
0025     Kirigami.Separator {
0026         Layout.fillWidth: true
0027     }
0028 
0029     Repeater {
0030         id: alarmsList
0031 
0032         model: alarmsModel
0033 
0034         delegate: Kirigami.SwipeListItem {
0035             contentItem: Controls2.Label {
0036                 text: model.display
0037                 wrapMode: Text.WordWrap
0038             }
0039 
0040             Layout.fillWidth: true
0041 
0042             actions: [
0043                     Kirigami.Action {
0044                     id: deleteAlarm
0045 
0046                     iconName: "delete"
0047                     onTriggered: alarmsModel.removeAlarm(model.index)
0048                 }
0049             ]
0050         }
0051     }
0052 
0053     Kirigami.PlaceholderMessage {
0054         width: parent.width - (Kirigami.Units.largeSpacing * 4)
0055         visible: alarmsList.count === 0
0056         icon.name: "appointment-reminder"
0057         text: i18n("No reminders yet")
0058     }
0059 
0060 
0061     ReminderEditor {
0062         id: reminderEditor
0063 
0064         onOffsetSelected: alarmsModel.addAlarm(offset)
0065     }
0066 }