~ahayzen/music-app/remix-image-size-fix

« back to all changes in this revision

Viewing changes to MusicNowPlaying.qml

  • Committer: Andrew Hayzen
  • Date: 2013-08-29 21:36:17 UTC
  • mto: This revision was merged to the branch mainline in revision 90.
  • Revision ID: ahayzen@gmail.com-20130829213617-eqmnjy93v7kxwhn4
* Added common SwipeDelete.qml
* Added support for SwipeDelete in play queue
* Added support for SwipeDelete in playlist tracks

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
import Ubuntu.Components 0.1
24
24
import Ubuntu.Components.ListItems 0.1 as ListItem
25
25
import "meta-database.js" as Library
 
26
import "common"
26
27
 
27
28
Page {
28
29
    id: nowPlaying
77
78
            id: queueDelegate
78
79
            ListItem.Standard {
79
80
                id: playlistTracks
 
81
                removable: true
80
82
                state: queuelist.currentIndex == index ? "current" : ""
 
83
 
 
84
                backgroundIndicator: SwipeDelete {
 
85
                    id: swipeDelete
 
86
                    state: swipingState
 
87
                    property string text: i18n.tr("Clear")
 
88
                }
 
89
 
81
90
                onFocusChanged: {
82
91
                    if (focus == false) {
83
92
                        selected = false
85
94
                        selected = false
86
95
                    }
87
96
                }
 
97
                onItemRemoved: {
 
98
                    trackQueue.model.remove(index);
 
99
                }
 
100
 
 
101
                /* Do not use mousearea otherwise swipe delete won't function */
 
102
                onClicked: {
 
103
                    customdebug("File: " + file) // debugger
 
104
                    trackClicked(trackQueue, index) // play track
 
105
                }
 
106
                onPressAndHold: {
 
107
                    customdebug("Pressed and held queued track "+file)
 
108
                }
 
109
 
88
110
                Rectangle {
89
111
                    id: trackContainer;
90
112
                    anchors.fill: parent
131
153
                        x: trackImage.x + trackImage.width + units.gu(1)
132
154
                    }
133
155
                }
134
 
                MouseArea {
135
 
                    anchors.fill: parent
136
 
                    onDoubleClicked: {
137
 
                    }
138
 
                    onPressAndHold: {
139
 
                        customdebug("Pressed and held queued track "+file)
140
 
                    }
141
 
                    onClicked: {
142
 
                        customdebug("File: " + file) // debugger
143
 
                        trackClicked(trackQueue, index) // play track
144
 
                    }
145
 
                }
146
156
                states: State {
147
157
                    name: "current"
148
158
                    PropertyChanges {