2
* Copyright 2012 Marco Martin <notmart@gmail.com>
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU Library General Public License as
6
* published by the Free Software Foundation; either version 2, or
7
* (at your option) any later version.
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU Library General Public License for more details
14
* You should have received a copy of the GNU Library General Public
15
* License along with this program; if not, write to the
16
* Free Software Foundation, Inc.,
17
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21
import org.kde.plasma.core 0.1 as PlasmaCore
22
import org.kde.plasma.components 0.1 as PlasmaComponents
23
import org.kde.locale 0.1 as KLocale
24
import org.kde.qtextracomponents 0.1
26
PlasmaComponents.ListItem {
28
opacity: 1-Math.abs(x)/width
30
onClicked: editAlarm(id)
32
checked: mainArea.pressed || pageRow.currentPage.alarmId == id
36
width: alarmItem.width
37
height: childrenRect.height
43
if (alarmItem.x < -alarmItem.width/2) {
44
removeAnimation.exitFromRight = false
45
removeAnimation.running = true
46
} else if (alarmItem.x > alarmItem.width/2 ) {
47
removeAnimation.exitFromRight = true
48
removeAnimation.running = true
50
resetAnimation.running = true
53
onClicked: alarmItem.clicked()
56
property bool exitFromRight: true
60
to: removeAnimation.exitFromRight ? alarmItem.width : -alarmItem.width
62
easing.type: Easing.InOutQuad
69
easing.type: Easing.InOutQuad
72
script: removeAlarm(id);
82
easing.type: Easing.InOutQuad
87
width: alarmItem.width - closeButton.width - spacing*3
91
PlasmaComponents.Label {
92
text: locale.formatDate(dateTime, KLocale.Locale.FancyShortDate)
93
elide: Text.ElideRight
95
PlasmaComponents.Label {
96
text: locale.formatLocaleTime(dateTime)
97
elide: Text.ElideRight
100
PlasmaComponents.Label {
101
anchors.verticalCenter: parent.verticalCenter
102
horizontalAlignment: Text.AlignHCenter
103
width: parent.width/4
106
elide: Text.ElideRight
109
PlasmaComponents.Label {
110
anchors.verticalCenter: parent.verticalCenter
111
horizontalAlignment: Text.AlignHCenter
112
width: parent.width/4
113
text: recurs ? i18n("Every day") : i18n("Once")
114
elide: Text.ElideRight
116
PlasmaComponents.Label {
117
anchors.verticalCenter: parent.verticalCenter
118
horizontalAlignment: Text.AlignHCenter
119
width: parent.width/4
120
text: audioFile ? i18n("Audio") : ""
121
elide: Text.ElideRight
128
width: theme.mediumIconSize
129
height: theme.mediumIconSize
131
verticalCenter: parent.verticalCenter
139
removeAnimation.running = true