2
* Copyright (C) 2013 Andrew Hayzen <ahayzen@gmail.com>
3
* Daniel Holm <d.holmen@gmail.com>
4
* Victor Thompson <victor.thompson@gmail.com>
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; version 3.
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this program. If not, see <http://www.gnu.org/licenses/>.
20
import Ubuntu.Components 1.2
22
/* SwipeDelete object */
27
width: parent.width * 3
28
x: 0 - parent.width // start out of view
30
property int duration: 0
31
property bool deleteState: false
33
function runSwipeDeletePrepareAnimation()
35
swipeDeletePrepareAnimation.start();
38
function runSwipeDeleteAnimation()
40
swipeDeleteAnimation.start();
44
id: swipeBackgroundLeft
45
anchors.left: parent.left
46
// color: styleMusic.mainView.backgroundColor
48
width: parent.width / 3
51
id: swipeBackgroundLeftText
53
anchors.margins: units.gu(2)
54
// color: styleMusic.common.white
56
horizontalAlignment: Text.AlignRight
57
text: i18n.tr("Remove")
58
verticalAlignment: Text.AlignVCenter
63
id: swipeBackgroundRight
64
anchors.right: parent.right
65
// color: styleMusic.mainView.backgroundColor
67
width: parent.width / 3
70
id: swipeBackgroundRightText
72
anchors.margins: units.gu(2)
73
// color: styleMusic.common.white
75
horizontalAlignment: Text.AlignLeft
76
text: i18n.tr("Remove")
77
verticalAlignment: Text.AlignVCenter
81
// Fade out the text in prepartion for removal
83
id: swipeDeletePrepareAnimation
86
target: swipeBackgroundLeftText
89
duration: swipeBackground.duration
92
target: swipeBackgroundRightText
95
duration: swipeBackground.duration
100
* Animation to remove the swipe object
101
* - Reduces the height to 0 to 'pull up' the row below
102
* - On animation finish it removes the item from the model
105
id: swipeDeleteAnimation
106
target: swipeBackground
109
duration: swipeBackground.duration
112
if (running == false)