Merge lp:~vthompson/music-app/remix-do-not-show-artist-in-albumspage into lp:music-app/trusty
- remix-do-not-show-artist-in-albumspage
- Merge into trusty
Status: | Superseded |
---|---|
Proposed branch: | lp:~vthompson/music-app/remix-do-not-show-artist-in-albumspage |
Merge into: | lp:music-app/trusty |
Diff against target: |
6798 lines (+2635/-2615) (has conflicts) 32 files modified
MusicAlbums.qml (+21/-123) MusicArtists.qml (+37/-87) MusicNowPlaying.qml (+377/-219) MusicPlaylists.qml (+34/-10) MusicSettings.qml (+0/-11) MusicStart.qml (+37/-474) MusicToolbar.qml (+161/-953) MusicTracks.qml (+14/-15) MusicaddtoPlaylist.qml (+0/-1) Player.qml (+5/-1) Style.qml (+2/-2) click/apparmor.json (+12/-2) com.ubuntu.music_music.desktop.in.in (+3/-0) common/AlbumsPage.qml (+117/-7) common/BlurredBackground.qml (+12/-14) common/BlurredHeader.qml (+69/-0) common/Card.qml (+151/-0) common/CardView.qml (+61/-0) common/ColumnFlow.qml (+160/-0) common/CoverGrid.qml (+78/-0) common/CoverRow.qml (+2/-0) common/ListItemActions/DeletePlaylist.qml (+0/-29) common/ListItemActions/EditPlaylist.qml (+0/-35) common/MusicPage.qml (+4/-0) common/MusicRow.qml (+24/-5) common/SongsPage.qml (+275/-162) music-app.qml (+27/-36) po/ca@valencia.po (+459/-0) po/com.ubuntu.music.pot (+150/-148) po/pt_BR.po (+179/-151) tests/autopilot/music_app/__init__.py (+104/-84) tests/autopilot/music_app/tests/test_music.py (+60/-46) Text conflict in MusicPlaylists.qml Text conflict in common/AlbumsPage.qml Conflict adding file po/ca@valencia.po. Moved existing file to po/ca@valencia.po.moved. Text conflict in po/pt_BR.po |
To merge this branch: | bzr merge lp:~vthompson/music-app/remix-do-not-show-artist-in-albumspage |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Music App Developers | Pending | ||
Review via email: mp+239083@code.launchpad.net |
This proposal has been superseded by a proposal from 2014-10-21.
Commit message
Do not show the artist in the grid of albums
Description of the change
Do not show the artist in the grid of albums
Unmerged revisions
- 682. By Victor Thompson
-
Do not show the artist in the grid of albums
- 681. By Andrew Hayzen
-
* Add back confinement. Fixes: https:/
/bugs.launchpad .net/bugs/ 1315386. Approved by Victor Thompson, Ubuntu Phone Apps Jenkins Bot.
- 680. By Launchpad Translations on behalf of music-app-dev
-
Launchpad automatic translations update.
- 679. By Andrew Hayzen
-
* Use CardView in Recent Tab
* Use Recent as default if >0 recent items otherwise use Albums Tab.Approved by Ubuntu Phone Apps Jenkins Bot, Victor Thompson.
- 678. By Andrew Hayzen
-
* Set sourceSize of images.
Approved by Ubuntu Phone Apps Jenkins Bot, Victor Thompson.
- 677. By Victor Thompson
-
Force AlbumsPage's SongsModel to filter upon startup.
Approved by Ubuntu Phone Apps Jenkins Bot, Andrew Hayzen.
- 676. By Victor Thompson
-
Fix playlist deletion and renaming in recent table. Fixes: https:/
/bugs.launchpad .net/bugs/ 1382170. Approved by Andrew Hayzen, Ubuntu Phone Apps Jenkins Bot.
- 675. By Launchpad Translations on behalf of music-app-dev
-
Launchpad automatic translations update.
- 674. By Launchpad Translations on behalf of music-app-dev
-
Launchpad automatic translations update.
- 673. By Andrew Hayzen
-
* Add support for CardView in AlbumsPage.qml
* Add support for header property in CardView.qml
* Add BlurredHeader.qml
* Make AlbumsPage.qml and SongsPage.qml use BlurredHeader.qml.Approved by Victor Thompson, Ubuntu Phone Apps Jenkins Bot.
Preview Diff
1 | === modified file 'MusicAlbums.qml' | |||
2 | --- MusicAlbums.qml 2014-09-20 15:41:33 +0000 | |||
3 | +++ MusicAlbums.qml 2014-10-21 15:31:33 +0000 | |||
4 | @@ -19,37 +19,17 @@ | |||
5 | 19 | 19 | ||
6 | 20 | import QtQuick 2.3 | 20 | import QtQuick 2.3 |
7 | 21 | import Ubuntu.Components 1.1 | 21 | import Ubuntu.Components 1.1 |
8 | 22 | import Ubuntu.Components.Popups 1.0 | ||
9 | 23 | import Ubuntu.MediaScanner 0.1 | 22 | import Ubuntu.MediaScanner 0.1 |
10 | 24 | import Ubuntu.Thumbnailer 0.1 | ||
11 | 25 | import QtMultimedia 5.0 | ||
12 | 26 | import QtQuick.LocalStorage 2.0 | ||
13 | 27 | import QtGraphicalEffects 1.0 | ||
14 | 28 | import "settings.js" as Settings | ||
15 | 29 | import "playlists.js" as Playlists | ||
16 | 30 | import "common" | 23 | import "common" |
17 | 31 | 24 | ||
18 | 25 | |||
19 | 32 | MusicPage { | 26 | MusicPage { |
21 | 33 | id: mainpage | 27 | id: albumsPage |
22 | 34 | objectName: "albumsPage" | 28 | objectName: "albumsPage" |
23 | 35 | title: i18n.tr("Albums") | 29 | title: i18n.tr("Albums") |
24 | 36 | 30 | ||
41 | 37 | // TODO: This ListView is empty and causes the header to get painted with the desired background color because the | 31 | CardView { |
42 | 38 | // page is now vertically flickable. | 32 | id: albumCardView |
27 | 39 | ListView { | ||
28 | 40 | anchors.fill: parent | ||
29 | 41 | anchors.bottomMargin: musicToolbar.mouseAreaOffset + musicToolbar.minimizedHeight | ||
30 | 42 | } | ||
31 | 43 | |||
32 | 44 | GridView { | ||
33 | 45 | id: albumlist | ||
34 | 46 | anchors.fill: parent | ||
35 | 47 | anchors.leftMargin: units.gu(1) | ||
36 | 48 | anchors.top: parent.top | ||
37 | 49 | anchors.topMargin: mainView.header.height + units.gu(1) | ||
38 | 50 | anchors.bottomMargin: units.gu(1) | ||
39 | 51 | cellHeight: height/3 | ||
40 | 52 | cellWidth: height/3 | ||
43 | 53 | model: SortFilterModel { | 33 | model: SortFilterModel { |
44 | 54 | id: albumsModelFilter | 34 | id: albumsModelFilter |
45 | 55 | property alias rowCount: albumsModel.rowCount | 35 | property alias rowCount: albumsModel.rowCount |
46 | @@ -60,106 +40,24 @@ | |||
47 | 60 | sort.property: "title" | 40 | sort.property: "title" |
48 | 61 | sort.order: Qt.AscendingOrder | 41 | sort.order: Qt.AscendingOrder |
49 | 62 | } | 42 | } |
147 | 63 | 43 | delegate: Card { | |
148 | 64 | delegate: albumDelegate | 44 | id: albumCard |
149 | 65 | flow: GridView.TopToBottom | 45 | coverSources: [{art: model.art}] |
150 | 66 | 46 | objectName: "albumsPageGridItem" + index | |
151 | 67 | Component { | 47 | primaryText: model.title |
152 | 68 | id: albumDelegate | 48 | secondaryText: model.artist |
153 | 69 | Item { | 49 | |
154 | 70 | property string artist: model.artist | 50 | onClicked: { |
155 | 71 | property string album: model.title | 51 | songsPage.album = model.title; |
156 | 72 | property var covers: [{art: model.art}] | 52 | songsPage.covers = [{art: model.art}] |
157 | 73 | 53 | songsPage.genre = undefined | |
158 | 74 | id: albumItem | 54 | songsPage.isAlbum = true |
159 | 75 | height: albumlist.cellHeight - units.gu(1) | 55 | songsPage.line1 = model.artist |
160 | 76 | objectName: "albumsPageGridItem" + index | 56 | songsPage.line2 = model.title |
161 | 77 | width: albumlist.cellHeight - units.gu(1) | 57 | songsPage.title = i18n.tr("Album") |
162 | 78 | anchors.margins: units.gu(1) | 58 | |
163 | 79 | 59 | mainPageStack.push(songsPage) | |
67 | 80 | CoverRow { | ||
68 | 81 | id: albumShape | ||
69 | 82 | anchors { | ||
70 | 83 | top: parent.top | ||
71 | 84 | left: parent.left | ||
72 | 85 | verticalCenter: parent.verticalCenter | ||
73 | 86 | } | ||
74 | 87 | count: albumItem.covers.length | ||
75 | 88 | size: albumItem.width | ||
76 | 89 | covers: albumItem.covers | ||
77 | 90 | spacing: units.gu(2) | ||
78 | 91 | } | ||
79 | 92 | Item { // Background so can see text in current state | ||
80 | 93 | id: albumBg | ||
81 | 94 | anchors { | ||
82 | 95 | bottom: parent.bottom | ||
83 | 96 | left: parent.left | ||
84 | 97 | right: parent.right | ||
85 | 98 | } | ||
86 | 99 | height: units.gu(6) | ||
87 | 100 | clip: true | ||
88 | 101 | UbuntuShape{ | ||
89 | 102 | anchors { | ||
90 | 103 | bottom: parent.bottom | ||
91 | 104 | left: parent.left | ||
92 | 105 | right: parent.right | ||
93 | 106 | } | ||
94 | 107 | height: albumShape.height | ||
95 | 108 | radius: "medium" | ||
96 | 109 | color: styleMusic.common.black | ||
97 | 110 | opacity: 0.6 | ||
98 | 111 | } | ||
99 | 112 | } | ||
100 | 113 | Label { | ||
101 | 114 | id: albumArtist | ||
102 | 115 | objectName: "albums-albumartist" | ||
103 | 116 | anchors.bottom: parent.bottom | ||
104 | 117 | anchors.bottomMargin: units.gu(1) | ||
105 | 118 | anchors.left: parent.left | ||
106 | 119 | anchors.leftMargin: units.gu(1) | ||
107 | 120 | anchors.right: parent.right | ||
108 | 121 | anchors.rightMargin: units.gu(1) | ||
109 | 122 | color: styleMusic.common.white | ||
110 | 123 | elide: Text.ElideRight | ||
111 | 124 | text: model.artist | ||
112 | 125 | fontSize: "x-small" | ||
113 | 126 | } | ||
114 | 127 | Label { | ||
115 | 128 | id: albumLabel | ||
116 | 129 | anchors.bottom: parent.bottom | ||
117 | 130 | anchors.bottomMargin: units.gu(3) | ||
118 | 131 | anchors.left: parent.left | ||
119 | 132 | anchors.leftMargin: units.gu(1) | ||
120 | 133 | anchors.right: parent.right | ||
121 | 134 | anchors.rightMargin: units.gu(1) | ||
122 | 135 | color: styleMusic.common.white | ||
123 | 136 | elide: Text.ElideRight | ||
124 | 137 | text: model.title | ||
125 | 138 | fontSize: "small" | ||
126 | 139 | font.weight: Font.DemiBold | ||
127 | 140 | } | ||
128 | 141 | |||
129 | 142 | |||
130 | 143 | MouseArea { | ||
131 | 144 | anchors.fill: parent | ||
132 | 145 | onClicked: { | ||
133 | 146 | songsPage.album = model.title; | ||
134 | 147 | songsPage.covers = [{art: model.art}] | ||
135 | 148 | songsPage.genre = undefined | ||
136 | 149 | songsPage.isAlbum = true | ||
137 | 150 | songsPage.line1 = model.artist | ||
138 | 151 | songsPage.line2 = model.title | ||
139 | 152 | songsPage.title = i18n.tr("Album") | ||
140 | 153 | |||
141 | 154 | mainPageStack.push(songsPage) | ||
142 | 155 | } | ||
143 | 156 | |||
144 | 157 | // TODO: If http://pad.lv/1354753 is fixed to expose whether the Shape should appear pressed, update this as well. | ||
145 | 158 | onPressedChanged: albumShape.pressed = pressed | ||
146 | 159 | } | ||
164 | 160 | } | 60 | } |
165 | 161 | } | 61 | } |
166 | 162 | } | 62 | } |
167 | 163 | } | 63 | } |
168 | 164 | |||
169 | 165 | |||
170 | 166 | 64 | ||
171 | === modified file 'MusicArtists.qml' | |||
172 | --- MusicArtists.qml 2014-09-20 15:41:33 +0000 | |||
173 | +++ MusicArtists.qml 2014-10-21 15:31:33 +0000 | |||
174 | @@ -36,98 +36,48 @@ | |||
175 | 36 | objectName: "artistsPage" | 36 | objectName: "artistsPage" |
176 | 37 | title: i18n.tr("Artists") | 37 | title: i18n.tr("Artists") |
177 | 38 | 38 | ||
182 | 39 | ListView { | 39 | CardView { |
183 | 40 | id: artistlist | 40 | id: artistCardView |
184 | 41 | anchors.fill: parent | 41 | itemWidth: units.gu(12) |
181 | 42 | anchors.bottomMargin: musicToolbar.mouseAreaOffset + musicToolbar.minimizedHeight | ||
185 | 43 | model: ArtistsModel { | 42 | model: ArtistsModel { |
186 | 44 | id: artistsModel | 43 | id: artistsModel |
187 | 45 | albumArtists: true | 44 | albumArtists: true |
188 | 46 | store: musicStore | 45 | store: musicStore |
189 | 47 | } | 46 | } |
273 | 48 | 47 | delegate: Card { | |
274 | 49 | delegate: artistDelegate | 48 | id: artistCard |
275 | 50 | 49 | coverSources: [{art: "image://artistart/artist=" + model.artist + "&album=" + artistCard.album}] | |
276 | 51 | Component { | 50 | objectName: "artistsPageGridItem" + index |
277 | 52 | id: artistDelegate | 51 | primaryText: model.artist |
278 | 53 | 52 | secondaryTextVisible: false | |
279 | 54 | ListItem.Standard { | 53 | |
280 | 55 | id: track | 54 | property string album: "" |
281 | 56 | objectName: "artistsPageListItem" + index | 55 | |
282 | 57 | height: styleMusic.common.itemHeight | 56 | AlbumsModel { |
283 | 58 | 57 | id: albumArtistModel | |
284 | 59 | AlbumsModel { | 58 | albumArtist: model.artist |
285 | 60 | id: albumArtistModel | 59 | store: musicStore |
286 | 61 | albumArtist: model.artist | 60 | } |
287 | 62 | store: musicStore | 61 | |
288 | 63 | } | 62 | Repeater { |
289 | 64 | 63 | id: albumArtistModelRepeater | |
290 | 65 | Repeater { | 64 | model: albumArtistModel |
291 | 66 | id: albumArtistModelRepeater | 65 | delegate: Item { |
292 | 67 | model: albumArtistModel | 66 | property string album: model.title |
293 | 68 | delegate: Item { | 67 | } |
294 | 69 | property string art: model.art | 68 | |
295 | 70 | } | 69 | onItemAdded: { |
296 | 71 | property var covers: [] | 70 | artistCard.album = item.album |
297 | 72 | signal finished() | 71 | } |
298 | 73 | 72 | } | |
299 | 74 | onFinished: { | 73 | |
300 | 75 | musicRow.covers = covers | 74 | |
301 | 76 | } | 75 | onClicked: { |
302 | 77 | onItemAdded: { | 76 | albumsPage.artist = model.artist; |
303 | 78 | covers.push({art: item.art}); | 77 | albumsPage.covers = artistCard.coverSources |
304 | 79 | 78 | albumsPage.title = i18n.tr("Artist") | |
305 | 80 | if (index === count - 1) { | 79 | |
306 | 81 | finished(); | 80 | mainPageStack.push(albumsPage) |
224 | 82 | } | ||
225 | 83 | } | ||
226 | 84 | } | ||
227 | 85 | |||
228 | 86 | SongsModel { | ||
229 | 87 | id: songArtistModel | ||
230 | 88 | albumArtist: model.artist | ||
231 | 89 | store: musicStore | ||
232 | 90 | } | ||
233 | 91 | |||
234 | 92 | MusicRow { | ||
235 | 93 | id: musicRow | ||
236 | 94 | column: Column { | ||
237 | 95 | spacing: units.gu(1) | ||
238 | 96 | Label { | ||
239 | 97 | id: trackArtistAlbum | ||
240 | 98 | color: styleMusic.common.music | ||
241 | 99 | fontSize: "medium" | ||
242 | 100 | objectName: "artists-artist" | ||
243 | 101 | text: model.artist | ||
244 | 102 | } | ||
245 | 103 | Label { | ||
246 | 104 | id: trackArtistAlbums | ||
247 | 105 | color: styleMusic.common.subtitle | ||
248 | 106 | fontSize: "x-small" | ||
249 | 107 | text: i18n.tr("%1 album", "%1 albums", albumArtistModel.rowCount).arg(albumArtistModel.rowCount) | ||
250 | 108 | } | ||
251 | 109 | Label { | ||
252 | 110 | id: trackArtistAlbumTracks | ||
253 | 111 | color: styleMusic.common.subtitle | ||
254 | 112 | fontSize: "x-small" | ||
255 | 113 | text: i18n.tr("%1 song", "%1 songs", songArtistModel.rowCount).arg(songArtistModel.rowCount) | ||
256 | 114 | } | ||
257 | 115 | } | ||
258 | 116 | } | ||
259 | 117 | |||
260 | 118 | MouseArea { | ||
261 | 119 | anchors.fill: parent | ||
262 | 120 | onClicked: { | ||
263 | 121 | albumsPage.artist = model.artist | ||
264 | 122 | albumsPage.covers = musicRow.covers | ||
265 | 123 | albumsPage.title = i18n.tr("Artist") | ||
266 | 124 | |||
267 | 125 | mainPageStack.push(albumsPage) | ||
268 | 126 | } | ||
269 | 127 | |||
270 | 128 | // TODO: If http://pad.lv/1354753 is fixed to expose whether the Shape should appear pressed, update this as well. | ||
271 | 129 | onPressedChanged: musicRow.pressed = pressed | ||
272 | 130 | } | ||
307 | 131 | } | 81 | } |
308 | 132 | } | 82 | } |
309 | 133 | } | 83 | } |
310 | 134 | 84 | ||
311 | === modified file 'MusicNowPlaying.qml' | |||
312 | --- MusicNowPlaying.qml 2014-09-20 15:41:33 +0000 | |||
313 | +++ MusicNowPlaying.qml 2014-10-21 15:31:33 +0000 | |||
314 | @@ -17,7 +17,6 @@ | |||
315 | 17 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 17 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
316 | 18 | */ | 18 | */ |
317 | 19 | 19 | ||
318 | 20 | |||
319 | 21 | import QtMultimedia 5.0 | 20 | import QtMultimedia 5.0 |
320 | 22 | import QtQuick 2.3 | 21 | import QtQuick 2.3 |
321 | 23 | import QtQuick.LocalStorage 2.0 | 22 | import QtQuick.LocalStorage 2.0 |
322 | @@ -29,65 +28,363 @@ | |||
323 | 29 | 28 | ||
324 | 30 | MusicPage { | 29 | MusicPage { |
325 | 31 | id: nowPlaying | 30 | id: nowPlaying |
326 | 31 | flickable: isListView ? queuelist : null // Ensures that the header is shown in fullview | ||
327 | 32 | objectName: "nowPlayingPage" | 32 | objectName: "nowPlayingPage" |
329 | 33 | title: i18n.tr("Now Playing") | 33 | title: isListView ? i18n.tr("Queue") : i18n.tr("Now playing") |
330 | 34 | visible: false | 34 | visible: false |
331 | 35 | 35 | ||
333 | 36 | property int ensureVisibleIndex: 0 // ensure first index is visible at startup | 36 | property bool isListView: false |
334 | 37 | |||
335 | 38 | onIsListViewChanged: { | ||
336 | 39 | if (isListView) { | ||
337 | 40 | positionAt(player.currentIndex); | ||
338 | 41 | } | ||
339 | 42 | } | ||
340 | 43 | |||
341 | 44 | head.backAction: Action { | ||
342 | 45 | iconName: "back"; | ||
343 | 46 | objectName: "backButton" | ||
344 | 47 | onTriggered: { | ||
345 | 48 | mainPageStack.pop(); | ||
346 | 49 | |||
347 | 50 | while (mainPageStack.depth > 1) { // jump back to the tab layer if via SongsPage | ||
348 | 51 | mainPageStack.pop(); | ||
349 | 52 | } | ||
350 | 53 | } | ||
351 | 54 | } | ||
352 | 55 | |||
353 | 56 | head { | ||
354 | 57 | actions: [ | ||
355 | 58 | Action { | ||
356 | 59 | objectName: "clearQueue" | ||
357 | 60 | iconName: "delete" | ||
358 | 61 | visible: isListView | ||
359 | 62 | onTriggered: { | ||
360 | 63 | head.backAction.trigger() | ||
361 | 64 | trackQueue.model.clear() | ||
362 | 65 | } | ||
363 | 66 | }, | ||
364 | 67 | Action { | ||
365 | 68 | objectName: "toggleView" | ||
366 | 69 | iconName: "media-playlist" | ||
367 | 70 | onTriggered: { | ||
368 | 71 | isListView = !isListView | ||
369 | 72 | } | ||
370 | 73 | } | ||
371 | 74 | ] | ||
372 | 75 | } | ||
373 | 76 | |||
374 | 77 | function positionAt(index) { | ||
375 | 78 | queuelist.positionViewAtIndex(index, ListView.Center); | ||
376 | 79 | } | ||
377 | 37 | 80 | ||
378 | 38 | Rectangle { | 81 | Rectangle { |
379 | 82 | id: fullview | ||
380 | 39 | anchors.fill: parent | 83 | anchors.fill: parent |
422 | 40 | color: styleMusic.nowPlaying.backgroundColor | 84 | color: "transparent" |
423 | 41 | opacity: 0.75 // change later | 85 | visible: !isListView |
424 | 42 | MouseArea { // Block events to lower layers | 86 | |
425 | 43 | anchors.fill: parent | 87 | BlurredBackground { |
426 | 44 | } | 88 | id: blurredBackground |
427 | 45 | } | 89 | anchors.top: parent.top |
428 | 46 | 90 | anchors.topMargin: mainView.header.height | |
429 | 47 | Component.onCompleted: { | 91 | height: units.gu(27) |
430 | 48 | onToolbarShownChanged.connect(jumpToCurrent) | 92 | art: albumImage.firstSource |
431 | 49 | } | 93 | |
432 | 50 | 94 | CoverGrid { | |
433 | 51 | Connections { | 95 | id: albumImage |
434 | 52 | target: player | 96 | anchors { |
435 | 53 | onCurrentIndexChanged: { | 97 | centerIn: parent |
436 | 54 | if (player.source === "") { | 98 | } |
437 | 55 | return; | 99 | covers: [{art: player.currentMetaArt, author: player.currentMetaArtist, album: player.currentMetaAlbum}] |
438 | 56 | } | 100 | size: units.gu(18) |
439 | 57 | 101 | } | |
440 | 58 | queuelist.currentIndex = player.currentIndex; | 102 | } |
441 | 59 | 103 | ||
442 | 60 | customdebug("MusicQueue update currentIndex: " + player.source); | 104 | /* Full toolbar */ |
443 | 61 | 105 | Item { | |
444 | 62 | // Always jump to current track | 106 | id: musicToolbarFullContainer |
445 | 63 | nowPlaying.jumpToCurrent(musicToolbar.opened, nowPlaying, musicToolbar.currentTab) | 107 | anchors.top: blurredBackground.bottom |
446 | 64 | 108 | anchors.topMargin: units.gu(4) | |
447 | 65 | } | 109 | width: blurredBackground.width |
448 | 66 | } | 110 | |
449 | 67 | 111 | /* Column for labels in wideAspect */ | |
450 | 68 | function jumpToCurrent(shown, currentPage, currentTab) | 112 | Column { |
451 | 69 | { | 113 | id: nowPlayingWideAspectLabels |
452 | 70 | // If the toolbar is shown, the page is now playing and snaptrack is enabled | 114 | spacing: units.gu(1) |
453 | 71 | if (shown && currentPage === nowPlaying && Settings.getSetting("snaptrack") === "1") | 115 | anchors { |
454 | 72 | { | 116 | left: parent.left |
455 | 73 | // Then position the view at the current index | 117 | leftMargin: units.gu(2) |
456 | 74 | queuelist.positionViewAtIndex(queuelist.currentIndex, ListView.Beginning); | 118 | right: parent.right |
457 | 75 | } | 119 | rightMargin: units.gu(2) |
458 | 76 | } | 120 | } |
459 | 77 | 121 | ||
460 | 78 | function positionAt(index) { | 122 | /* Title of track */ |
461 | 79 | queuelist.positionViewAtIndex(index, ListView.Beginning); | 123 | Label { |
462 | 80 | queuelist.contentY -= header.height; | 124 | id: nowPlayingWideAspectTitle |
463 | 125 | anchors { | ||
464 | 126 | left: parent.left | ||
465 | 127 | leftMargin: units.gu(1) | ||
466 | 128 | right: parent.right | ||
467 | 129 | rightMargin: units.gu(1) | ||
468 | 130 | } | ||
469 | 131 | color: styleMusic.playerControls.labelColor | ||
470 | 132 | elide: Text.ElideRight | ||
471 | 133 | fontSize: "x-large" | ||
472 | 134 | objectName: "playercontroltitle" | ||
473 | 135 | text: trackQueue.model.count === 0 ? "" : player.currentMetaTitle === "" ? player.currentMetaFile : player.currentMetaTitle | ||
474 | 136 | } | ||
475 | 137 | |||
476 | 138 | /* Artist of track */ | ||
477 | 139 | Label { | ||
478 | 140 | id: nowPlayingWideAspectArtist | ||
479 | 141 | anchors { | ||
480 | 142 | left: parent.left | ||
481 | 143 | leftMargin: units.gu(1) | ||
482 | 144 | right: parent.right | ||
483 | 145 | rightMargin: units.gu(1) | ||
484 | 146 | } | ||
485 | 147 | color: styleMusic.nowPlaying.labelSecondaryColor | ||
486 | 148 | elide: Text.ElideRight | ||
487 | 149 | fontSize: "small" | ||
488 | 150 | text: trackQueue.model.count === 0 ? "" : player.currentMetaArtist | ||
489 | 151 | } | ||
490 | 152 | } | ||
491 | 153 | |||
492 | 154 | /* Progress bar component */ | ||
493 | 155 | MouseArea { | ||
494 | 156 | id: musicToolbarFullProgressContainer | ||
495 | 157 | anchors.left: parent.left | ||
496 | 158 | anchors.leftMargin: units.gu(3) | ||
497 | 159 | anchors.right: parent.right | ||
498 | 160 | anchors.rightMargin: units.gu(3) | ||
499 | 161 | anchors.top: nowPlayingWideAspectLabels.bottom | ||
500 | 162 | anchors.topMargin: units.gu(3) | ||
501 | 163 | height: units.gu(3) | ||
502 | 164 | width: parent.width | ||
503 | 165 | |||
504 | 166 | /* Position label */ | ||
505 | 167 | Label { | ||
506 | 168 | id: musicToolbarFullPositionLabel | ||
507 | 169 | anchors.top: progressSliderMusic.bottom | ||
508 | 170 | anchors.topMargin: units.gu(-2) | ||
509 | 171 | anchors.left: parent.left | ||
510 | 172 | color: styleMusic.nowPlaying.labelSecondaryColor | ||
511 | 173 | fontSize: "small" | ||
512 | 174 | height: parent.height | ||
513 | 175 | horizontalAlignment: Text.AlignHCenter | ||
514 | 176 | text: durationToString(player.position) | ||
515 | 177 | verticalAlignment: Text.AlignVCenter | ||
516 | 178 | width: units.gu(3) | ||
517 | 179 | } | ||
518 | 180 | |||
519 | 181 | Slider { | ||
520 | 182 | id: progressSliderMusic | ||
521 | 183 | anchors.left: parent.left | ||
522 | 184 | anchors.right: parent.right | ||
523 | 185 | objectName: "progressSliderShape" | ||
524 | 186 | |||
525 | 187 | function formatValue(v) { | ||
526 | 188 | if (seeking) { // update position label while dragging | ||
527 | 189 | musicToolbarFullPositionLabel.text = durationToString(v) | ||
528 | 190 | } | ||
529 | 191 | |||
530 | 192 | return durationToString(v) | ||
531 | 193 | } | ||
532 | 194 | |||
533 | 195 | property bool seeking: false | ||
534 | 196 | property bool seeked: false | ||
535 | 197 | |||
536 | 198 | onSeekingChanged: { | ||
537 | 199 | if (seeking === false) { | ||
538 | 200 | musicToolbarFullPositionLabel.text = durationToString(player.position) | ||
539 | 201 | } | ||
540 | 202 | } | ||
541 | 203 | |||
542 | 204 | Component.onCompleted: { | ||
543 | 205 | Theme.palette.selected.foreground = UbuntuColors.blue | ||
544 | 206 | } | ||
545 | 207 | |||
546 | 208 | onPressedChanged: { | ||
547 | 209 | seeking = pressed | ||
548 | 210 | if (!pressed) { | ||
549 | 211 | seeked = true | ||
550 | 212 | player.seek(value) | ||
551 | 213 | } | ||
552 | 214 | } | ||
553 | 215 | |||
554 | 216 | Connections { | ||
555 | 217 | target: player | ||
556 | 218 | onDurationChanged: { | ||
557 | 219 | musicToolbarFullDurationLabel.text = durationToString(player.duration) | ||
558 | 220 | progressSliderMusic.maximumValue = player.duration | ||
559 | 221 | } | ||
560 | 222 | onPositionChanged: { | ||
561 | 223 | // seeked is a workaround for bug 1310706 as the first position after a seek is sometimes invalid (0) | ||
562 | 224 | if (progressSliderMusic.seeking === false && !progressSliderMusic.seeked) { | ||
563 | 225 | progressSliderMusic.value = player.position | ||
564 | 226 | musicToolbarFullPositionLabel.text = durationToString(player.position) | ||
565 | 227 | musicToolbarFullDurationLabel.text = durationToString(player.duration) | ||
566 | 228 | } | ||
567 | 229 | |||
568 | 230 | progressSliderMusic.seeked = false; | ||
569 | 231 | } | ||
570 | 232 | onStopped: { | ||
571 | 233 | musicToolbarFullPositionLabel.text = durationToString(0); | ||
572 | 234 | musicToolbarFullDurationLabel.text = durationToString(0); | ||
573 | 235 | } | ||
574 | 236 | } | ||
575 | 237 | } | ||
576 | 238 | |||
577 | 239 | /* Duration label */ | ||
578 | 240 | Label { | ||
579 | 241 | id: musicToolbarFullDurationLabel | ||
580 | 242 | anchors.top: progressSliderMusic.bottom | ||
581 | 243 | anchors.topMargin: units.gu(-2) | ||
582 | 244 | anchors.right: parent.right | ||
583 | 245 | color: styleMusic.nowPlaying.labelSecondaryColor | ||
584 | 246 | fontSize: "small" | ||
585 | 247 | height: parent.height | ||
586 | 248 | horizontalAlignment: Text.AlignHCenter | ||
587 | 249 | text: durationToString(player.duration) | ||
588 | 250 | verticalAlignment: Text.AlignVCenter | ||
589 | 251 | width: units.gu(3) | ||
590 | 252 | } | ||
591 | 253 | } | ||
592 | 254 | |||
593 | 255 | /* Repeat button */ | ||
594 | 256 | MouseArea { | ||
595 | 257 | id: nowPlayingRepeatButton | ||
596 | 258 | anchors.right: nowPlayingPreviousButton.left | ||
597 | 259 | anchors.rightMargin: units.gu(1) | ||
598 | 260 | anchors.verticalCenter: nowPlayingPlayButton.verticalCenter | ||
599 | 261 | height: units.gu(6) | ||
600 | 262 | opacity: player.repeat && !emptyPage.noMusic ? 1 : .4 | ||
601 | 263 | width: height | ||
602 | 264 | onClicked: player.repeat = !player.repeat | ||
603 | 265 | |||
604 | 266 | Icon { | ||
605 | 267 | id: repeatIcon | ||
606 | 268 | height: units.gu(3) | ||
607 | 269 | width: height | ||
608 | 270 | anchors.verticalCenter: parent.verticalCenter | ||
609 | 271 | anchors.horizontalCenter: parent.horizontalCenter | ||
610 | 272 | color: "white" | ||
611 | 273 | name: "media-playlist-repeat" | ||
612 | 274 | objectName: "repeatShape" | ||
613 | 275 | opacity: player.repeat && !emptyPage.noMusic ? 1 : .4 | ||
614 | 276 | } | ||
615 | 277 | } | ||
616 | 278 | |||
617 | 279 | /* Previous button */ | ||
618 | 280 | MouseArea { | ||
619 | 281 | id: nowPlayingPreviousButton | ||
620 | 282 | anchors.right: nowPlayingPlayButton.left | ||
621 | 283 | anchors.rightMargin: units.gu(1) | ||
622 | 284 | anchors.verticalCenter: nowPlayingPlayButton.verticalCenter | ||
623 | 285 | height: units.gu(6) | ||
624 | 286 | opacity: trackQueue.model.count === 0 ? .4 : 1 | ||
625 | 287 | width: height | ||
626 | 288 | onClicked: player.previousSong() | ||
627 | 289 | |||
628 | 290 | Icon { | ||
629 | 291 | id: nowPlayingPreviousIndicator | ||
630 | 292 | height: units.gu(3) | ||
631 | 293 | width: height | ||
632 | 294 | anchors.verticalCenter: parent.verticalCenter | ||
633 | 295 | anchors.horizontalCenter: parent.horizontalCenter | ||
634 | 296 | color: "white" | ||
635 | 297 | name: "media-skip-backward" | ||
636 | 298 | objectName: "previousShape" | ||
637 | 299 | opacity: 1 | ||
638 | 300 | } | ||
639 | 301 | } | ||
640 | 302 | |||
641 | 303 | /* Play/Pause button */ | ||
642 | 304 | MouseArea { | ||
643 | 305 | id: nowPlayingPlayButton | ||
644 | 306 | anchors.horizontalCenter: parent.horizontalCenter | ||
645 | 307 | anchors.top: musicToolbarFullProgressContainer.bottom | ||
646 | 308 | anchors.topMargin: units.gu(2) | ||
647 | 309 | height: units.gu(12) | ||
648 | 310 | width: height | ||
649 | 311 | onClicked: player.toggle() | ||
650 | 312 | |||
651 | 313 | Icon { | ||
652 | 314 | id: nowPlayingPlayIndicator | ||
653 | 315 | height: units.gu(6) | ||
654 | 316 | width: height | ||
655 | 317 | anchors.verticalCenter: parent.verticalCenter | ||
656 | 318 | anchors.horizontalCenter: parent.horizontalCenter | ||
657 | 319 | opacity: emptyPage.noMusic ? .4 : 1 | ||
658 | 320 | color: "white" | ||
659 | 321 | name: player.playbackState === MediaPlayer.PlayingState ? "media-playback-pause" : "media-playback-start" | ||
660 | 322 | objectName: "playShape" | ||
661 | 323 | } | ||
662 | 324 | } | ||
663 | 325 | |||
664 | 326 | /* Next button */ | ||
665 | 327 | MouseArea { | ||
666 | 328 | id: nowPlayingNextButton | ||
667 | 329 | anchors.left: nowPlayingPlayButton.right | ||
668 | 330 | anchors.leftMargin: units.gu(1) | ||
669 | 331 | anchors.verticalCenter: nowPlayingPlayButton.verticalCenter | ||
670 | 332 | height: units.gu(6) | ||
671 | 333 | opacity: trackQueue.model.count === 0 ? .4 : 1 | ||
672 | 334 | width: height | ||
673 | 335 | onClicked: player.nextSong() | ||
674 | 336 | |||
675 | 337 | Icon { | ||
676 | 338 | id: nowPlayingNextIndicator | ||
677 | 339 | height: units.gu(3) | ||
678 | 340 | width: height | ||
679 | 341 | anchors.verticalCenter: parent.verticalCenter | ||
680 | 342 | anchors.horizontalCenter: parent.horizontalCenter | ||
681 | 343 | color: "white" | ||
682 | 344 | name: "media-skip-forward" | ||
683 | 345 | objectName: "forwardShape" | ||
684 | 346 | opacity: 1 | ||
685 | 347 | } | ||
686 | 348 | } | ||
687 | 349 | |||
688 | 350 | /* Shuffle button */ | ||
689 | 351 | MouseArea { | ||
690 | 352 | id: nowPlayingShuffleButton | ||
691 | 353 | anchors.left: nowPlayingNextButton.right | ||
692 | 354 | anchors.leftMargin: units.gu(1) | ||
693 | 355 | anchors.verticalCenter: nowPlayingPlayButton.verticalCenter | ||
694 | 356 | height: units.gu(6) | ||
695 | 357 | opacity: player.shuffle && !emptyPage.noMusic ? 1 : .4 | ||
696 | 358 | width: height | ||
697 | 359 | onClicked: player.shuffle = !player.shuffle | ||
698 | 360 | |||
699 | 361 | Icon { | ||
700 | 362 | id: shuffleIcon | ||
701 | 363 | height: units.gu(3) | ||
702 | 364 | width: height | ||
703 | 365 | anchors.verticalCenter: parent.verticalCenter | ||
704 | 366 | anchors.horizontalCenter: parent.horizontalCenter | ||
705 | 367 | color: "white" | ||
706 | 368 | name: "media-playlist-shuffle" | ||
707 | 369 | objectName: "shuffleShape" | ||
708 | 370 | opacity: player.shuffle && !emptyPage.noMusic ? 1 : .4 | ||
709 | 371 | } | ||
710 | 372 | } | ||
711 | 373 | } | ||
712 | 81 | } | 374 | } |
713 | 82 | 375 | ||
714 | 83 | ListView { | 376 | ListView { |
715 | 84 | id: queuelist | 377 | id: queuelist |
719 | 85 | objectName: "nowPlayingQueueList" | 378 | anchors { |
720 | 86 | anchors.fill: parent | 379 | fill: parent |
721 | 87 | anchors.bottomMargin: musicToolbar.mouseAreaOffset + musicToolbar.minimizedHeight | 380 | topMargin: units.gu(2) |
722 | 381 | } | ||
723 | 88 | delegate: queueDelegate | 382 | delegate: queueDelegate |
724 | 383 | footer: Item { | ||
725 | 384 | height: mainView.height - (styleMusic.common.expandHeight + queuelist.currentHeight) + units.gu(8) | ||
726 | 385 | } | ||
727 | 89 | model: trackQueue.model | 386 | model: trackQueue.model |
729 | 90 | highlightFollowsCurrentItem: false | 387 | objectName: "nowPlayingQueueList" |
730 | 91 | state: "normal" | 388 | state: "normal" |
731 | 92 | states: [ | 389 | states: [ |
732 | 93 | State { | 390 | State { |
733 | @@ -105,33 +402,29 @@ | |||
734 | 105 | } | 402 | } |
735 | 106 | } | 403 | } |
736 | 107 | ] | 404 | ] |
740 | 108 | footer: Item { | 405 | visible: isListView |
738 | 109 | height: mainView.height - (styleMusic.common.expandHeight + queuelist.currentHeight) + units.gu(8) | ||
739 | 110 | } | ||
741 | 111 | 406 | ||
744 | 112 | property int normalHeight: units.gu(12) | 407 | property int normalHeight: units.gu(6) |
743 | 113 | property int currentHeight: units.gu(40) | ||
745 | 114 | property int transitionDuration: 250 // transition length of animations | 408 | property int transitionDuration: 250 // transition length of animations |
746 | 115 | 409 | ||
747 | 116 | onCountChanged: { | 410 | onCountChanged: { |
748 | 117 | customdebug("Queue: Now has: " + queuelist.count + " tracks") | 411 | customdebug("Queue: Now has: " + queuelist.count + " tracks") |
749 | 118 | } | 412 | } |
750 | 119 | 413 | ||
751 | 120 | onMovementStarted: { | ||
752 | 121 | musicToolbar.hideToolbar(); | ||
753 | 122 | } | ||
754 | 123 | |||
755 | 124 | Component { | 414 | Component { |
756 | 125 | id: queueDelegate | 415 | id: queueDelegate |
757 | 126 | ListItemWithActions { | 416 | ListItemWithActions { |
758 | 127 | id: queueListItem | 417 | id: queueListItem |
760 | 128 | color: "transparent" | 418 | color: player.currentIndex === index ? "#2c2c34" : "transparent" |
761 | 129 | height: queuelist.normalHeight | 419 | height: queuelist.normalHeight |
762 | 130 | objectName: "nowPlayingListItem" + index | 420 | objectName: "nowPlayingListItem" + index |
764 | 131 | state: queuelist.currentIndex == index && !reordering ? "current" : "" | 421 | showDivider: false |
765 | 422 | state: "" | ||
766 | 132 | 423 | ||
767 | 133 | leftSideAction: Remove { | 424 | leftSideAction: Remove { |
768 | 134 | onTriggered: { | 425 | onTriggered: { |
769 | 426 | var removedIndex = index | ||
770 | 427 | |||
771 | 135 | if (queuelist.count === 1) { | 428 | if (queuelist.count === 1) { |
772 | 136 | player.stop() | 429 | player.stop() |
773 | 137 | musicToolbar.goBack() | 430 | musicToolbar.goBack() |
774 | @@ -139,12 +432,12 @@ | |||
775 | 139 | player.nextSong(player.isPlaying); | 432 | player.nextSong(player.isPlaying); |
776 | 140 | } | 433 | } |
777 | 141 | 434 | ||
779 | 142 | if (index < player.currentIndex) { | 435 | queuelist.model.remove(index); |
780 | 436 | |||
781 | 437 | if (removedIndex < player.currentIndex) { | ||
782 | 143 | // update index as the old has been removed | 438 | // update index as the old has been removed |
783 | 144 | player.currentIndex -= 1; | 439 | player.currentIndex -= 1; |
784 | 145 | } | 440 | } |
785 | 146 | |||
786 | 147 | queuelist.model.remove(index); | ||
787 | 148 | } | 441 | } |
788 | 149 | } | 442 | } |
789 | 150 | reorderable: true | 443 | reorderable: true |
790 | @@ -177,14 +470,10 @@ | |||
791 | 177 | } | 470 | } |
792 | 178 | } | 471 | } |
793 | 179 | 472 | ||
794 | 180 | // TODO: If http://pad.lv/1354753 is fixed to expose whether the Shape should appear pressed, update this as well. | ||
795 | 181 | onPressedChanged: trackImage.pressed = pressed | ||
796 | 182 | |||
797 | 183 | Rectangle { | 473 | Rectangle { |
798 | 184 | id: trackContainer; | 474 | id: trackContainer; |
799 | 185 | anchors { | 475 | anchors { |
800 | 186 | fill: parent | 476 | fill: parent |
801 | 187 | margins: units.gu(1) | ||
802 | 188 | } | 477 | } |
803 | 189 | color: "transparent" | 478 | color: "transparent" |
804 | 190 | 479 | ||
805 | @@ -204,159 +493,28 @@ | |||
806 | 204 | to: units.gu(0.5) | 493 | to: units.gu(0.5) |
807 | 205 | } | 494 | } |
808 | 206 | 495 | ||
962 | 207 | CoverRow { | 496 | MusicRow { |
963 | 208 | id: trackImage | 497 | id: musicRow |
964 | 209 | 498 | covers: [{art: model.art, album: model.album, author: model.author}] | |
965 | 210 | anchors { | 499 | showCovers: false |
966 | 211 | top: parent.top | 500 | coverSize: units.gu(6) |
967 | 212 | left: parent.left | 501 | column: Column { |
968 | 213 | leftMargin: units.gu(1.5) | 502 | Label { |
969 | 214 | } | 503 | id: trackTitle |
970 | 215 | count: 1 | 504 | color: player.currentIndex === index ? UbuntuColors.blue |
971 | 216 | size: (queueListItem.state === "current" | 505 | : styleMusic.common.music |
972 | 217 | ? (mainView.wideAspect | 506 | fontSize: "small" |
973 | 218 | ? queuelist.currentHeight | 507 | objectName: "titleLabel" |
974 | 219 | : mainView.width - (trackImage.anchors.leftMargin * 2)) | 508 | text: model.title |
975 | 220 | : queuelist.normalHeight) - units.gu(2) | 509 | } |
976 | 221 | covers: [{art: model.art}] | 510 | |
977 | 222 | 511 | Label { | |
978 | 223 | spacing: units.gu(2) | 512 | id: trackArtist |
979 | 224 | 513 | color: styleMusic.common.subtitle | |
980 | 225 | Item { // Background so can see text in current state | 514 | fontSize: "x-small" |
981 | 226 | id: albumBg | 515 | objectName: "artistLabel" |
982 | 227 | visible: false | 516 | text: model.author |
983 | 228 | anchors { | 517 | } |
831 | 229 | bottom: parent.bottom | ||
832 | 230 | left: parent.left | ||
833 | 231 | right: parent.right | ||
834 | 232 | } | ||
835 | 233 | height: units.gu(9) | ||
836 | 234 | clip: true | ||
837 | 235 | UbuntuShape{ | ||
838 | 236 | anchors { | ||
839 | 237 | bottom: parent.bottom | ||
840 | 238 | left: parent.left | ||
841 | 239 | right: parent.right | ||
842 | 240 | } | ||
843 | 241 | height: trackImage.height | ||
844 | 242 | radius: "medium" | ||
845 | 243 | color: styleMusic.common.black | ||
846 | 244 | opacity: 0.6 | ||
847 | 245 | } | ||
848 | 246 | } | ||
849 | 247 | |||
850 | 248 | function calcAnchors() { | ||
851 | 249 | if (trackImage.height > queuelist.normalHeight && mainView.wideAspect) { | ||
852 | 250 | trackImage.anchors.left = undefined | ||
853 | 251 | trackImage.anchors.horizontalCenter = trackImage.parent.horizontalCenter | ||
854 | 252 | } else { | ||
855 | 253 | trackImage.anchors.left = trackImage.parent.left | ||
856 | 254 | trackImage.anchors.horizontalCenter = undefined | ||
857 | 255 | } | ||
858 | 256 | |||
859 | 257 | trackImage.width = trackImage.height; // force width to match height | ||
860 | 258 | } | ||
861 | 259 | |||
862 | 260 | Connections { | ||
863 | 261 | target: mainView | ||
864 | 262 | onWideAspectChanged: trackImage.calcAnchors() | ||
865 | 263 | } | ||
866 | 264 | |||
867 | 265 | onHeightChanged: { | ||
868 | 266 | calcAnchors() | ||
869 | 267 | } | ||
870 | 268 | Behavior on height { | ||
871 | 269 | NumberAnimation { | ||
872 | 270 | target: trackImage; | ||
873 | 271 | property: "height"; | ||
874 | 272 | duration: queuelist.transitionDuration; | ||
875 | 273 | } | ||
876 | 274 | } | ||
877 | 275 | } | ||
878 | 276 | Label { | ||
879 | 277 | id: nowPlayingArtist | ||
880 | 278 | objectName: "artistLabel" | ||
881 | 279 | color: styleMusic.nowPlaying.labelSecondaryColor | ||
882 | 280 | elide: Text.ElideRight | ||
883 | 281 | height: units.gu(1) | ||
884 | 282 | text: model.author | ||
885 | 283 | fontSize: 'small' | ||
886 | 284 | width: parent.width - trackImage.width - units.gu(3.5) | ||
887 | 285 | x: trackImage.x + trackImage.width + units.gu(1) | ||
888 | 286 | y: trackImage.y + units.gu(1) | ||
889 | 287 | } | ||
890 | 288 | Label { | ||
891 | 289 | id: nowPlayingTitle | ||
892 | 290 | objectName: "titleLabel" | ||
893 | 291 | color: styleMusic.common.white | ||
894 | 292 | elide: Text.ElideRight | ||
895 | 293 | height: units.gu(1) | ||
896 | 294 | text: model.title | ||
897 | 295 | fontSize: 'medium' | ||
898 | 296 | width: parent.width - trackImage.width - units.gu(3.5) | ||
899 | 297 | x: trackImage.x + trackImage.width + units.gu(1) | ||
900 | 298 | y: nowPlayingArtist.y + nowPlayingArtist.height + units.gu(1.25) | ||
901 | 299 | } | ||
902 | 300 | Label { | ||
903 | 301 | id: nowPlayingAlbum | ||
904 | 302 | objectName: "albumLabel" | ||
905 | 303 | color: styleMusic.nowPlaying.labelSecondaryColor | ||
906 | 304 | elide: Text.ElideRight | ||
907 | 305 | height: units.gu(1) | ||
908 | 306 | text: model.album | ||
909 | 307 | fontSize: 'x-small' | ||
910 | 308 | width: parent.width - trackImage.width - units.gu(3.5) | ||
911 | 309 | x: trackImage.x + trackImage.width + units.gu(1) | ||
912 | 310 | y: nowPlayingTitle.y + nowPlayingTitle.height + units.gu(1.25) | ||
913 | 311 | } | ||
914 | 312 | } | ||
915 | 313 | |||
916 | 314 | states: State { | ||
917 | 315 | name: "current" | ||
918 | 316 | PropertyChanges { | ||
919 | 317 | target: queueListItem | ||
920 | 318 | height: trackImage.size + (trackContainer.anchors.margins * 2) | ||
921 | 319 | } | ||
922 | 320 | PropertyChanges { | ||
923 | 321 | target: nowPlayingArtist | ||
924 | 322 | width: trackImage.width - units.gu(4) | ||
925 | 323 | x: trackImage.x + units.gu(2) | ||
926 | 324 | y: trackImage.y + trackImage.height - albumBg.height + units.gu(1) | ||
927 | 325 | color: styleMusic.common.white | ||
928 | 326 | } | ||
929 | 327 | PropertyChanges { | ||
930 | 328 | target: nowPlayingTitle | ||
931 | 329 | width: trackImage.width - units.gu(4) | ||
932 | 330 | x: trackImage.x + units.gu(2) | ||
933 | 331 | y: nowPlayingArtist.y + nowPlayingArtist.height + units.gu(1.25) | ||
934 | 332 | color: styleMusic.common.white | ||
935 | 333 | font.weight: Font.DemiBold | ||
936 | 334 | } | ||
937 | 335 | PropertyChanges { | ||
938 | 336 | target: nowPlayingAlbum | ||
939 | 337 | width: trackImage.width - units.gu(4) | ||
940 | 338 | x: trackImage.x + units.gu(2) | ||
941 | 339 | y: nowPlayingTitle.y + nowPlayingTitle.height + units.gu(1.25) | ||
942 | 340 | color: styleMusic.common.white | ||
943 | 341 | } | ||
944 | 342 | PropertyChanges { | ||
945 | 343 | target: albumBg | ||
946 | 344 | visible: true | ||
947 | 345 | } | ||
948 | 346 | } | ||
949 | 347 | transitions: Transition { | ||
950 | 348 | from: ",current" | ||
951 | 349 | to: "current," | ||
952 | 350 | NumberAnimation { | ||
953 | 351 | duration: queuelist.transitionDuration | ||
954 | 352 | properties: "height,opacity,width,x,y" | ||
955 | 353 | } | ||
956 | 354 | |||
957 | 355 | onRunningChanged: { | ||
958 | 356 | if (running === false && ensureVisibleIndex != -1) | ||
959 | 357 | { | ||
960 | 358 | queuelist.positionViewAtIndex(ensureVisibleIndex, ListView.Beginning); | ||
961 | 359 | ensureVisibleIndex = -1; | ||
984 | 360 | } | 518 | } |
985 | 361 | } | 519 | } |
986 | 362 | } | 520 | } |
987 | 363 | 521 | ||
988 | === modified file 'MusicPlaylists.qml' | |||
989 | --- MusicPlaylists.qml 2014-10-19 06:28:03 +0000 | |||
990 | +++ MusicPlaylists.qml 2014-10-21 15:31:33 +0000 | |||
991 | @@ -23,36 +23,37 @@ | |||
992 | 23 | import Ubuntu.Components.Popups 1.0 | 23 | import Ubuntu.Components.Popups 1.0 |
993 | 24 | import QtMultimedia 5.0 | 24 | import QtMultimedia 5.0 |
994 | 25 | import QtQuick.LocalStorage 2.0 | 25 | import QtQuick.LocalStorage 2.0 |
995 | 26 | <<<<<<< TREE | ||
996 | 26 | import "meta-database.js" as Library | 27 | import "meta-database.js" as Library |
997 | 27 | import "settings.js" as Settings | 28 | import "settings.js" as Settings |
998 | 28 | import "scrobble.js" as Scrobble | 29 | import "scrobble.js" as Scrobble |
999 | 30 | ======= | ||
1000 | 31 | >>>>>>> MERGE-SOURCE | ||
1001 | 29 | import "playlists.js" as Playlists | 32 | import "playlists.js" as Playlists |
1002 | 30 | import "common" | 33 | import "common" |
1003 | 31 | import "common/ListItemActions" | ||
1004 | 32 | 34 | ||
1005 | 33 | // page for the playlists | 35 | // page for the playlists |
1006 | 34 | MusicPage { | 36 | MusicPage { |
1008 | 35 | id: listspage | 37 | id: playlistsPage |
1009 | 36 | objectName: "playlistsPage" | 38 | objectName: "playlistsPage" |
1010 | 37 | // TRANSLATORS: this is the name of the playlists page shown in the tab header. | 39 | // TRANSLATORS: this is the name of the playlists page shown in the tab header. |
1011 | 38 | // Remember to keep the translation short to fit the screen width | 40 | // Remember to keep the translation short to fit the screen width |
1012 | 39 | title: i18n.tr("Playlists") | 41 | title: i18n.tr("Playlists") |
1013 | 40 | 42 | ||
1014 | 41 | property string playlistTracks: "" | 43 | property string playlistTracks: "" |
1015 | 42 | property string oldPlaylistName: "" | ||
1016 | 43 | property string inPlaylist: "" | 44 | property string inPlaylist: "" |
1017 | 44 | 45 | ||
1021 | 45 | tools: ToolbarItems { | 46 | head { |
1022 | 46 | ToolbarButton { | 47 | actions: [ |
1023 | 47 | action: Action { | 48 | Action { |
1024 | 48 | objectName: "newplaylistButton" | 49 | objectName: "newplaylistButton" |
1025 | 49 | text: i18n.tr("New playlist") | ||
1026 | 50 | iconName: "add" | 50 | iconName: "add" |
1027 | 51 | onTriggered: { | 51 | onTriggered: { |
1028 | 52 | customdebug("New playlist.") | 52 | customdebug("New playlist.") |
1029 | 53 | PopupUtils.open(newPlaylistDialog, mainView) | 53 | PopupUtils.open(newPlaylistDialog, mainView) |
1030 | 54 | } | 54 | } |
1031 | 55 | } | 55 | } |
1032 | 56 | <<<<<<< TREE | ||
1033 | 56 | } | 57 | } |
1034 | 57 | } | 58 | } |
1035 | 58 | 59 | ||
1036 | @@ -120,11 +121,15 @@ | |||
1037 | 120 | } | 121 | } |
1038 | 121 | 122 | ||
1039 | 122 | ListView { | 123 | ListView { |
1040 | 124 | ======= | ||
1041 | 125 | ] | ||
1042 | 126 | } | ||
1043 | 127 | |||
1044 | 128 | CardView { | ||
1045 | 129 | >>>>>>> MERGE-SOURCE | ||
1046 | 123 | id: playlistslist | 130 | id: playlistslist |
1047 | 124 | objectName: "playlistsListView" | ||
1048 | 125 | anchors.fill: parent | ||
1049 | 126 | anchors.bottomMargin: musicToolbar.mouseAreaOffset + musicToolbar.minimizedHeight | ||
1050 | 127 | model: playlistModel.model | 131 | model: playlistModel.model |
1051 | 132 | <<<<<<< TREE | ||
1052 | 128 | delegate: playlistDelegate | 133 | delegate: playlistDelegate |
1053 | 129 | onCountChanged: { | 134 | onCountChanged: { |
1054 | 130 | customdebug("onCountChanged: " + playlistslist.count) | 135 | customdebug("onCountChanged: " + playlistslist.count) |
1055 | @@ -199,6 +204,25 @@ | |||
1056 | 199 | } | 204 | } |
1057 | 200 | } | 205 | } |
1058 | 201 | } | 206 | } |
1059 | 207 | ======= | ||
1060 | 208 | objectName: "playlistsCardView" | ||
1061 | 209 | delegate: Card { | ||
1062 | 210 | id: playlistCard | ||
1063 | 211 | coverSources: Playlists.getPlaylistCovers(name) | ||
1064 | 212 | primaryText: name | ||
1065 | 213 | secondaryText: i18n.tr("%1 song", "%1 songs", count).arg(count) | ||
1066 | 214 | |||
1067 | 215 | onClicked: { | ||
1068 | 216 | albumTracksModel.filterPlaylistTracks(name) | ||
1069 | 217 | songsPage.isAlbum = false | ||
1070 | 218 | songsPage.line1 = i18n.tr("Playlist") | ||
1071 | 219 | songsPage.line2 = model.name | ||
1072 | 220 | songsPage.covers = coverSources | ||
1073 | 221 | songsPage.genre = undefined | ||
1074 | 222 | songsPage.title = i18n.tr("Playlist") | ||
1075 | 223 | |||
1076 | 224 | mainPageStack.push(songsPage) | ||
1077 | 225 | >>>>>>> MERGE-SOURCE | ||
1078 | 202 | } | 226 | } |
1079 | 203 | } | 227 | } |
1080 | 204 | } | 228 | } |
1081 | 205 | 229 | ||
1082 | === modified file 'MusicSettings.qml' | |||
1083 | --- MusicSettings.qml 2014-09-20 10:50:45 +0000 | |||
1084 | +++ MusicSettings.qml 2014-10-21 15:31:33 +0000 | |||
1085 | @@ -30,17 +30,6 @@ | |||
1086 | 30 | title: i18n.tr("Settings") | 30 | title: i18n.tr("Settings") |
1087 | 31 | contentsHeight: parent.height; | 31 | contentsHeight: parent.height; |
1088 | 32 | 32 | ||
1089 | 33 | onVisibleChanged: { | ||
1090 | 34 | if (visible === true) | ||
1091 | 35 | { | ||
1092 | 36 | musicToolbar.disableToolbar() | ||
1093 | 37 | } | ||
1094 | 38 | else | ||
1095 | 39 | { | ||
1096 | 40 | musicToolbar.enableToolbar() | ||
1097 | 41 | } | ||
1098 | 42 | } | ||
1099 | 43 | |||
1100 | 44 | onCancelClicked: PopupUtils.close(musicSettings) | 33 | onCancelClicked: PopupUtils.close(musicSettings) |
1101 | 45 | onConfirmClicked: { | 34 | onConfirmClicked: { |
1102 | 46 | PopupUtils.close(musicSettings) | 35 | PopupUtils.close(musicSettings) |
1103 | 47 | 36 | ||
1104 | === modified file 'MusicStart.qml' | |||
1105 | --- MusicStart.qml 2014-09-20 15:41:33 +0000 | |||
1106 | +++ MusicStart.qml 2014-10-21 15:31:33 +0000 | |||
1107 | @@ -32,482 +32,45 @@ | |||
1108 | 32 | 32 | ||
1109 | 33 | MusicPage { | 33 | MusicPage { |
1110 | 34 | id: mainpage | 34 | id: mainpage |
1112 | 35 | title: i18n.tr("Music") | 35 | title: i18n.tr("Recent") |
1113 | 36 | 36 | ||
1129 | 37 | /* Dev button for search. | 37 | head { |
1130 | 38 | Button { | 38 | actions: [ |
1131 | 39 | id: searchButton | 39 | Action { |
1132 | 40 | text: i18n.tr("Search") | 40 | iconName: "delete" |
1133 | 41 | anchors.top: parent.top | 41 | onTriggered: { |
1134 | 42 | anchors.topMargin: units.gu(2) | 42 | Library.clearRecentHistory() |
1135 | 43 | anchors.bottom: recentlyPlayed.top | 43 | recentModel.filterRecent() |
1136 | 44 | anchors.bottomMargin: units.gu(1) | 44 | } |
1137 | 45 | height: units.gu(4) | 45 | } |
1138 | 46 | onClicked: { | 46 | ] |
1124 | 47 | PopupUtils.open(Qt.resolvedUrl("MusicSearch.qml"), mainView, | ||
1125 | 48 | { | ||
1126 | 49 | title: i18n.tr("Search") | ||
1127 | 50 | } ) | ||
1128 | 51 | } | ||
1139 | 52 | } | 47 | } |
1598 | 53 | */ | 48 | |
1599 | 54 | Flickable{ | 49 | CardView { |
1600 | 55 | id: musicFlickable | 50 | id: recentCardView |
1601 | 56 | anchors.fill: parent | 51 | model: recentModel.model |
1602 | 57 | 52 | delegate: Card { | |
1603 | 58 | width: mainpage.width | 53 | id: albumCard |
1604 | 59 | height: mainpage.height | 54 | coverSources: model.type === "playlist" ? Playlists.getPlaylistCovers(title) : (model.art !== undefined ? [{art: model.art}] : [{author: model.title2, album: model.title}]) |
1605 | 60 | 55 | objectName: "albumsPageGridItem" + index | |
1606 | 61 | contentHeight: mainView.hasRecent ? recentlyPlayed.height + recentlist.height + genres.height + genrelist.height + albums.height + albumlist.height + units.gu(4) | 56 | primaryText: model.title |
1607 | 62 | : genres.height + genrelist.height + albums.height + albumlist.height + units.gu(3) | 57 | secondaryText: model.title2 !== "Playlist" ? model.title2 : i18n.tr("Playlist") |
1608 | 63 | contentWidth: width | 58 | |
1609 | 64 | 59 | onClicked: { | |
1610 | 65 | focus: true | 60 | if (type === "playlist") { |
1611 | 66 | 61 | albumTracksModel.filterPlaylistTracks(model.key) | |
1612 | 67 | ListItem.Standard { | 62 | } else { |
1613 | 68 | id: recentlyPlayed | 63 | songsPage.album = title; |
1614 | 69 | Label { | 64 | } |
1615 | 70 | anchors { | 65 | songsPage.genre = undefined; |
1616 | 71 | verticalCenter: parent.verticalCenter | 66 | |
1617 | 72 | left: parent.left | 67 | songsPage.line1 = secondaryText |
1618 | 73 | leftMargin: units.gu(2) | 68 | songsPage.line2 = primaryText |
1619 | 74 | } | 69 | songsPage.covers = coverSources |
1620 | 75 | text: i18n.tr("Recent") | 70 | songsPage.isAlbum = (type === "album") |
1621 | 76 | color: styleMusic.common.music | 71 | songsPage.title = songsPage.isAlbum ? i18n.tr("Album") : i18n.tr("Playlist") |
1622 | 77 | } | 72 | |
1623 | 78 | visible: mainView.hasRecent | 73 | mainPageStack.push(songsPage) |
1166 | 79 | } | ||
1167 | 80 | |||
1168 | 81 | ListView { | ||
1169 | 82 | id: recentlist | ||
1170 | 83 | anchors.top: recentlyPlayed.bottom | ||
1171 | 84 | anchors.topMargin: units.gu(1) | ||
1172 | 85 | width: parent.width | ||
1173 | 86 | spacing: units.gu(1) | ||
1174 | 87 | height: units.gu(18) | ||
1175 | 88 | // TODO: Update when view counts are collected | ||
1176 | 89 | model: recentModel.model | ||
1177 | 90 | delegate: recentDelegate | ||
1178 | 91 | header: Item { | ||
1179 | 92 | id: recentSpacer | ||
1180 | 93 | width: units.gu(1) | ||
1181 | 94 | } | ||
1182 | 95 | footer: Item { | ||
1183 | 96 | id: clearRecent | ||
1184 | 97 | width: recentlist.height - units.gu(2) | ||
1185 | 98 | height: width | ||
1186 | 99 | visible: mainView.hasRecent && !loading.visible | ||
1187 | 100 | Button { | ||
1188 | 101 | id: clearRecentButton | ||
1189 | 102 | anchors.centerIn: parent | ||
1190 | 103 | text: i18n.tr("Clear History") | ||
1191 | 104 | onClicked: { | ||
1192 | 105 | Library.clearRecentHistory() | ||
1193 | 106 | mainView.hasRecent = false | ||
1194 | 107 | recentModel.filterRecent() | ||
1195 | 108 | } | ||
1196 | 109 | } | ||
1197 | 110 | } | ||
1198 | 111 | orientation: ListView.Horizontal | ||
1199 | 112 | visible: mainView.hasRecent | ||
1200 | 113 | |||
1201 | 114 | Component { | ||
1202 | 115 | id: recentDelegate | ||
1203 | 116 | Item { | ||
1204 | 117 | property string title: model.title | ||
1205 | 118 | property string title2: model.title2 !== "Playlist" ? model.title2 : i18n.tr("Playlist") | ||
1206 | 119 | property var covers: type === "playlist" ? Playlists.getPlaylistCovers(title) : (model.art !== undefined ? [{art: model.art}] : [{author: model.title2, album: model.title}]) | ||
1207 | 120 | property string type: model.type | ||
1208 | 121 | property string time: model.time | ||
1209 | 122 | property string key: model.key | ||
1210 | 123 | id: recentItem | ||
1211 | 124 | height: recentlist.height - units.gu(1) | ||
1212 | 125 | width: height | ||
1213 | 126 | CoverRow { | ||
1214 | 127 | id: recentShape | ||
1215 | 128 | anchors { | ||
1216 | 129 | top: parent.top | ||
1217 | 130 | left: parent.left | ||
1218 | 131 | verticalCenter: parent.verticalCenter | ||
1219 | 132 | } | ||
1220 | 133 | count: recentItem.covers.length | ||
1221 | 134 | size: recentItem.width | ||
1222 | 135 | covers: recentItem.covers | ||
1223 | 136 | spacing: units.gu(2) | ||
1224 | 137 | } | ||
1225 | 138 | Item { // Background so can see text in current state | ||
1226 | 139 | id: albumBg | ||
1227 | 140 | anchors { | ||
1228 | 141 | bottom: parent.bottom | ||
1229 | 142 | left: parent.left | ||
1230 | 143 | right: parent.right | ||
1231 | 144 | } | ||
1232 | 145 | height: units.gu(6) | ||
1233 | 146 | clip: true | ||
1234 | 147 | UbuntuShape{ | ||
1235 | 148 | anchors { | ||
1236 | 149 | bottom: parent.bottom | ||
1237 | 150 | left: parent.left | ||
1238 | 151 | right: parent.right | ||
1239 | 152 | } | ||
1240 | 153 | height: recentShape.height | ||
1241 | 154 | radius: "medium" | ||
1242 | 155 | color: styleMusic.common.black | ||
1243 | 156 | opacity: 0.6 | ||
1244 | 157 | } | ||
1245 | 158 | } | ||
1246 | 159 | Label { | ||
1247 | 160 | id: albumArtist | ||
1248 | 161 | anchors.bottom: parent.bottom | ||
1249 | 162 | anchors.bottomMargin: units.gu(3) | ||
1250 | 163 | anchors.left: parent.left | ||
1251 | 164 | anchors.leftMargin: units.gu(1) | ||
1252 | 165 | anchors.right: parent.right | ||
1253 | 166 | anchors.rightMargin: units.gu(1) | ||
1254 | 167 | color: styleMusic.common.white | ||
1255 | 168 | elide: Text.ElideRight | ||
1256 | 169 | text: title | ||
1257 | 170 | fontSize: "small" | ||
1258 | 171 | font.weight: Font.DemiBold | ||
1259 | 172 | } | ||
1260 | 173 | Label { | ||
1261 | 174 | id: albumLabel | ||
1262 | 175 | anchors.left: parent.left | ||
1263 | 176 | anchors.leftMargin: units.gu(1) | ||
1264 | 177 | anchors.bottom: parent.bottom | ||
1265 | 178 | anchors.bottomMargin: units.gu(1) | ||
1266 | 179 | anchors.right: parent.right | ||
1267 | 180 | anchors.rightMargin: units.gu(1) | ||
1268 | 181 | color: styleMusic.common.white | ||
1269 | 182 | elide: Text.ElideRight | ||
1270 | 183 | text: title2 | ||
1271 | 184 | fontSize: "x-small" | ||
1272 | 185 | } | ||
1273 | 186 | MouseArea { | ||
1274 | 187 | anchors.fill: parent | ||
1275 | 188 | onClicked: { | ||
1276 | 189 | if (type === "playlist") { | ||
1277 | 190 | albumTracksModel.filterPlaylistTracks(key) | ||
1278 | 191 | } else { | ||
1279 | 192 | songsPage.album = title; | ||
1280 | 193 | } | ||
1281 | 194 | songsPage.genre = undefined; | ||
1282 | 195 | |||
1283 | 196 | songsPage.line1 = title2 | ||
1284 | 197 | songsPage.line2 = title | ||
1285 | 198 | songsPage.covers = recentItem.covers | ||
1286 | 199 | songsPage.isAlbum = (type === "album") | ||
1287 | 200 | songsPage.title = songsPage.isAlbum ? i18n.tr("Album") : i18n.tr("Playlist") | ||
1288 | 201 | |||
1289 | 202 | mainPageStack.push(songsPage) | ||
1290 | 203 | } | ||
1291 | 204 | |||
1292 | 205 | // TODO: If http://pad.lv/1354753 is fixed to expose whether the Shape should appear pressed, update this as well. | ||
1293 | 206 | onPressedChanged: recentShape.pressed = pressed | ||
1294 | 207 | } | ||
1295 | 208 | } | ||
1296 | 209 | } | ||
1297 | 210 | } | ||
1298 | 211 | |||
1299 | 212 | ListItem.ThinDivider { | ||
1300 | 213 | id: genreDivider | ||
1301 | 214 | anchors.top: mainView.hasRecent ? recentlist.bottom : parent.top | ||
1302 | 215 | visible: genrelist.count > 1 | ||
1303 | 216 | } | ||
1304 | 217 | ListItem.Standard { | ||
1305 | 218 | id: genres | ||
1306 | 219 | anchors.top: genreDivider.bottom | ||
1307 | 220 | visible: genrelist.count > 1 | ||
1308 | 221 | Label { | ||
1309 | 222 | anchors { | ||
1310 | 223 | verticalCenter: parent.verticalCenter | ||
1311 | 224 | left: parent.left | ||
1312 | 225 | leftMargin: units.gu(2) | ||
1313 | 226 | } | ||
1314 | 227 | text: i18n.tr("Genres") | ||
1315 | 228 | color: styleMusic.common.music | ||
1316 | 229 | } | ||
1317 | 230 | } | ||
1318 | 231 | // TODO: add music genres. frequency of play? most tracks? | ||
1319 | 232 | ListView { | ||
1320 | 233 | id: genrelist | ||
1321 | 234 | width: parent.width | ||
1322 | 235 | anchors.top: genres.bottom | ||
1323 | 236 | anchors.topMargin: units.gu(1) | ||
1324 | 237 | spacing: units.gu(1) | ||
1325 | 238 | height: units.gu(18) | ||
1326 | 239 | visible: genrelist.count > 1 | ||
1327 | 240 | model: SortFilterModel { | ||
1328 | 241 | id: genresModelFilter | ||
1329 | 242 | model: GenresModel { | ||
1330 | 243 | id: genresModel | ||
1331 | 244 | store: musicStore | ||
1332 | 245 | } | ||
1333 | 246 | filter.property: "genre" | ||
1334 | 247 | filter.pattern: /\S+/ | ||
1335 | 248 | } | ||
1336 | 249 | |||
1337 | 250 | delegate: genreDelegate | ||
1338 | 251 | header: Item { | ||
1339 | 252 | id: genreSpacer | ||
1340 | 253 | width: units.gu(1) | ||
1341 | 254 | } | ||
1342 | 255 | orientation: ListView.Horizontal | ||
1343 | 256 | |||
1344 | 257 | Component { | ||
1345 | 258 | id: genreDelegate | ||
1346 | 259 | Item { | ||
1347 | 260 | id: genreItem | ||
1348 | 261 | objectName: "genreItemObject" | ||
1349 | 262 | height: genrelist.height - units.gu(1) | ||
1350 | 263 | width: height | ||
1351 | 264 | |||
1352 | 265 | Repeater { | ||
1353 | 266 | id: albumGenreModelRepeater | ||
1354 | 267 | model: AlbumsModel { | ||
1355 | 268 | genre: model.genre | ||
1356 | 269 | store: musicStore | ||
1357 | 270 | } | ||
1358 | 271 | |||
1359 | 272 | delegate: Item { | ||
1360 | 273 | property string art: model.art | ||
1361 | 274 | } | ||
1362 | 275 | property var covers: [] | ||
1363 | 276 | signal finished() | ||
1364 | 277 | |||
1365 | 278 | onFinished: { | ||
1366 | 279 | genreShape.count = count | ||
1367 | 280 | genreShape.covers = covers | ||
1368 | 281 | } | ||
1369 | 282 | onItemAdded: { | ||
1370 | 283 | covers.push({art: item.art}); | ||
1371 | 284 | |||
1372 | 285 | if (index === count - 1) { | ||
1373 | 286 | finished(); | ||
1374 | 287 | } | ||
1375 | 288 | } | ||
1376 | 289 | } | ||
1377 | 290 | |||
1378 | 291 | SongsModel { | ||
1379 | 292 | id: songGenreModel | ||
1380 | 293 | genre: model.genre | ||
1381 | 294 | store: musicStore | ||
1382 | 295 | } | ||
1383 | 296 | |||
1384 | 297 | CoverRow { | ||
1385 | 298 | id: genreShape | ||
1386 | 299 | anchors { | ||
1387 | 300 | top: parent.top | ||
1388 | 301 | left: parent.left | ||
1389 | 302 | verticalCenter: parent.verticalCenter | ||
1390 | 303 | } | ||
1391 | 304 | count: 0 | ||
1392 | 305 | size: genreItem.width | ||
1393 | 306 | covers: [] | ||
1394 | 307 | spacing: units.gu(2) | ||
1395 | 308 | } | ||
1396 | 309 | MouseArea { | ||
1397 | 310 | anchors.fill: parent | ||
1398 | 311 | onClicked: { | ||
1399 | 312 | songsPage.album = undefined | ||
1400 | 313 | songsPage.covers = genreShape.covers | ||
1401 | 314 | songsPage.genre = model.genre | ||
1402 | 315 | songsPage.isAlbum = true | ||
1403 | 316 | songsPage.line1 = i18n.tr("Genre") | ||
1404 | 317 | songsPage.line2 = model.genre | ||
1405 | 318 | songsPage.title = i18n.tr("Genre") | ||
1406 | 319 | |||
1407 | 320 | mainPageStack.push(songsPage) | ||
1408 | 321 | } | ||
1409 | 322 | |||
1410 | 323 | // TODO: If http://pad.lv/1354753 is fixed to expose whether the Shape should appear pressed, update this as well. | ||
1411 | 324 | onPressedChanged: genreShape.pressed = pressed | ||
1412 | 325 | } | ||
1413 | 326 | Item { // Background so can see text in current state | ||
1414 | 327 | id: genreBg | ||
1415 | 328 | anchors { | ||
1416 | 329 | bottom: parent.bottom | ||
1417 | 330 | left: parent.left | ||
1418 | 331 | right: parent.right | ||
1419 | 332 | } | ||
1420 | 333 | height: units.gu(5.5) | ||
1421 | 334 | clip: true | ||
1422 | 335 | UbuntuShape{ | ||
1423 | 336 | anchors { | ||
1424 | 337 | bottom: parent.bottom | ||
1425 | 338 | left: parent.left | ||
1426 | 339 | right: parent.right | ||
1427 | 340 | } | ||
1428 | 341 | height: genreShape.height | ||
1429 | 342 | radius: "medium" | ||
1430 | 343 | color: styleMusic.common.black | ||
1431 | 344 | opacity: 0.6 | ||
1432 | 345 | } | ||
1433 | 346 | } | ||
1434 | 347 | Label { | ||
1435 | 348 | id: genreLabel | ||
1436 | 349 | anchors.bottom: parent.bottom | ||
1437 | 350 | anchors.bottomMargin: units.gu(1) | ||
1438 | 351 | anchors.left: parent.left | ||
1439 | 352 | anchors.leftMargin: units.gu(1) | ||
1440 | 353 | anchors.right: parent.right | ||
1441 | 354 | anchors.rightMargin: units.gu(1) | ||
1442 | 355 | color: styleMusic.common.white | ||
1443 | 356 | elide: Text.ElideRight | ||
1444 | 357 | text: model.genre | ||
1445 | 358 | fontSize: "small" | ||
1446 | 359 | font.weight: Font.DemiBold | ||
1447 | 360 | } | ||
1448 | 361 | Label { | ||
1449 | 362 | id: genreTotal | ||
1450 | 363 | anchors.bottom: parent.bottom | ||
1451 | 364 | anchors.bottomMargin: units.gu(3) | ||
1452 | 365 | anchors.left: parent.left | ||
1453 | 366 | anchors.leftMargin: units.gu(1) | ||
1454 | 367 | anchors.right: parent.right | ||
1455 | 368 | anchors.rightMargin: units.gu(1) | ||
1456 | 369 | color: styleMusic.common.white | ||
1457 | 370 | elide: Text.ElideRight | ||
1458 | 371 | text: i18n.tr("%1 song", "%1 songs", songGenreModel.rowCount).arg(songGenreModel.rowCount) | ||
1459 | 372 | fontSize: "x-small" | ||
1460 | 373 | } | ||
1461 | 374 | } | ||
1462 | 375 | } | ||
1463 | 376 | } | ||
1464 | 377 | |||
1465 | 378 | ListItem.ThinDivider { | ||
1466 | 379 | id: albumsDivider | ||
1467 | 380 | anchors.top: genrelist.visible | ||
1468 | 381 | ? genrelist.bottom | ||
1469 | 382 | : (mainView.hasRecent ? recentlist.bottom : parent.top) | ||
1470 | 383 | } | ||
1471 | 384 | ListItem.Standard { | ||
1472 | 385 | id: albums | ||
1473 | 386 | Label { | ||
1474 | 387 | anchors { | ||
1475 | 388 | verticalCenter: parent.verticalCenter | ||
1476 | 389 | left: parent.left | ||
1477 | 390 | leftMargin: units.gu(2) | ||
1478 | 391 | } | ||
1479 | 392 | text: i18n.tr("Albums") | ||
1480 | 393 | color: styleMusic.common.music | ||
1481 | 394 | } | ||
1482 | 395 | anchors.top: albumsDivider.bottom | ||
1483 | 396 | } | ||
1484 | 397 | |||
1485 | 398 | ListView { | ||
1486 | 399 | id: albumlist | ||
1487 | 400 | width: parent.width | ||
1488 | 401 | anchors.top: albums.bottom | ||
1489 | 402 | anchors.topMargin: units.gu(1) | ||
1490 | 403 | spacing: units.gu(1) | ||
1491 | 404 | height: units.gu(18) | ||
1492 | 405 | model: SortFilterModel { | ||
1493 | 406 | id: albumsModelFilter | ||
1494 | 407 | property alias rowCount: albumsModel.rowCount | ||
1495 | 408 | model: AlbumsModel { | ||
1496 | 409 | id: albumsModel | ||
1497 | 410 | store: musicStore | ||
1498 | 411 | } | ||
1499 | 412 | sort.property: "title" | ||
1500 | 413 | sort.order: Qt.AscendingOrder | ||
1501 | 414 | } | ||
1502 | 415 | delegate: albumDelegate | ||
1503 | 416 | header: Item { | ||
1504 | 417 | id: albumSpacer | ||
1505 | 418 | width: units.gu(1) | ||
1506 | 419 | } | ||
1507 | 420 | orientation: ListView.Horizontal | ||
1508 | 421 | |||
1509 | 422 | Component { | ||
1510 | 423 | id: albumDelegate | ||
1511 | 424 | Item { | ||
1512 | 425 | property string artist: model.artist | ||
1513 | 426 | property string album: model.title | ||
1514 | 427 | property var covers: [{art: model.art}] | ||
1515 | 428 | |||
1516 | 429 | id: albumItem | ||
1517 | 430 | objectName: "albumItemObject" | ||
1518 | 431 | height: albumlist.height - units.gu(1) | ||
1519 | 432 | width: height | ||
1520 | 433 | CoverRow { | ||
1521 | 434 | id: albumShape | ||
1522 | 435 | anchors { | ||
1523 | 436 | top: parent.top | ||
1524 | 437 | left: parent.left | ||
1525 | 438 | verticalCenter: parent.verticalCenter | ||
1526 | 439 | } | ||
1527 | 440 | count: albumItem.covers.length | ||
1528 | 441 | size: albumItem.width | ||
1529 | 442 | covers: albumItem.covers | ||
1530 | 443 | spacing: units.gu(2) | ||
1531 | 444 | } | ||
1532 | 445 | MouseArea { | ||
1533 | 446 | anchors.fill: parent | ||
1534 | 447 | onClicked: { | ||
1535 | 448 | songsPage.album = album | ||
1536 | 449 | songsPage.covers = covers | ||
1537 | 450 | songsPage.genre = undefined | ||
1538 | 451 | songsPage.isAlbum = true | ||
1539 | 452 | songsPage.line1 = artist | ||
1540 | 453 | songsPage.line2 = album | ||
1541 | 454 | songsPage.title = i18n.tr("Album") | ||
1542 | 455 | |||
1543 | 456 | mainPageStack.push(songsPage) | ||
1544 | 457 | } | ||
1545 | 458 | |||
1546 | 459 | // TODO: If http://pad.lv/1354753 is fixed to expose whether the Shape should appear pressed, update this as well. | ||
1547 | 460 | onPressedChanged: albumShape.pressed = pressed | ||
1548 | 461 | } | ||
1549 | 462 | Item { // Background so can see text in current state | ||
1550 | 463 | id: albumBg | ||
1551 | 464 | anchors { | ||
1552 | 465 | bottom: parent.bottom | ||
1553 | 466 | left: parent.left | ||
1554 | 467 | right: parent.right | ||
1555 | 468 | } | ||
1556 | 469 | height: units.gu(6) | ||
1557 | 470 | clip: true | ||
1558 | 471 | UbuntuShape{ | ||
1559 | 472 | anchors { | ||
1560 | 473 | bottom: parent.bottom | ||
1561 | 474 | left: parent.left | ||
1562 | 475 | right: parent.right | ||
1563 | 476 | } | ||
1564 | 477 | height: albumShape.height | ||
1565 | 478 | radius: "medium" | ||
1566 | 479 | color: styleMusic.common.black | ||
1567 | 480 | opacity: 0.6 | ||
1568 | 481 | } | ||
1569 | 482 | } | ||
1570 | 483 | Label { | ||
1571 | 484 | id: albumLabel | ||
1572 | 485 | anchors.bottom: parent.bottom | ||
1573 | 486 | anchors.bottomMargin: units.gu(1) | ||
1574 | 487 | anchors.left: parent.left | ||
1575 | 488 | anchors.leftMargin: units.gu(1) | ||
1576 | 489 | anchors.right: parent.right | ||
1577 | 490 | anchors.rightMargin: units.gu(1) | ||
1578 | 491 | color: styleMusic.common.white | ||
1579 | 492 | elide: Text.ElideRight | ||
1580 | 493 | text: artist | ||
1581 | 494 | fontSize: "x-small" | ||
1582 | 495 | } | ||
1583 | 496 | Label { | ||
1584 | 497 | id: albumLabel2 | ||
1585 | 498 | anchors.bottom: parent.bottom | ||
1586 | 499 | anchors.bottomMargin: units.gu(3) | ||
1587 | 500 | anchors.left: parent.left | ||
1588 | 501 | anchors.leftMargin: units.gu(1) | ||
1589 | 502 | anchors.right: parent.right | ||
1590 | 503 | anchors.rightMargin: units.gu(1) | ||
1591 | 504 | color: styleMusic.common.white | ||
1592 | 505 | elide: Text.ElideRight | ||
1593 | 506 | text: album | ||
1594 | 507 | fontSize: "small" | ||
1595 | 508 | font.weight: Font.DemiBold | ||
1596 | 509 | } | ||
1597 | 510 | } | ||
1624 | 511 | } | 74 | } |
1625 | 512 | } | 75 | } |
1626 | 513 | } | 76 | } |
1627 | 514 | 77 | ||
1628 | === modified file 'MusicToolbar.qml' | |||
1629 | --- MusicToolbar.qml 2014-09-23 20:45:41 +0000 | |||
1630 | +++ MusicToolbar.qml 2014-10-21 15:31:33 +0000 | |||
1631 | @@ -22,6 +22,7 @@ | |||
1632 | 22 | import QtMultimedia 5.0 | 22 | import QtMultimedia 5.0 |
1633 | 23 | import Ubuntu.Components 1.1 | 23 | import Ubuntu.Components 1.1 |
1634 | 24 | import Ubuntu.Components.Popups 1.0 | 24 | import Ubuntu.Components.Popups 1.0 |
1635 | 25 | import "common" | ||
1636 | 25 | import "settings.js" as Settings | 26 | import "settings.js" as Settings |
1637 | 26 | 27 | ||
1638 | 27 | Item { | 28 | Item { |
1639 | @@ -35,59 +36,13 @@ | |||
1640 | 35 | property var currentPage: null | 36 | property var currentPage: null |
1641 | 36 | property var currentSheet: [] | 37 | property var currentSheet: [] |
1642 | 37 | property var currentTab: null | 38 | property var currentTab: null |
1643 | 38 | property var previousPage: null | ||
1644 | 39 | 39 | ||
1645 | 40 | // Properties and signals for the toolbar | 40 | // Properties and signals for the toolbar |
1646 | 41 | property var cachedStates: [] | ||
1647 | 42 | property bool shown: false | ||
1648 | 43 | property int transitionDuration: 100 | ||
1649 | 44 | |||
1650 | 45 | property alias currentHeight: musicToolbarPanel.height | 41 | property alias currentHeight: musicToolbarPanel.height |
1651 | 46 | property alias minimizedHeight: musicToolbarPanel.minimizedHeight | ||
1652 | 47 | property alias expandedHeight: musicToolbarPanel.expandedHeight | ||
1653 | 48 | property alias fullHeight: musicToolbarPanel.fullHeight | ||
1654 | 49 | property alias mouseAreaOffset: musicToolbarPanel.hintSize | ||
1655 | 50 | |||
1656 | 51 | property alias animating: musicToolbarPanel.animating | ||
1657 | 52 | property alias opened: musicToolbarPanel.opened | 42 | property alias opened: musicToolbarPanel.opened |
1658 | 53 | 43 | ||
1659 | 54 | // Alias for autopilot | ||
1660 | 55 | property alias currentMode: musicToolbarPanel.currentMode | ||
1661 | 56 | |||
1662 | 57 | Connections { | ||
1663 | 58 | id: pageStackConn | ||
1664 | 59 | target: mainPageStack | ||
1665 | 60 | |||
1666 | 61 | onCurrentPageChanged: { | ||
1667 | 62 | previousPage = currentPage; | ||
1668 | 63 | |||
1669 | 64 | // If going back from nowPlaying jump back to tabs | ||
1670 | 65 | if (previousPage === nowPlaying && mainPageStack.currentPage !== nowPlaying) { | ||
1671 | 66 | while (mainPageStack.depth > 1) { | ||
1672 | 67 | mainPageStack.pop(mainPageStack.currentPage) | ||
1673 | 68 | } | ||
1674 | 69 | } | ||
1675 | 70 | } | ||
1676 | 71 | } | ||
1677 | 72 | |||
1678 | 73 | /* Helper functions */ | 44 | /* Helper functions */ |
1679 | 74 | 45 | ||
1680 | 75 | // Disable the toolbar for this page/view (eg a dialog) | ||
1681 | 76 | function disableToolbar() | ||
1682 | 77 | { | ||
1683 | 78 | cachedStates.push(state); | ||
1684 | 79 | musicToolbarPanel.state = "hidden"; | ||
1685 | 80 | } | ||
1686 | 81 | |||
1687 | 82 | // Enable the toolbar (run when closing a page that disabled it) | ||
1688 | 83 | function enableToolbar() | ||
1689 | 84 | { | ||
1690 | 85 | if (cachedStates.length > 0) | ||
1691 | 86 | { | ||
1692 | 87 | musicToolbarPanel.state = cachedStates.pop(); | ||
1693 | 88 | } | ||
1694 | 89 | } | ||
1695 | 90 | |||
1696 | 91 | // Back button has been pressed, jump up pageStack or back to parent page | 46 | // Back button has been pressed, jump up pageStack or back to parent page |
1697 | 92 | function goBack() | 47 | function goBack() |
1698 | 93 | { | 48 | { |
1699 | @@ -98,18 +53,6 @@ | |||
1700 | 98 | else if (mainPageStack !== null && mainPageStack.depth > 1) { | 53 | else if (mainPageStack !== null && mainPageStack.depth > 1) { |
1701 | 99 | mainPageStack.pop(currentPage) | 54 | mainPageStack.pop(currentPage) |
1702 | 100 | } | 55 | } |
1703 | 101 | |||
1704 | 102 | startAutohideTimer() | ||
1705 | 103 | } | ||
1706 | 104 | |||
1707 | 105 | // Hide the toolbar | ||
1708 | 106 | function hideToolbar() | ||
1709 | 107 | { | ||
1710 | 108 | if (!wideAspect) { | ||
1711 | 109 | musicToolbarPanel.close(); | ||
1712 | 110 | } | ||
1713 | 111 | |||
1714 | 112 | toolbarAutoHideTimer.stop(); // cancel any autohide | ||
1715 | 113 | } | 56 | } |
1716 | 114 | 57 | ||
1717 | 115 | // Remove sheet as it has been closed | 58 | // Remove sheet as it has been closed |
1718 | @@ -126,8 +69,6 @@ | |||
1719 | 126 | function setPage(childPage) | 69 | function setPage(childPage) |
1720 | 127 | { | 70 | { |
1721 | 128 | currentPage = childPage; | 71 | currentPage = childPage; |
1722 | 129 | // note: If pageStack tracking is needed readd here | ||
1723 | 130 | //currentPageStack = pageStack === undefined ? null : pageStack; | ||
1724 | 131 | } | 72 | } |
1725 | 132 | 73 | ||
1726 | 133 | // Set the current sheet (overrides page) | 74 | // Set the current sheet (overrides page) |
1727 | @@ -135,32 +76,6 @@ | |||
1728 | 135 | currentSheet.push(sheet) | 76 | currentSheet.push(sheet) |
1729 | 136 | } | 77 | } |
1730 | 137 | 78 | ||
1731 | 138 | // Show the toolbar | ||
1732 | 139 | function showToolbar() | ||
1733 | 140 | { | ||
1734 | 141 | startAutohideTimer(); // always attempt to autohide toolbar | ||
1735 | 142 | |||
1736 | 143 | if (!musicToolbarPanel.opened) { | ||
1737 | 144 | musicToolbarPanel.open(); | ||
1738 | 145 | } | ||
1739 | 146 | } | ||
1740 | 147 | |||
1741 | 148 | // Start the autohidetimer | ||
1742 | 149 | function startAutohideTimer() | ||
1743 | 150 | { | ||
1744 | 151 | toolbarAutoHideTimer.restart(); | ||
1745 | 152 | } | ||
1746 | 153 | |||
1747 | 154 | Connections { | ||
1748 | 155 | target: mainView | ||
1749 | 156 | onWideAspectChanged: { | ||
1750 | 157 | // Force toolbar to show if in wideAspect | ||
1751 | 158 | if (wideAspect && !opened) { | ||
1752 | 159 | showToolbar(); | ||
1753 | 160 | } | ||
1754 | 161 | } | ||
1755 | 162 | } | ||
1756 | 163 | |||
1757 | 164 | Panel { | 79 | Panel { |
1758 | 165 | id: musicToolbarPanel | 80 | id: musicToolbarPanel |
1759 | 166 | anchors { | 81 | anchors { |
1760 | @@ -168,543 +83,9 @@ | |||
1761 | 168 | right: parent.right | 83 | right: parent.right |
1762 | 169 | bottom: parent.bottom | 84 | bottom: parent.bottom |
1763 | 170 | } | 85 | } |
2301 | 171 | height: currentMode === "full" ? fullHeight : expandedHeight | 86 | height: units.gu(7.25) |
2302 | 172 | locked: wideAspect | 87 | locked: true |
2303 | 173 | 88 | opened: true | |
1767 | 174 | __closeOnContentsClicks: false // TODO: fix bug 1295720 | ||
1768 | 175 | |||
1769 | 176 | // The current mode of the controls | ||
1770 | 177 | property string currentMode: wideAspect || (currentPage === nowPlaying) | ||
1771 | 178 | ? "full" : "expanded" | ||
1772 | 179 | |||
1773 | 180 | // Properties for the different heights | ||
1774 | 181 | property int minimizedHeight: units.gu(0.5) | ||
1775 | 182 | property int expandedHeight: units.gu(8) | ||
1776 | 183 | property int fullHeight: units.gu(11) | ||
1777 | 184 | |||
1778 | 185 | onCurrentModeChanged: { | ||
1779 | 186 | musicToolbarFullProgressMouseArea.enabled = currentMode === "full" | ||
1780 | 187 | } | ||
1781 | 188 | |||
1782 | 189 | onOpenedChanged: { | ||
1783 | 190 | onToolbarShownChanged(opened, currentPage, currentTab); | ||
1784 | 191 | |||
1785 | 192 | if (opened) { | ||
1786 | 193 | startAutohideTimer(); | ||
1787 | 194 | } | ||
1788 | 195 | } | ||
1789 | 196 | |||
1790 | 197 | /* Full toolbar */ | ||
1791 | 198 | Rectangle { | ||
1792 | 199 | id: musicToolbarFullContainer | ||
1793 | 200 | anchors { | ||
1794 | 201 | fill: parent | ||
1795 | 202 | } | ||
1796 | 203 | color: styleMusic.toolbar.fullBackgroundColor | ||
1797 | 204 | visible: musicToolbarPanel.currentMode === "full" | ||
1798 | 205 | |||
1799 | 206 | /* Buttons component */ | ||
1800 | 207 | Rectangle { | ||
1801 | 208 | id: musicToolbarFullButtonsContainer | ||
1802 | 209 | anchors.left: parent.left | ||
1803 | 210 | anchors.top: musicToolbarFullProgressContainer.bottom | ||
1804 | 211 | color: "transparent" | ||
1805 | 212 | height: parent.height - musicToolbarFullProgressContainer.height | ||
1806 | 213 | width: parent.width | ||
1807 | 214 | |||
1808 | 215 | /* Column for labels in wideAspect */ | ||
1809 | 216 | Column { | ||
1810 | 217 | id: nowPlayingWideAspectLabels | ||
1811 | 218 | anchors { | ||
1812 | 219 | left: parent.left | ||
1813 | 220 | leftMargin: units.gu(1) | ||
1814 | 221 | right: nowPlayingRepeatButton.left | ||
1815 | 222 | rightMargin: units.gu(1) | ||
1816 | 223 | verticalCenter: parent.verticalCenter | ||
1817 | 224 | } | ||
1818 | 225 | visible: wideAspect | ||
1819 | 226 | |||
1820 | 227 | /* Clicking in the area shows the queue */ | ||
1821 | 228 | function trigger() { | ||
1822 | 229 | if (trackQueue.model.count !== 0 && currentPage !== nowPlaying) { | ||
1823 | 230 | tabs.pushNowPlaying(); | ||
1824 | 231 | } | ||
1825 | 232 | else if (currentPage === nowPlaying) { | ||
1826 | 233 | musicToolbar.goBack(); | ||
1827 | 234 | } | ||
1828 | 235 | } | ||
1829 | 236 | |||
1830 | 237 | /* Title of track */ | ||
1831 | 238 | Label { | ||
1832 | 239 | id: nowPlayingWideAspectTitle | ||
1833 | 240 | anchors { | ||
1834 | 241 | left: parent.left | ||
1835 | 242 | leftMargin: units.gu(1) | ||
1836 | 243 | right: parent.right | ||
1837 | 244 | rightMargin: units.gu(1) | ||
1838 | 245 | } | ||
1839 | 246 | color: styleMusic.playerControls.labelColor | ||
1840 | 247 | elide: Text.ElideRight | ||
1841 | 248 | fontSize: "medium" | ||
1842 | 249 | objectName: "playercontroltitle" | ||
1843 | 250 | text: trackQueue.model.count === 0 ? "" : player.currentMetaTitle === "" ? player.currentMetaFile : player.currentMetaTitle | ||
1844 | 251 | } | ||
1845 | 252 | |||
1846 | 253 | /* Artist of track */ | ||
1847 | 254 | Label { | ||
1848 | 255 | id: nowPlayingWideAspectArtist | ||
1849 | 256 | anchors { | ||
1850 | 257 | left: parent.left | ||
1851 | 258 | leftMargin: units.gu(1) | ||
1852 | 259 | right: parent.right | ||
1853 | 260 | rightMargin: units.gu(1) | ||
1854 | 261 | } | ||
1855 | 262 | color: styleMusic.playerControls.labelColor | ||
1856 | 263 | elide: Text.ElideRight | ||
1857 | 264 | fontSize: "small" | ||
1858 | 265 | text: trackQueue.model.count === 0 ? "" : player.currentMetaArtist | ||
1859 | 266 | } | ||
1860 | 267 | |||
1861 | 268 | /* Album of track */ | ||
1862 | 269 | Label { | ||
1863 | 270 | id: nowPlayingWideAspectAlbum | ||
1864 | 271 | anchors { | ||
1865 | 272 | left: parent.left | ||
1866 | 273 | leftMargin: units.gu(1) | ||
1867 | 274 | right: parent.right | ||
1868 | 275 | rightMargin: units.gu(1) | ||
1869 | 276 | } | ||
1870 | 277 | color: styleMusic.playerControls.labelColor | ||
1871 | 278 | elide: Text.ElideRight | ||
1872 | 279 | fontSize: "small" | ||
1873 | 280 | text: trackQueue.model.count === 0 ? "" : player.currentMetaAlbum | ||
1874 | 281 | } | ||
1875 | 282 | } | ||
1876 | 283 | |||
1877 | 284 | /* Repeat button */ | ||
1878 | 285 | Item { | ||
1879 | 286 | id: nowPlayingRepeatButton | ||
1880 | 287 | objectName: "repeatShape" | ||
1881 | 288 | anchors.right: nowPlayingPreviousButton.left | ||
1882 | 289 | anchors.rightMargin: units.gu(1) | ||
1883 | 290 | anchors.verticalCenter: parent.verticalCenter | ||
1884 | 291 | height: units.gu(6) | ||
1885 | 292 | opacity: player.repeat && !emptyPage.noMusic ? 1 : .4 | ||
1886 | 293 | width: height | ||
1887 | 294 | |||
1888 | 295 | function trigger() { | ||
1889 | 296 | if (emptyPage.noMusic) { | ||
1890 | 297 | return; | ||
1891 | 298 | } | ||
1892 | 299 | |||
1893 | 300 | // Invert repeat settings | ||
1894 | 301 | player.repeat = !player.repeat | ||
1895 | 302 | } | ||
1896 | 303 | |||
1897 | 304 | Image { | ||
1898 | 305 | id: repeatIcon | ||
1899 | 306 | height: units.gu(3) | ||
1900 | 307 | width: height | ||
1901 | 308 | anchors.verticalCenter: parent.verticalCenter | ||
1902 | 309 | anchors.horizontalCenter: parent.horizontalCenter | ||
1903 | 310 | source: Qt.resolvedUrl("images/media-playlist-repeat.svg") | ||
1904 | 311 | verticalAlignment: Text.AlignVCenter | ||
1905 | 312 | opacity: player.repeat && !emptyPage.noMusic ? 1 : .4 | ||
1906 | 313 | } | ||
1907 | 314 | } | ||
1908 | 315 | |||
1909 | 316 | /* Previous button */ | ||
1910 | 317 | Item { | ||
1911 | 318 | id: nowPlayingPreviousButton | ||
1912 | 319 | anchors.right: nowPlayingPlayButton.left | ||
1913 | 320 | anchors.rightMargin: units.gu(1) | ||
1914 | 321 | anchors.verticalCenter: parent.verticalCenter | ||
1915 | 322 | height: units.gu(6) | ||
1916 | 323 | objectName: "previousShape" | ||
1917 | 324 | opacity: trackQueue.model.count === 0 ? .4 : 1 | ||
1918 | 325 | width: height | ||
1919 | 326 | |||
1920 | 327 | function trigger() { | ||
1921 | 328 | if (trackQueue.model.count === 0) { | ||
1922 | 329 | return; | ||
1923 | 330 | } | ||
1924 | 331 | |||
1925 | 332 | player.previousSong() | ||
1926 | 333 | } | ||
1927 | 334 | |||
1928 | 335 | Image { | ||
1929 | 336 | id: nowPlayingPreviousIndicator | ||
1930 | 337 | height: units.gu(3) | ||
1931 | 338 | width: height | ||
1932 | 339 | anchors.horizontalCenter: parent.horizontalCenter | ||
1933 | 340 | anchors.verticalCenter: parent.verticalCenter | ||
1934 | 341 | source: Qt.resolvedUrl("images/media-skip-backward.svg") | ||
1935 | 342 | opacity: 1 | ||
1936 | 343 | } | ||
1937 | 344 | } | ||
1938 | 345 | |||
1939 | 346 | /* Play/Pause button */ | ||
1940 | 347 | Rectangle { | ||
1941 | 348 | id: nowPlayingPlayButton | ||
1942 | 349 | anchors.horizontalCenter: parent.horizontalCenter | ||
1943 | 350 | anchors.verticalCenter: parent.verticalCenter | ||
1944 | 351 | antialiasing: true | ||
1945 | 352 | color: styleMusic.toolbar.fullOuterPlayCircleColor | ||
1946 | 353 | height: units.gu(12) | ||
1947 | 354 | radius: height / 2 | ||
1948 | 355 | width: height | ||
1949 | 356 | |||
1950 | 357 | // draws the outter shadow/highlight | ||
1951 | 358 | Rectangle { | ||
1952 | 359 | id: sourceOutterFull | ||
1953 | 360 | anchors { fill: parent; margins: -units.gu(0.1) } | ||
1954 | 361 | radius: (width / 2) | ||
1955 | 362 | antialiasing: true | ||
1956 | 363 | gradient: Gradient { | ||
1957 | 364 | GradientStop { position: 0.0; color: "black" } | ||
1958 | 365 | GradientStop { position: 0.5; color: "transparent" } | ||
1959 | 366 | GradientStop { position: 1.0; color: UbuntuColors.warmGrey } | ||
1960 | 367 | } | ||
1961 | 368 | |||
1962 | 369 | Rectangle { | ||
1963 | 370 | anchors.horizontalCenter: parent.horizontalCenter | ||
1964 | 371 | anchors.verticalCenter: parent.verticalCenter | ||
1965 | 372 | antialiasing: true | ||
1966 | 373 | color: styleMusic.toolbar.fullOuterPlayCircleColor | ||
1967 | 374 | height: nowPlayingPlayButton.height - units.gu(.1) | ||
1968 | 375 | radius: height / 2 | ||
1969 | 376 | width: height | ||
1970 | 377 | |||
1971 | 378 | Rectangle { | ||
1972 | 379 | id: nowPlayingPlayButtonInner | ||
1973 | 380 | anchors.horizontalCenter: parent.horizontalCenter | ||
1974 | 381 | anchors.verticalCenter: parent.verticalCenter | ||
1975 | 382 | antialiasing: true | ||
1976 | 383 | color: styleMusic.toolbar.fullInnerPlayCircleColor | ||
1977 | 384 | height: units.gu(7) | ||
1978 | 385 | radius: height / 2 | ||
1979 | 386 | width: height | ||
1980 | 387 | |||
1981 | 388 | // draws the inner shadow/highlight | ||
1982 | 389 | Rectangle { | ||
1983 | 390 | id: sourceInnerFull | ||
1984 | 391 | anchors { fill: parent; margins: -units.gu(0.1) } | ||
1985 | 392 | radius: (width / 2) | ||
1986 | 393 | antialiasing: true | ||
1987 | 394 | gradient: Gradient { | ||
1988 | 395 | GradientStop { position: 0.0; color: UbuntuColors.warmGrey } | ||
1989 | 396 | GradientStop { position: 0.5; color: "transparent" } | ||
1990 | 397 | GradientStop { position: 1.0; color: "black" } | ||
1991 | 398 | } | ||
1992 | 399 | |||
1993 | 400 | Rectangle { | ||
1994 | 401 | anchors.horizontalCenter: parent.horizontalCenter | ||
1995 | 402 | anchors.verticalCenter: parent.verticalCenter | ||
1996 | 403 | antialiasing: true | ||
1997 | 404 | color: styleMusic.toolbar.fullInnerPlayCircleColor | ||
1998 | 405 | height: nowPlayingPlayButtonInner.height - units.gu(.1) | ||
1999 | 406 | objectName: "playShape" | ||
2000 | 407 | radius: height / 2 | ||
2001 | 408 | width: height | ||
2002 | 409 | |||
2003 | 410 | function trigger() { | ||
2004 | 411 | if (emptyPage.noMusic) { | ||
2005 | 412 | return; | ||
2006 | 413 | } | ||
2007 | 414 | |||
2008 | 415 | if (trackQueue.model.count === 0) { | ||
2009 | 416 | playRandomSong(); | ||
2010 | 417 | } | ||
2011 | 418 | else { | ||
2012 | 419 | player.toggle(); | ||
2013 | 420 | } | ||
2014 | 421 | } | ||
2015 | 422 | |||
2016 | 423 | Image { | ||
2017 | 424 | id: nowPlayingPlayIndicator | ||
2018 | 425 | height: units.gu(6) | ||
2019 | 426 | width: height | ||
2020 | 427 | anchors.horizontalCenter: parent.horizontalCenter | ||
2021 | 428 | anchors.verticalCenter: parent.verticalCenter | ||
2022 | 429 | opacity: emptyPage.noMusic ? .4 : 1 | ||
2023 | 430 | source: player.playbackState === MediaPlayer.PlayingState ? | ||
2024 | 431 | Qt.resolvedUrl("images/media-playback-pause.svg") : Qt.resolvedUrl("images/media-playback-start.svg") | ||
2025 | 432 | } | ||
2026 | 433 | } | ||
2027 | 434 | } | ||
2028 | 435 | } | ||
2029 | 436 | } | ||
2030 | 437 | } | ||
2031 | 438 | } | ||
2032 | 439 | |||
2033 | 440 | /* Next button */ | ||
2034 | 441 | Item { | ||
2035 | 442 | id: nowPlayingNextButton | ||
2036 | 443 | anchors.left: nowPlayingPlayButton.right | ||
2037 | 444 | anchors.leftMargin: units.gu(1) | ||
2038 | 445 | anchors.verticalCenter: parent.verticalCenter | ||
2039 | 446 | height: units.gu(6) | ||
2040 | 447 | objectName: "forwardShape" | ||
2041 | 448 | opacity: trackQueue.model.count === 0 ? .4 : 1 | ||
2042 | 449 | width: height | ||
2043 | 450 | |||
2044 | 451 | function trigger() { | ||
2045 | 452 | if (trackQueue.model.count === 0 || emptyPage.noMusic) { | ||
2046 | 453 | return; | ||
2047 | 454 | } | ||
2048 | 455 | |||
2049 | 456 | player.nextSong() | ||
2050 | 457 | } | ||
2051 | 458 | |||
2052 | 459 | Image { | ||
2053 | 460 | id: nowPlayingNextIndicator | ||
2054 | 461 | height: units.gu(3) | ||
2055 | 462 | width: height | ||
2056 | 463 | anchors.horizontalCenter: parent.horizontalCenter | ||
2057 | 464 | anchors.verticalCenter: parent.verticalCenter | ||
2058 | 465 | source: Qt.resolvedUrl("images/media-skip-forward.svg") | ||
2059 | 466 | opacity: 1 | ||
2060 | 467 | } | ||
2061 | 468 | } | ||
2062 | 469 | |||
2063 | 470 | /* Shuffle button */ | ||
2064 | 471 | Item { | ||
2065 | 472 | id: nowPlayingShuffleButton | ||
2066 | 473 | objectName: "shuffleShape" | ||
2067 | 474 | anchors.left: nowPlayingNextButton.right | ||
2068 | 475 | anchors.leftMargin: units.gu(1) | ||
2069 | 476 | anchors.verticalCenter: parent.verticalCenter | ||
2070 | 477 | height: units.gu(6) | ||
2071 | 478 | opacity: player.shuffle && !emptyPage.noMusic ? 1 : .4 | ||
2072 | 479 | width: height | ||
2073 | 480 | |||
2074 | 481 | function trigger() { | ||
2075 | 482 | if (emptyPage.noMusic) { | ||
2076 | 483 | return; | ||
2077 | 484 | } | ||
2078 | 485 | |||
2079 | 486 | // Invert shuffle settings | ||
2080 | 487 | player.shuffle = !player.shuffle | ||
2081 | 488 | } | ||
2082 | 489 | |||
2083 | 490 | Image { | ||
2084 | 491 | id: shuffleIcon | ||
2085 | 492 | height: units.gu(3) | ||
2086 | 493 | width: height | ||
2087 | 494 | anchors.verticalCenter: parent.verticalCenter | ||
2088 | 495 | anchors.horizontalCenter: parent.horizontalCenter | ||
2089 | 496 | source: Qt.resolvedUrl("images/media-playlist-shuffle.svg") | ||
2090 | 497 | opacity: player.shuffle && !emptyPage.noMusic ? 1 : .4 | ||
2091 | 498 | } | ||
2092 | 499 | } | ||
2093 | 500 | |||
2094 | 501 | /* Search button in wideAspect */ | ||
2095 | 502 | Item { | ||
2096 | 503 | id: nowPlayingSearchButton | ||
2097 | 504 | objectName: "searchShape" | ||
2098 | 505 | anchors { | ||
2099 | 506 | right: parent.right | ||
2100 | 507 | rightMargin: units.gu(1) | ||
2101 | 508 | verticalCenter: parent.verticalCenter | ||
2102 | 509 | } | ||
2103 | 510 | height: units.gu(6) | ||
2104 | 511 | opacity: !emptyPage.noMusic ? 1 : .4 | ||
2105 | 512 | width: height | ||
2106 | 513 | visible: wideAspect | ||
2107 | 514 | |||
2108 | 515 | function trigger() { | ||
2109 | 516 | if (emptyPage.noMusic) { | ||
2110 | 517 | return; | ||
2111 | 518 | } | ||
2112 | 519 | |||
2113 | 520 | if (!searchSheet.sheetVisible) { | ||
2114 | 521 | PopupUtils.open(searchSheet.sheet, | ||
2115 | 522 | mainView, { title: i18n.tr("Search")} ) | ||
2116 | 523 | } | ||
2117 | 524 | } | ||
2118 | 525 | |||
2119 | 526 | Image { | ||
2120 | 527 | id: searchIcon | ||
2121 | 528 | anchors { | ||
2122 | 529 | horizontalCenter: parent.horizontalCenter | ||
2123 | 530 | verticalCenter: parent.verticalCenter | ||
2124 | 531 | } | ||
2125 | 532 | height: units.gu(3) | ||
2126 | 533 | opacity: !emptyPage.noMusic ? 1 : .4 | ||
2127 | 534 | source: Qt.resolvedUrl("images/search.svg") | ||
2128 | 535 | width: height | ||
2129 | 536 | } | ||
2130 | 537 | } | ||
2131 | 538 | } | ||
2132 | 539 | |||
2133 | 540 | /* Progress bar component */ | ||
2134 | 541 | Rectangle { | ||
2135 | 542 | id: musicToolbarFullProgressContainer | ||
2136 | 543 | anchors.left: parent.left | ||
2137 | 544 | anchors.top: parent.top | ||
2138 | 545 | color: styleMusic.toolbar.fullBackgroundColor | ||
2139 | 546 | height: units.gu(3) | ||
2140 | 547 | width: parent.width | ||
2141 | 548 | |||
2142 | 549 | /* Position label */ | ||
2143 | 550 | Label { | ||
2144 | 551 | id: musicToolbarFullPositionLabel | ||
2145 | 552 | anchors.left: parent.left | ||
2146 | 553 | anchors.leftMargin: units.gu(2) | ||
2147 | 554 | anchors.top: parent.top | ||
2148 | 555 | color: styleMusic.nowPlaying.labelColor | ||
2149 | 556 | fontSize: "x-small" | ||
2150 | 557 | height: parent.height | ||
2151 | 558 | horizontalAlignment: Text.AlignHCenter | ||
2152 | 559 | text: durationToString(player.position) | ||
2153 | 560 | verticalAlignment: Text.AlignVCenter | ||
2154 | 561 | width: units.gu(3) | ||
2155 | 562 | } | ||
2156 | 563 | |||
2157 | 564 | /* Progress bar */ | ||
2158 | 565 | Rectangle { | ||
2159 | 566 | id: musicToolbarFullProgressBarContainer | ||
2160 | 567 | objectName: "progressBarShape" | ||
2161 | 568 | anchors.left: musicToolbarFullPositionLabel.right | ||
2162 | 569 | anchors.leftMargin: units.gu(2) | ||
2163 | 570 | anchors.right: musicToolbarFullDurationLabel.left | ||
2164 | 571 | anchors.rightMargin: units.gu(2) | ||
2165 | 572 | anchors.verticalCenter: parent.verticalCenter | ||
2166 | 573 | color: "transparent" | ||
2167 | 574 | height: units.gu(1); | ||
2168 | 575 | state: trackQueue.model.count === 0 ? "disabled" : "enabled" | ||
2169 | 576 | |||
2170 | 577 | states: [ | ||
2171 | 578 | State { | ||
2172 | 579 | name: "disabled" | ||
2173 | 580 | PropertyChanges { | ||
2174 | 581 | target: musicToolbarFullProgressMouseArea | ||
2175 | 582 | enabled: false | ||
2176 | 583 | } | ||
2177 | 584 | PropertyChanges { | ||
2178 | 585 | target: musicToolbarFullProgressTrough | ||
2179 | 586 | visible: false | ||
2180 | 587 | } | ||
2181 | 588 | PropertyChanges { | ||
2182 | 589 | target: musicToolbarFullProgressHandle | ||
2183 | 590 | visible: false | ||
2184 | 591 | } | ||
2185 | 592 | }, | ||
2186 | 593 | State { | ||
2187 | 594 | name: "enabled" | ||
2188 | 595 | PropertyChanges { | ||
2189 | 596 | target: musicToolbarFullProgressMouseArea | ||
2190 | 597 | enabled: true | ||
2191 | 598 | } | ||
2192 | 599 | PropertyChanges { | ||
2193 | 600 | target: musicToolbarFullProgressTrough | ||
2194 | 601 | visible: true | ||
2195 | 602 | } | ||
2196 | 603 | PropertyChanges { | ||
2197 | 604 | target: musicToolbarFullProgressHandle | ||
2198 | 605 | visible: true | ||
2199 | 606 | } | ||
2200 | 607 | } | ||
2201 | 608 | ] | ||
2202 | 609 | |||
2203 | 610 | property bool seeking: false | ||
2204 | 611 | |||
2205 | 612 | onSeekingChanged: { | ||
2206 | 613 | if (seeking === false) { | ||
2207 | 614 | musicToolbarFullPositionLabel.text = durationToString(player.position) | ||
2208 | 615 | } | ||
2209 | 616 | } | ||
2210 | 617 | |||
2211 | 618 | Connections { | ||
2212 | 619 | target: player | ||
2213 | 620 | onDurationChanged: { | ||
2214 | 621 | console.debug("Duration changed: " + player.duration) | ||
2215 | 622 | musicToolbarFullDurationLabel.text = durationToString(player.duration) | ||
2216 | 623 | } | ||
2217 | 624 | onPositionChanged: { | ||
2218 | 625 | if (musicToolbarFullProgressBarContainer.seeking === false) | ||
2219 | 626 | { | ||
2220 | 627 | musicToolbarFullPositionLabel.text = durationToString(player.position) | ||
2221 | 628 | musicToolbarFullDurationLabel.text = durationToString(player.duration) | ||
2222 | 629 | musicToolbarFullProgressHandle.x = (player.position / player.duration) * musicToolbarFullProgressBarContainer.width | ||
2223 | 630 | - musicToolbarFullProgressHandle.width / 2; | ||
2224 | 631 | } | ||
2225 | 632 | } | ||
2226 | 633 | onStopped: { | ||
2227 | 634 | musicToolbarFullProgressHandle.x = -musicToolbarFullProgressHandle.width / 2; | ||
2228 | 635 | |||
2229 | 636 | musicToolbarFullPositionLabel.text = durationToString(0); | ||
2230 | 637 | musicToolbarFullDurationLabel.text = durationToString(0); | ||
2231 | 638 | } | ||
2232 | 639 | } | ||
2233 | 640 | |||
2234 | 641 | // Black background behind the progress bar | ||
2235 | 642 | Rectangle { | ||
2236 | 643 | id: musicToolbarFullProgressBackground | ||
2237 | 644 | anchors.verticalCenter: parent.verticalCenter; | ||
2238 | 645 | color: styleMusic.toolbar.fullProgressBackgroundColor; | ||
2239 | 646 | height: parent.height; | ||
2240 | 647 | radius: units.gu(0.5) | ||
2241 | 648 | width: parent.width; | ||
2242 | 649 | } | ||
2243 | 650 | |||
2244 | 651 | // The orange fill of the progress bar | ||
2245 | 652 | Rectangle { | ||
2246 | 653 | id: musicToolbarFullProgressTrough | ||
2247 | 654 | anchors.verticalCenter: parent.verticalCenter; | ||
2248 | 655 | antialiasing: true | ||
2249 | 656 | color: styleMusic.toolbar.fullProgressTroughColor; | ||
2250 | 657 | height: parent.height; | ||
2251 | 658 | radius: units.gu(0.5) | ||
2252 | 659 | width: musicToolbarFullProgressHandle.x + (height / 2); // +radius | ||
2253 | 660 | } | ||
2254 | 661 | |||
2255 | 662 | // The current position (handle) of the progress bar | ||
2256 | 663 | Rectangle { | ||
2257 | 664 | id: musicToolbarFullProgressHandle | ||
2258 | 665 | anchors.verticalCenter: musicToolbarFullProgressBackground.verticalCenter | ||
2259 | 666 | antialiasing: true | ||
2260 | 667 | color: styleMusic.nowPlaying.progressHandleColor | ||
2261 | 668 | height: units.gu(1.5) | ||
2262 | 669 | radius: height / 2 | ||
2263 | 670 | width: height | ||
2264 | 671 | |||
2265 | 672 | // On X change update the position string | ||
2266 | 673 | onXChanged: { | ||
2267 | 674 | if (musicToolbarFullProgressBarContainer.seeking) { | ||
2268 | 675 | var fraction = (x + (width / 2)) / parent.width; | ||
2269 | 676 | musicToolbarFullPositionLabel.text = durationToString(fraction * player.duration) | ||
2270 | 677 | } | ||
2271 | 678 | } | ||
2272 | 679 | } | ||
2273 | 680 | } | ||
2274 | 681 | |||
2275 | 682 | /* Duration label */ | ||
2276 | 683 | Label { | ||
2277 | 684 | id: musicToolbarFullDurationLabel | ||
2278 | 685 | anchors.right: parent.right | ||
2279 | 686 | anchors.rightMargin: units.gu(2) | ||
2280 | 687 | anchors.top: parent.top | ||
2281 | 688 | color: styleMusic.nowPlaying.labelColor | ||
2282 | 689 | fontSize: "x-small" | ||
2283 | 690 | height: parent.height | ||
2284 | 691 | horizontalAlignment: Text.AlignHCenter | ||
2285 | 692 | text: durationToString(player.duration) | ||
2286 | 693 | verticalAlignment: Text.AlignVCenter | ||
2287 | 694 | width: units.gu(3) | ||
2288 | 695 | } | ||
2289 | 696 | |||
2290 | 697 | /* Border at the bottom */ | ||
2291 | 698 | Rectangle { | ||
2292 | 699 | anchors.bottom: parent.bottom | ||
2293 | 700 | anchors.left: parent.left | ||
2294 | 701 | anchors.right: parent.right | ||
2295 | 702 | color: styleMusic.common.white | ||
2296 | 703 | height: units.gu(0.1) | ||
2297 | 704 | opacity: 0.1 | ||
2298 | 705 | } | ||
2299 | 706 | } | ||
2300 | 707 | } | ||
2304 | 708 | 89 | ||
2305 | 709 | /* Expanded toolbar */ | 90 | /* Expanded toolbar */ |
2306 | 710 | Rectangle { | 91 | Rectangle { |
2307 | @@ -713,12 +94,13 @@ | |||
2308 | 713 | fill: parent | 94 | fill: parent |
2309 | 714 | } | 95 | } |
2310 | 715 | color: "transparent" | 96 | color: "transparent" |
2311 | 716 | visible: musicToolbarPanel.currentMode === "expanded" | ||
2312 | 717 | 97 | ||
2313 | 718 | Rectangle { | 98 | Rectangle { |
2314 | 719 | id: musicToolbarPlayerControls | 99 | id: musicToolbarPlayerControls |
2317 | 720 | anchors.fill: parent | 100 | anchors { |
2318 | 721 | color: styleMusic.playerControls.backgroundColor | 101 | fill: parent |
2319 | 102 | } | ||
2320 | 103 | color: "#000" | ||
2321 | 722 | state: trackQueue.model.count === 0 ? "disabled" : "enabled" | 104 | state: trackQueue.model.count === 0 ? "disabled" : "enabled" |
2322 | 723 | states: [ | 105 | states: [ |
2323 | 724 | State { | 106 | State { |
2324 | @@ -745,39 +127,55 @@ | |||
2325 | 745 | } | 127 | } |
2326 | 746 | ] | 128 | ] |
2327 | 747 | 129 | ||
2328 | 130 | /* Disabled (empty state) controls */ | ||
2329 | 748 | Rectangle { | 131 | Rectangle { |
2330 | 749 | id: disabledPlayerControlsGroup | 132 | id: disabledPlayerControlsGroup |
2332 | 750 | anchors.fill: parent | 133 | anchors { |
2333 | 134 | bottom: playerControlsProgressBar.top | ||
2334 | 135 | left: parent.left | ||
2335 | 136 | right: parent.right | ||
2336 | 137 | top: parent.top | ||
2337 | 138 | } | ||
2338 | 751 | color: "transparent" | 139 | color: "transparent" |
2339 | 752 | visible: trackQueue.model.count === 0 | ||
2340 | 753 | 140 | ||
2341 | 754 | Label { | 141 | Label { |
2342 | 755 | id: noSongsInQueueLabel | 142 | id: noSongsInQueueLabel |
2343 | 756 | anchors { | 143 | anchors { |
2344 | 757 | left: parent.left | 144 | left: parent.left |
2345 | 145 | leftMargin: units.gu(2) | ||
2346 | 758 | right: disabledPlayerControlsPlayButton.left | 146 | right: disabledPlayerControlsPlayButton.left |
2349 | 759 | margins: units.gu(1) | 147 | rightMargin: units.gu(2) |
2350 | 760 | top: parent.top | 148 | verticalCenter: parent.verticalCenter |
2351 | 761 | } | 149 | } |
2352 | 762 | color: styleMusic.playerControls.labelColor | 150 | color: styleMusic.playerControls.labelColor |
2354 | 763 | text: i18n.tr("Tap play to shuffle music") | 151 | text: i18n.tr("Tap to shuffle music") |
2355 | 764 | fontSize: "large" | 152 | fontSize: "large" |
2356 | 765 | wrapMode: Text.WordWrap | 153 | wrapMode: Text.WordWrap |
2357 | 766 | maximumLineCount: 2 | 154 | maximumLineCount: 2 |
2358 | 767 | } | 155 | } |
2359 | 768 | 156 | ||
2361 | 769 | Rectangle { | 157 | /* Play/Pause button */ |
2362 | 158 | Icon { | ||
2363 | 770 | id: disabledPlayerControlsPlayButton | 159 | id: disabledPlayerControlsPlayButton |
2371 | 771 | anchors.right: parent.right | 160 | anchors { |
2372 | 772 | anchors.rightMargin: units.gu(1) | 161 | right: parent.right |
2373 | 773 | anchors.verticalCenter: parent.verticalCenter | 162 | rightMargin: units.gu(3) |
2374 | 774 | antialiasing: true | 163 | verticalCenter: parent.verticalCenter |
2375 | 775 | color: "#444" | 164 | } |
2376 | 776 | height: units.gu(7) | 165 | color: "#FFF" |
2377 | 777 | radius: height / 2 | 166 | height: units.gu(2.5) |
2378 | 167 | name: player.playbackState === MediaPlayer.PlayingState ? | ||
2379 | 168 | "media-playback-pause" : "media-playback-start" | ||
2380 | 169 | objectName: "disabledSmallPlayShape" | ||
2381 | 778 | width: height | 170 | width: height |
2382 | 171 | } | ||
2383 | 779 | 172 | ||
2385 | 780 | function trigger() { | 173 | /* Click to shuffle music */ |
2386 | 174 | MouseArea { | ||
2387 | 175 | anchors { | ||
2388 | 176 | fill: parent | ||
2389 | 177 | } | ||
2390 | 178 | onClicked: { | ||
2391 | 781 | if (emptyPage.noMusic) { | 179 | if (emptyPage.noMusic) { |
2392 | 782 | return; | 180 | return; |
2393 | 783 | } | 181 | } |
2394 | @@ -789,230 +187,54 @@ | |||
2395 | 789 | player.toggle(); | 187 | player.toggle(); |
2396 | 790 | } | 188 | } |
2397 | 791 | } | 189 | } |
2398 | 792 | |||
2399 | 793 | // draws the outer shadow/highlight | ||
2400 | 794 | Rectangle { | ||
2401 | 795 | id: disabledSourceOutter | ||
2402 | 796 | anchors { fill: parent; margins: -units.gu(0.1) } | ||
2403 | 797 | radius: (width / 2) | ||
2404 | 798 | antialiasing: true | ||
2405 | 799 | gradient: Gradient { | ||
2406 | 800 | GradientStop { position: 0.0; color: "black" } | ||
2407 | 801 | GradientStop { position: 0.5; color: "transparent" } | ||
2408 | 802 | GradientStop { position: 1.0; color: UbuntuColors.warmGrey } | ||
2409 | 803 | } | ||
2410 | 804 | |||
2411 | 805 | Rectangle { | ||
2412 | 806 | anchors.verticalCenter: parent.verticalCenter | ||
2413 | 807 | anchors.horizontalCenter: parent.horizontalCenter | ||
2414 | 808 | antialiasing: true | ||
2415 | 809 | color: "#444" | ||
2416 | 810 | height: playerControlsPlayButton.height - units.gu(.1) | ||
2417 | 811 | radius: height / 2 | ||
2418 | 812 | width: height | ||
2419 | 813 | |||
2420 | 814 | Rectangle { | ||
2421 | 815 | id: disabledPlayerControlsPlayInnerCircle | ||
2422 | 816 | anchors.horizontalCenter: parent.horizontalCenter | ||
2423 | 817 | anchors.verticalCenter: parent.verticalCenter | ||
2424 | 818 | antialiasing: true | ||
2425 | 819 | height: units.gu(4.5) | ||
2426 | 820 | radius: height / 2 | ||
2427 | 821 | width: height | ||
2428 | 822 | color: styleMusic.toolbar.fullInnerPlayCircleColor | ||
2429 | 823 | |||
2430 | 824 | // draws the inner shadow/highlight | ||
2431 | 825 | Rectangle { | ||
2432 | 826 | id: disabledSourceInner | ||
2433 | 827 | anchors { fill: parent; margins: -units.gu(0.1) } | ||
2434 | 828 | radius: (width / 2) | ||
2435 | 829 | antialiasing: true | ||
2436 | 830 | gradient: Gradient { | ||
2437 | 831 | GradientStop { position: 0.0; color: UbuntuColors.warmGrey } | ||
2438 | 832 | GradientStop { position: 0.5; color: "transparent" } | ||
2439 | 833 | GradientStop { position: 1.0; color: "black" } | ||
2440 | 834 | } | ||
2441 | 835 | |||
2442 | 836 | Rectangle { | ||
2443 | 837 | anchors.verticalCenter: parent.verticalCenter | ||
2444 | 838 | anchors.horizontalCenter: parent.horizontalCenter | ||
2445 | 839 | antialiasing: true | ||
2446 | 840 | height: playerControlsPlayInnerCircle.height - units.gu(.1) | ||
2447 | 841 | radius: height / 2 | ||
2448 | 842 | width: height | ||
2449 | 843 | color: styleMusic.toolbar.fullInnerPlayCircleColor | ||
2450 | 844 | |||
2451 | 845 | Image { | ||
2452 | 846 | id: disabledPlayIndicator | ||
2453 | 847 | height: units.gu(4) | ||
2454 | 848 | width: height | ||
2455 | 849 | anchors.horizontalCenter: parent.horizontalCenter | ||
2456 | 850 | anchors.verticalCenter: parent.verticalCenter | ||
2457 | 851 | opacity: emptyPage.noMusic ? .4 : 1 | ||
2458 | 852 | source: player.playbackState === MediaPlayer.PlayingState ? | ||
2459 | 853 | Qt.resolvedUrl("images/media-playback-pause.svg") : Qt.resolvedUrl("images/media-playback-start.svg") | ||
2460 | 854 | } | ||
2461 | 855 | } | ||
2462 | 856 | } | ||
2463 | 857 | } | ||
2464 | 858 | } | ||
2465 | 859 | } | ||
2466 | 860 | } | 190 | } |
2467 | 861 | } | 191 | } |
2468 | 862 | 192 | ||
2469 | 193 | /* Enabled (queue > 0) controls */ | ||
2470 | 863 | Rectangle { | 194 | Rectangle { |
2471 | 864 | id: enabledPlayerControlsGroup | 195 | id: enabledPlayerControlsGroup |
2473 | 865 | anchors.fill: parent | 196 | anchors { |
2474 | 197 | bottom: playerControlsProgressBar.top | ||
2475 | 198 | left: parent.left | ||
2476 | 199 | right: parent.right | ||
2477 | 200 | top: parent.top | ||
2478 | 201 | } | ||
2479 | 866 | color: "transparent" | 202 | color: "transparent" |
2605 | 867 | visible: trackQueue.model.count !== 0 | 203 | |
2606 | 868 | 204 | /* Album art in player controls */ | |
2607 | 869 | /* Settings button */ | 205 | CoverGrid { |
2608 | 870 | // TODO: Enable settings when it is practical | 206 | id: playerControlsImage |
2609 | 871 | /* Rectangle { | 207 | anchors { |
2610 | 872 | id: playerControlsSettings | 208 | bottom: parent.bottom |
2611 | 873 | anchors.right: parent.right | 209 | left: parent.left |
2612 | 874 | anchors.verticalCenter: parent.verticalCenter | 210 | top: parent.top |
2613 | 875 | width: units.gu(6) | 211 | } |
2614 | 876 | height: width | 212 | covers: [{art: player.currentMetaArt, author: player.currentMetaArtist, album: player.currentMetaArt}] |
2615 | 877 | color: "transparent" | 213 | size: parent.height |
2491 | 878 | |||
2492 | 879 | Image { | ||
2493 | 880 | anchors.horizontalCenter: parent.horizontalCenter | ||
2494 | 881 | anchors.verticalCenter: parent.verticalCenter | ||
2495 | 882 | height: units.gu(3) | ||
2496 | 883 | source: Qt.resolvedUrl("images/settings.png") | ||
2497 | 884 | width: height | ||
2498 | 885 | } | ||
2499 | 886 | |||
2500 | 887 | MouseArea { | ||
2501 | 888 | anchors.fill: parent | ||
2502 | 889 | onClicked: { | ||
2503 | 890 | console.debug('Debug: Show settings') | ||
2504 | 891 | PopupUtils.open(Qt.resolvedUrl("MusicSettings.qml"), mainView, | ||
2505 | 892 | { | ||
2506 | 893 | title: i18n.tr("Settings") | ||
2507 | 894 | } ) | ||
2508 | 895 | } | ||
2509 | 896 | } | ||
2510 | 897 | } */ | ||
2511 | 898 | |||
2512 | 899 | /* Play/Pause button TODO: image and colours needs updating */ | ||
2513 | 900 | Rectangle { | ||
2514 | 901 | id: playerControlsPlayButton | ||
2515 | 902 | anchors.right: parent.right | ||
2516 | 903 | anchors.rightMargin: units.gu(1) | ||
2517 | 904 | anchors.verticalCenter: parent.verticalCenter | ||
2518 | 905 | antialiasing: true | ||
2519 | 906 | color: "#444" | ||
2520 | 907 | height: units.gu(7) | ||
2521 | 908 | objectName: "smallPlayShape" | ||
2522 | 909 | radius: height / 2 | ||
2523 | 910 | width: height | ||
2524 | 911 | |||
2525 | 912 | function trigger() { | ||
2526 | 913 | if (emptyPage.noMusic) { | ||
2527 | 914 | return; | ||
2528 | 915 | } | ||
2529 | 916 | |||
2530 | 917 | if (trackQueue.model.count === 0) { | ||
2531 | 918 | playRandomSong(); | ||
2532 | 919 | } | ||
2533 | 920 | else { | ||
2534 | 921 | player.toggle(); | ||
2535 | 922 | } | ||
2536 | 923 | } | ||
2537 | 924 | |||
2538 | 925 | // draws the outer shadow/highlight | ||
2539 | 926 | Rectangle { | ||
2540 | 927 | id: sourceOutter | ||
2541 | 928 | anchors { fill: parent; margins: -units.gu(0.1) } | ||
2542 | 929 | radius: (width / 2) | ||
2543 | 930 | antialiasing: true | ||
2544 | 931 | gradient: Gradient { | ||
2545 | 932 | GradientStop { position: 0.0; color: "black" } | ||
2546 | 933 | GradientStop { position: 0.5; color: "transparent" } | ||
2547 | 934 | GradientStop { position: 1.0; color: UbuntuColors.warmGrey } | ||
2548 | 935 | } | ||
2549 | 936 | |||
2550 | 937 | Rectangle { | ||
2551 | 938 | anchors.verticalCenter: parent.verticalCenter | ||
2552 | 939 | anchors.horizontalCenter: parent.horizontalCenter | ||
2553 | 940 | antialiasing: true | ||
2554 | 941 | color: "#444" | ||
2555 | 942 | height: playerControlsPlayButton.height - units.gu(.1) | ||
2556 | 943 | radius: height / 2 | ||
2557 | 944 | width: height | ||
2558 | 945 | |||
2559 | 946 | Rectangle { | ||
2560 | 947 | id: playerControlsPlayInnerCircle | ||
2561 | 948 | anchors.horizontalCenter: parent.horizontalCenter | ||
2562 | 949 | anchors.verticalCenter: parent.verticalCenter | ||
2563 | 950 | antialiasing: true | ||
2564 | 951 | height: units.gu(4.5) | ||
2565 | 952 | radius: height / 2 | ||
2566 | 953 | width: height | ||
2567 | 954 | color: styleMusic.toolbar.fullInnerPlayCircleColor | ||
2568 | 955 | |||
2569 | 956 | // draws the inner shadow/highlight | ||
2570 | 957 | Rectangle { | ||
2571 | 958 | id: sourceInner | ||
2572 | 959 | anchors { fill: parent; margins: -units.gu(0.1) } | ||
2573 | 960 | radius: (width / 2) | ||
2574 | 961 | antialiasing: true | ||
2575 | 962 | gradient: Gradient { | ||
2576 | 963 | GradientStop { position: 0.0; color: UbuntuColors.warmGrey } | ||
2577 | 964 | GradientStop { position: 0.5; color: "transparent" } | ||
2578 | 965 | GradientStop { position: 1.0; color: "black" } | ||
2579 | 966 | } | ||
2580 | 967 | |||
2581 | 968 | Rectangle { | ||
2582 | 969 | anchors.verticalCenter: parent.verticalCenter | ||
2583 | 970 | anchors.horizontalCenter: parent.horizontalCenter | ||
2584 | 971 | antialiasing: true | ||
2585 | 972 | height: playerControlsPlayInnerCircle.height - units.gu(.1) | ||
2586 | 973 | radius: height / 2 | ||
2587 | 974 | width: height | ||
2588 | 975 | color: styleMusic.toolbar.fullInnerPlayCircleColor | ||
2589 | 976 | |||
2590 | 977 | Image { | ||
2591 | 978 | id: playindicator | ||
2592 | 979 | height: units.gu(4) | ||
2593 | 980 | width: height | ||
2594 | 981 | anchors.horizontalCenter: parent.horizontalCenter | ||
2595 | 982 | anchors.verticalCenter: parent.verticalCenter | ||
2596 | 983 | opacity: emptyPage.noMusic ? .4 : 1 | ||
2597 | 984 | source: player.playbackState === MediaPlayer.PlayingState ? | ||
2598 | 985 | Qt.resolvedUrl("images/media-playback-pause.svg") : Qt.resolvedUrl("images/media-playback-start.svg") | ||
2599 | 986 | } | ||
2600 | 987 | } | ||
2601 | 988 | } | ||
2602 | 989 | } | ||
2603 | 990 | } | ||
2604 | 991 | } | ||
2616 | 992 | } | 214 | } |
2617 | 993 | 215 | ||
2626 | 994 | /* Container holding the labels for the toolbar */ | 216 | /* Column of meta labels */ |
2627 | 995 | Rectangle { | 217 | Column { |
2628 | 996 | id: playerControlLabelContainer | 218 | id: playerControlsLabels |
2629 | 997 | anchors.bottom: parent.bottom | 219 | anchors { |
2630 | 998 | anchors.left: parent.left | 220 | left: playerControlsImage.right |
2631 | 999 | anchors.right: playerControlsPlayButton.left | 221 | leftMargin: units.gu(1.5) |
2632 | 1000 | anchors.top: parent.top | 222 | right: playerControlsPlayButton.left |
2633 | 1001 | color: "transparent" | 223 | rightMargin: units.gu(1) |
2634 | 224 | verticalCenter: parent.verticalCenter | ||
2635 | 225 | } | ||
2636 | 1002 | 226 | ||
2637 | 1003 | /* Title of track */ | 227 | /* Title of track */ |
2638 | 1004 | Label { | 228 | Label { |
2639 | 1005 | id: playerControlsTitle | 229 | id: playerControlsTitle |
2647 | 1006 | anchors.left: parent.left | 230 | anchors { |
2648 | 1007 | anchors.leftMargin: units.gu(1) | 231 | left: parent.left |
2649 | 1008 | anchors.right: parent.right | 232 | right: parent.right |
2650 | 1009 | anchors.rightMargin: units.gu(1) | 233 | } |
2651 | 1010 | anchors.top: parent.top | 234 | color: "#FFF" |
2645 | 1011 | anchors.topMargin: units.gu(1) | ||
2646 | 1012 | color: styleMusic.playerControls.labelColor | ||
2652 | 1013 | elide: Text.ElideRight | 235 | elide: Text.ElideRight |
2655 | 1014 | fontSize: "medium" | 236 | fontSize: "small" |
2656 | 1015 | objectName: "playercontroltitle" | 237 | font.weight: Font.DemiBold |
2657 | 1016 | text: player.currentMetaTitle === "" | 238 | text: player.currentMetaTitle === "" |
2658 | 1017 | ? player.source : player.currentMetaTitle | 239 | ? player.source : player.currentMetaTitle |
2659 | 1018 | } | 240 | } |
2660 | @@ -1020,119 +242,105 @@ | |||
2661 | 1020 | /* Artist of track */ | 242 | /* Artist of track */ |
2662 | 1021 | Label { | 243 | Label { |
2663 | 1022 | id: playerControlsArtist | 244 | id: playerControlsArtist |
2670 | 1023 | anchors.left: parent.left | 245 | anchors { |
2671 | 1024 | anchors.leftMargin: units.gu(1) | 246 | left: parent.left |
2672 | 1025 | anchors.right: parent.right | 247 | right: parent.right |
2673 | 1026 | anchors.rightMargin: units.gu(1) | 248 | } |
2674 | 1027 | anchors.top: playerControlsTitle.bottom | 249 | color: "#FFF" |
2669 | 1028 | color: styleMusic.playerControls.labelColor | ||
2675 | 1029 | elide: Text.ElideRight | 250 | elide: Text.ElideRight |
2676 | 1030 | fontSize: "small" | 251 | fontSize: "small" |
2677 | 252 | opacity: 0.4 | ||
2678 | 1031 | text: player.currentMetaArtist | 253 | text: player.currentMetaArtist |
2679 | 1032 | } | 254 | } |
2696 | 1033 | 255 | } | |
2697 | 1034 | /* Album of track */ | 256 | |
2698 | 1035 | Label { | 257 | /* Play/Pause button */ |
2699 | 1036 | id: playerControlsAlbum | 258 | Icon { |
2700 | 1037 | anchors.left: parent.left | 259 | id: playerControlsPlayButton |
2701 | 1038 | anchors.leftMargin: units.gu(1) | 260 | anchors { |
2702 | 1039 | anchors.right: parent.right | 261 | right: parent.right |
2703 | 1040 | anchors.rightMargin: units.gu(1) | 262 | rightMargin: units.gu(3) |
2704 | 1041 | anchors.top: playerControlsArtist.bottom | 263 | verticalCenter: parent.verticalCenter |
2705 | 1042 | color: styleMusic.playerControls.labelColor | 264 | } |
2706 | 1043 | elide: Text.ElideRight | 265 | color: "#FFF" |
2707 | 1044 | fontSize: "small" | 266 | height: units.gu(2.5) |
2708 | 1045 | text: player.currentMetaAlbum | 267 | name: player.playbackState === MediaPlayer.PlayingState ? |
2709 | 1046 | } | 268 | "media-playback-pause" : "media-playback-start" |
2710 | 1047 | } | 269 | objectName: "playShape" |
2711 | 1048 | 270 | width: height | |
2712 | 271 | } | ||
2713 | 272 | |||
2714 | 273 | MouseArea { | ||
2715 | 274 | anchors { | ||
2716 | 275 | bottom: parent.bottom | ||
2717 | 276 | horizontalCenter: playerControlsPlayButton.horizontalCenter | ||
2718 | 277 | top: parent.top | ||
2719 | 278 | } | ||
2720 | 279 | onClicked: player.toggle() | ||
2721 | 280 | width: units.gu(8) | ||
2722 | 281 | |||
2723 | 282 | Rectangle { | ||
2724 | 283 | anchors { | ||
2725 | 284 | fill: parent | ||
2726 | 285 | } | ||
2727 | 286 | color: "#FFF" | ||
2728 | 287 | opacity: parent.pressed ? 0.1 : 0 | ||
2729 | 288 | |||
2730 | 289 | Behavior on opacity { | ||
2731 | 290 | UbuntuNumberAnimation { | ||
2732 | 291 | duration: UbuntuAnimation.FastDuration | ||
2733 | 292 | } | ||
2734 | 293 | } | ||
2735 | 294 | } | ||
2736 | 295 | } | ||
2737 | 296 | |||
2738 | 297 | /* Mouse area to jump to now playing */ | ||
2739 | 1049 | Rectangle { | 298 | Rectangle { |
2741 | 1050 | anchors.fill: playerControlLabelContainer | 299 | anchors { |
2742 | 300 | bottom: parent.bottom | ||
2743 | 301 | left: parent.left | ||
2744 | 302 | right: playerControlsLabels.right | ||
2745 | 303 | top: parent.top | ||
2746 | 304 | } | ||
2747 | 1051 | color: "transparent" | 305 | color: "transparent" |
2748 | 306 | objectName: "jumpNowPlaying" | ||
2749 | 1052 | function trigger() { | 307 | function trigger() { |
2750 | 1053 | tabs.pushNowPlaying(); | 308 | tabs.pushNowPlaying(); |
2751 | 1054 | } | 309 | } |
2752 | 1055 | } | 310 | } |
2753 | 1056 | } | 311 | } |
2833 | 1057 | } | 312 | |
2834 | 1058 | } | 313 | /* Object which provides the progress bar when toolbar is minimized */ |
2835 | 1059 | 314 | Rectangle { | |
2836 | 1060 | /* Object which provides the progress bar when toolbar is minimized */ | 315 | id: playerControlsProgressBar |
2837 | 1061 | Rectangle { | 316 | anchors { |
2838 | 1062 | id: musicToolbarSmallProgressBackground | 317 | bottom: parent.bottom |
2839 | 1063 | anchors { | 318 | left: parent.left |
2840 | 1064 | bottom: parent.top | 319 | right: parent.right |
2841 | 1065 | left: parent.left | 320 | } |
2842 | 1066 | right: parent.right | 321 | color: styleMusic.common.black |
2843 | 1067 | } | 322 | height: units.gu(0.25) |
2844 | 1068 | color: styleMusic.common.black | 323 | |
2845 | 1069 | height: musicToolbarPanel.minimizedHeight | 324 | Rectangle { |
2846 | 1070 | visible: (!musicToolbarPanel.animating && | 325 | id: playerControlsProgressBarHint |
2847 | 1071 | !musicToolbarPanel.opened) | 326 | anchors { |
2848 | 1072 | || musicToolbarPanel.currentMode == "expanded" | 327 | left: parent.left |
2849 | 1073 | 328 | top: parent.top | |
2850 | 1074 | Rectangle { | 329 | } |
2851 | 1075 | id: musicToolbarSmallProgressHint | 330 | color: UbuntuColors.blue |
2852 | 1076 | anchors.left: parent.left | 331 | height: parent.height |
2853 | 1077 | anchors.top: parent.top | 332 | width: 0 |
2854 | 1078 | color: styleMusic.nowPlaying.progressForegroundColor | 333 | |
2855 | 1079 | height: parent.height | 334 | Connections { |
2856 | 1080 | width: 0 | 335 | target: player |
2857 | 1081 | 336 | onPositionChanged: { | |
2858 | 1082 | Connections { | 337 | playerControlsProgressBarHint.width = (player.position / player.duration) * playerControlsProgressBar.width |
2859 | 1083 | target: player | 338 | } |
2860 | 1084 | onPositionChanged: { | 339 | onStopped: { |
2861 | 1085 | musicToolbarSmallProgressHint.width = (player.position / player.duration) * musicToolbarSmallProgressBackground.width | 340 | playerControlsProgressBarHint.width = 0; |
2862 | 1086 | } | 341 | } |
2863 | 1087 | onStopped: { | 342 | } |
2864 | 1088 | musicToolbarSmallProgressHint.width = 0; | 343 | } |
2786 | 1089 | } | ||
2787 | 1090 | } | ||
2788 | 1091 | } | ||
2789 | 1092 | } | ||
2790 | 1093 | |||
2791 | 1094 | /* Mouse events for the progress bar | ||
2792 | 1095 | is after musicToolbarMouseArea so that it captures mouse events for dragging */ | ||
2793 | 1096 | MouseArea { | ||
2794 | 1097 | id: musicToolbarFullProgressMouseArea | ||
2795 | 1098 | height: units.gu(2) | ||
2796 | 1099 | width: musicToolbarFullProgressBarContainer.width | ||
2797 | 1100 | x: musicToolbarFullProgressBarContainer.x | ||
2798 | 1101 | y: musicToolbarFullProgressBarContainer.y | ||
2799 | 1102 | |||
2800 | 1103 | drag.axis: Drag.XAxis | ||
2801 | 1104 | drag.minimumX: -(musicToolbarFullProgressHandle.width / 2) | ||
2802 | 1105 | drag.maximumX: musicToolbarFullProgressBarContainer.width - (musicToolbarFullProgressHandle.width / 2) | ||
2803 | 1106 | drag.target: musicToolbarFullProgressHandle | ||
2804 | 1107 | |||
2805 | 1108 | onPressed: { | ||
2806 | 1109 | musicToolbarFullProgressBarContainer.seeking = true; | ||
2807 | 1110 | |||
2808 | 1111 | // Jump the handle to the current mouse position | ||
2809 | 1112 | musicToolbarFullProgressHandle.x = mouse.x - (musicToolbarFullProgressHandle.width / 2); | ||
2810 | 1113 | } | ||
2811 | 1114 | |||
2812 | 1115 | onReleased: { | ||
2813 | 1116 | var fraction = mouse.x / musicToolbarFullProgressBarContainer.width; | ||
2814 | 1117 | |||
2815 | 1118 | // Limit the bounds of the fraction | ||
2816 | 1119 | fraction = fraction < 0 ? 0 : fraction | ||
2817 | 1120 | fraction = fraction > 1 ? 1 : fraction | ||
2818 | 1121 | |||
2819 | 1122 | player.seek((fraction) * player.duration); | ||
2820 | 1123 | musicToolbarFullProgressBarContainer.seeking = false; | ||
2821 | 1124 | } | ||
2822 | 1125 | } | ||
2823 | 1126 | |||
2824 | 1127 | // Timer for autohide | ||
2825 | 1128 | Timer { | ||
2826 | 1129 | id: toolbarAutoHideTimer | ||
2827 | 1130 | interval: 5000 | ||
2828 | 1131 | repeat: false | ||
2829 | 1132 | running: false | ||
2830 | 1133 | onTriggered: { | ||
2831 | 1134 | if (currentPage !== nowPlaying) { // don't autohide on now playing | ||
2832 | 1135 | hideToolbar(); | ||
2865 | 1136 | } | 344 | } |
2866 | 1137 | } | 345 | } |
2867 | 1138 | } | 346 | } |
2868 | 1139 | 347 | ||
2869 | === modified file 'MusicTracks.qml' | |||
2870 | --- MusicTracks.qml 2014-09-20 15:41:33 +0000 | |||
2871 | +++ MusicTracks.qml 2014-10-21 15:31:33 +0000 | |||
2872 | @@ -36,8 +36,10 @@ | |||
2873 | 36 | 36 | ||
2874 | 37 | ListView { | 37 | ListView { |
2875 | 38 | id: tracklist | 38 | id: tracklist |
2878 | 39 | anchors.fill: parent | 39 | anchors { |
2879 | 40 | anchors.bottomMargin: musicToolbar.mouseAreaOffset + musicToolbar.minimizedHeight | 40 | fill: parent |
2880 | 41 | topMargin: units.gu(2) | ||
2881 | 42 | } | ||
2882 | 41 | highlightFollowsCurrentItem: false | 43 | highlightFollowsCurrentItem: false |
2883 | 42 | objectName: "trackstab-listview" | 44 | objectName: "trackstab-listview" |
2884 | 43 | model: SortFilterModel { | 45 | model: SortFilterModel { |
2885 | @@ -59,7 +61,8 @@ | |||
2886 | 59 | color: "transparent" | 61 | color: "transparent" |
2887 | 60 | objectName: "tracksPageListItem" + index | 62 | objectName: "tracksPageListItem" + index |
2888 | 61 | width: parent.width | 63 | width: parent.width |
2890 | 62 | height: styleMusic.common.itemHeight | 64 | height: units.gu(7) |
2891 | 65 | showDivider: false | ||
2892 | 63 | 66 | ||
2893 | 64 | rightSideActions: [ | 67 | rightSideActions: [ |
2894 | 65 | AddToQueue { | 68 | AddToQueue { |
2895 | @@ -77,29 +80,25 @@ | |||
2896 | 77 | 80 | ||
2897 | 78 | MusicRow { | 81 | MusicRow { |
2898 | 79 | id: musicRow | 82 | id: musicRow |
2899 | 83 | anchors.verticalCenter: parent.verticalCenter | ||
2900 | 80 | covers: [{art: model.art}] | 84 | covers: [{art: model.art}] |
2901 | 85 | isSquare: true | ||
2902 | 86 | coverSize: units.gu(6) | ||
2903 | 87 | spacing: units.gu(2) | ||
2904 | 81 | column: Column { | 88 | column: Column { |
2905 | 82 | spacing: units.gu(1) | ||
2906 | 83 | Label { | ||
2907 | 84 | id: trackArtist | ||
2908 | 85 | color: styleMusic.common.subtitle | ||
2909 | 86 | fontSize: "x-small" | ||
2910 | 87 | text: model.author | ||
2911 | 88 | } | ||
2912 | 89 | |||
2913 | 90 | Label { | 89 | Label { |
2914 | 91 | id: trackTitle | 90 | id: trackTitle |
2915 | 92 | color: styleMusic.common.music | 91 | color: styleMusic.common.music |
2917 | 93 | fontSize: "medium" | 92 | fontSize: "small" |
2918 | 94 | objectName: "tracktitle" | 93 | objectName: "tracktitle" |
2919 | 95 | text: model.title | 94 | text: model.title |
2920 | 96 | } | 95 | } |
2921 | 97 | 96 | ||
2922 | 98 | Label { | 97 | Label { |
2924 | 99 | id: trackAlbum | 98 | id: trackArtist |
2925 | 100 | color: styleMusic.common.subtitle | 99 | color: styleMusic.common.subtitle |
2928 | 101 | fontSize: "xx-small" | 100 | fontSize: "x-small" |
2929 | 102 | text: model.album | 101 | text: model.author |
2930 | 103 | } | 102 | } |
2931 | 104 | } | 103 | } |
2932 | 105 | } | 104 | } |
2933 | 106 | 105 | ||
2934 | === modified file 'MusicaddtoPlaylist.qml' | |||
2935 | --- MusicaddtoPlaylist.qml 2014-09-20 10:50:45 +0000 | |||
2936 | +++ MusicaddtoPlaylist.qml 2014-10-21 15:31:33 +0000 | |||
2937 | @@ -65,7 +65,6 @@ | |||
2938 | 65 | ListView { | 65 | ListView { |
2939 | 66 | id: addtoPlaylistView | 66 | id: addtoPlaylistView |
2940 | 67 | anchors { | 67 | anchors { |
2941 | 68 | bottomMargin: musicToolbar.mouseAreaOffset + musicToolbar.minimizedHeight | ||
2942 | 69 | fill: parent | 68 | fill: parent |
2943 | 70 | } | 69 | } |
2944 | 71 | clip: true | 70 | clip: true |
2945 | 72 | 71 | ||
2946 | === modified file 'Player.qml' | |||
2947 | --- Player.qml 2014-09-20 15:41:33 +0000 | |||
2948 | +++ Player.qml 2014-10-21 15:31:33 +0000 | |||
2949 | @@ -187,7 +187,11 @@ | |||
2950 | 187 | else { | 187 | else { |
2951 | 188 | var obj = trackQueue.model.get(player.currentIndex); | 188 | var obj = trackQueue.model.get(player.currentIndex); |
2952 | 189 | currentMetaAlbum = obj.album; | 189 | currentMetaAlbum = obj.album; |
2954 | 190 | currentMetaArt = obj.art; | 190 | |
2955 | 191 | if (obj.art !== undefined) { // FIXME: protect against not art property in playlists | ||
2956 | 192 | currentMetaArt = obj.art; | ||
2957 | 193 | } | ||
2958 | 194 | |||
2959 | 191 | currentMetaArtist = obj.author; | 195 | currentMetaArtist = obj.author; |
2960 | 192 | currentMetaFile = obj.filename; | 196 | currentMetaFile = obj.filename; |
2961 | 193 | currentMetaTitle = obj.title; | 197 | currentMetaTitle = obj.title; |
2962 | 194 | 198 | ||
2963 | === modified file 'Style.qml' | |||
2964 | --- Style.qml 2014-09-20 10:50:45 +0000 | |||
2965 | +++ Style.qml 2014-10-21 15:31:33 +0000 | |||
2966 | @@ -34,8 +34,8 @@ | |||
2967 | 34 | property QtObject common: QtObject { | 34 | property QtObject common: QtObject { |
2968 | 35 | property color black: "#000000"; | 35 | property color black: "#000000"; |
2969 | 36 | property color white: "#FFFFFF"; | 36 | property color white: "#FFFFFF"; |
2972 | 37 | property color music: "#333333"; | 37 | property color music: "#FFFFFF"; |
2973 | 38 | property color subtitle: "#666666"; | 38 | property color subtitle: "#999999"; |
2974 | 39 | property color expandedColor: "#000000"; | 39 | property color expandedColor: "#000000"; |
2975 | 40 | property int albumSize: units.gu(10); | 40 | property int albumSize: units.gu(10); |
2976 | 41 | property int itemHeight: units.gu(12); | 41 | property int itemHeight: units.gu(12); |
2977 | 42 | 42 | ||
2978 | === modified file 'click/apparmor.json' | |||
2979 | --- click/apparmor.json 2014-07-01 23:13:50 +0000 | |||
2980 | +++ click/apparmor.json 2014-10-21 15:31:33 +0000 | |||
2981 | @@ -1,7 +1,17 @@ | |||
2982 | 1 | { | 1 | { |
2983 | 2 | "policy_version": 1.2, | 2 | "policy_version": 1.2, |
2984 | 3 | "template": "unconfined", | ||
2985 | 4 | "policy_groups": [ | 3 | "policy_groups": [ |
2987 | 5 | "content_exchange" | 4 | "audio", |
2988 | 5 | "content_exchange", | ||
2989 | 6 | "music_files_read", | ||
2990 | 7 | "networking", | ||
2991 | 8 | "usermetrics" | ||
2992 | 9 | ], | ||
2993 | 10 | "read_path": [ | ||
2994 | 11 | "@{HOME}/.cache/media-art/", | ||
2995 | 12 | "@{HOME}/.cache/mediascanner-2.0/" | ||
2996 | 13 | ], | ||
2997 | 14 | "write_path": [ | ||
2998 | 15 | "@{HOME}/Music/Imported/" | ||
2999 | 6 | ] | 16 | ] |
3000 | 7 | } | 17 | } |
3001 | 8 | 18 | ||
3002 | === modified file 'com.ubuntu.music_music.desktop.in.in' | |||
3003 | --- com.ubuntu.music_music.desktop.in.in 2014-07-21 14:49:14 +0000 | |||
3004 | +++ com.ubuntu.music_music.desktop.in.in 2014-10-21 15:31:33 +0000 | |||
3005 | @@ -9,4 +9,7 @@ | |||
3006 | 9 | StartupNotify=true | 9 | StartupNotify=true |
3007 | 10 | X-Ubuntu-Touch=true | 10 | X-Ubuntu-Touch=true |
3008 | 11 | X-Ubuntu-Single-Instance=true | 11 | X-Ubuntu-Single-Instance=true |
3009 | 12 | X-Ubuntu-Splash-Show-Header=true | ||
3010 | 13 | _X-Ubuntu-Splash-Title=Music | ||
3011 | 14 | X-Ubuntu-Splash-Color=#1e1e23 | ||
3012 | 12 | X-Ubuntu-Default-Department-ID=sound-video | 15 | X-Ubuntu-Default-Department-ID=sound-video |
3013 | 13 | 16 | ||
3014 | === modified file 'common/AlbumsPage.qml' | |||
3015 | --- common/AlbumsPage.qml 2014-10-07 02:15:06 +0000 | |||
3016 | +++ common/AlbumsPage.qml 2014-10-21 15:31:33 +0000 | |||
3017 | @@ -28,26 +28,116 @@ | |||
3018 | 28 | 28 | ||
3019 | 29 | MusicPage { | 29 | MusicPage { |
3020 | 30 | id: albumStackPage | 30 | id: albumStackPage |
3021 | 31 | anchors.bottomMargin: units.gu(.5) | ||
3022 | 32 | objectName: "albumsArtistPage" | 31 | objectName: "albumsArtistPage" |
3023 | 33 | visible: false | 32 | visible: false |
3024 | 34 | 33 | ||
3026 | 35 | property string artist: "" | 34 | property string artist: "Unknown Artist" |
3027 | 36 | property var covers: [] | 35 | property var covers: [] |
3028 | 37 | 36 | ||
3031 | 38 | ListView { | 37 | CardView { |
3032 | 39 | id: albumtrackslist | 38 | id: artistAlbumView |
3033 | 40 | anchors { | 39 | anchors { |
3034 | 41 | bottomMargin: wideAspect ? musicToolbar.fullHeight : musicToolbar.mouseAreaOffset + musicToolbar.minimizedHeight | ||
3035 | 42 | fill: parent | 40 | fill: parent |
3036 | 43 | } | 41 | } |
3039 | 44 | delegate: albumTracksDelegate | 42 | header: BlurredHeader { |
3040 | 45 | header: artistHeaderDelegate | 43 | rightColumn: Column { |
3041 | 44 | spacing: units.gu(2) | ||
3042 | 45 | Button { | ||
3043 | 46 | id: shuffleRow | ||
3044 | 47 | height: units.gu(4) | ||
3045 | 48 | strokeColor: UbuntuColors.green | ||
3046 | 49 | width: units.gu(15) | ||
3047 | 50 | Text { | ||
3048 | 51 | anchors { | ||
3049 | 52 | centerIn: parent | ||
3050 | 53 | } | ||
3051 | 54 | color: "white" | ||
3052 | 55 | text: i18n.tr("Shuffle") | ||
3053 | 56 | } | ||
3054 | 57 | MouseArea { | ||
3055 | 58 | anchors.fill: parent | ||
3056 | 59 | onClicked: shuffleModel(songArtistModel) | ||
3057 | 60 | } | ||
3058 | 61 | } | ||
3059 | 62 | Button { | ||
3060 | 63 | id: queueAllRow | ||
3061 | 64 | height: units.gu(4) | ||
3062 | 65 | strokeColor: UbuntuColors.green | ||
3063 | 66 | width: units.gu(15) | ||
3064 | 67 | Text { | ||
3065 | 68 | anchors { | ||
3066 | 69 | centerIn: parent | ||
3067 | 70 | } | ||
3068 | 71 | color: "white" | ||
3069 | 72 | text: i18n.tr("Queue all") | ||
3070 | 73 | } | ||
3071 | 74 | MouseArea { | ||
3072 | 75 | anchors.fill: parent | ||
3073 | 76 | onClicked: addQueueFromModel(songArtistModel) | ||
3074 | 77 | } | ||
3075 | 78 | } | ||
3076 | 79 | Button { | ||
3077 | 80 | id: playRow | ||
3078 | 81 | color: UbuntuColors.green | ||
3079 | 82 | height: units.gu(4) | ||
3080 | 83 | text: i18n.tr("Play all") | ||
3081 | 84 | width: units.gu(15) | ||
3082 | 85 | MouseArea { | ||
3083 | 86 | anchors.fill: parent | ||
3084 | 87 | onClicked: trackClicked(songArtistModel, 0, true) | ||
3085 | 88 | } | ||
3086 | 89 | } | ||
3087 | 90 | } | ||
3088 | 91 | coverSources: albumStackPage.covers | ||
3089 | 92 | height: units.gu(30) | ||
3090 | 93 | bottomColumn: Column { | ||
3091 | 94 | Label { | ||
3092 | 95 | id: artistLabel | ||
3093 | 96 | anchors { | ||
3094 | 97 | left: parent.left | ||
3095 | 98 | right: parent.right | ||
3096 | 99 | } | ||
3097 | 100 | color: styleMusic.common.music | ||
3098 | 101 | elide: Text.ElideRight | ||
3099 | 102 | fontSize: "x-large" | ||
3100 | 103 | maximumLineCount: 1 | ||
3101 | 104 | objectName: "artistLabel" | ||
3102 | 105 | text: artist | ||
3103 | 106 | wrapMode: Text.NoWrap | ||
3104 | 107 | } | ||
3105 | 108 | |||
3106 | 109 | Item { | ||
3107 | 110 | height: units.gu(1) | ||
3108 | 111 | width: parent.width | ||
3109 | 112 | } | ||
3110 | 113 | |||
3111 | 114 | Label { | ||
3112 | 115 | id: artistCount | ||
3113 | 116 | anchors { | ||
3114 | 117 | left: parent.left | ||
3115 | 118 | right: parent.right | ||
3116 | 119 | } | ||
3117 | 120 | color: styleMusic.common.subtitle | ||
3118 | 121 | elide: Text.ElideRight | ||
3119 | 122 | fontSize: "small" | ||
3120 | 123 | maximumLineCount: 1 | ||
3121 | 124 | text: i18n.tr("%1 album", "%1 albums", artistsModel.count).arg(artistsModel.count) | ||
3122 | 125 | } | ||
3123 | 126 | } | ||
3124 | 127 | |||
3125 | 128 | SongsModel { | ||
3126 | 129 | id: songArtistModel | ||
3127 | 130 | albumArtist: albumStackPage.artist | ||
3128 | 131 | store: musicStore | ||
3129 | 132 | } | ||
3130 | 133 | } | ||
3131 | 134 | itemWidth: units.gu(12) | ||
3132 | 46 | model: AlbumsModel { | 135 | model: AlbumsModel { |
3133 | 47 | id: artistsModel | 136 | id: artistsModel |
3134 | 48 | albumArtist: albumStackPage.artist | 137 | albumArtist: albumStackPage.artist |
3135 | 49 | store: musicStore | 138 | store: musicStore |
3136 | 50 | } | 139 | } |
3137 | 140 | <<<<<<< TREE | ||
3138 | 51 | width: parent.width | 141 | width: parent.width |
3139 | 52 | 142 | ||
3140 | 53 | Component { | 143 | Component { |
3141 | @@ -408,6 +498,26 @@ | |||
3142 | 408 | } | 498 | } |
3143 | 409 | } | 499 | } |
3144 | 410 | } | 500 | } |
3145 | 501 | ======= | ||
3146 | 502 | delegate: Card { | ||
3147 | 503 | id: albumCard | ||
3148 | 504 | coverSources: [{art: model.art}] | ||
3149 | 505 | objectName: "albumsPageGridItem" + index | ||
3150 | 506 | primaryText: model.title | ||
3151 | 507 | secondaryTextVisible: false | ||
3152 | 508 | |||
3153 | 509 | onClicked: { | ||
3154 | 510 | songsPage.album = model.title; | ||
3155 | 511 | |||
3156 | 512 | songsPage.line1 = model.artist | ||
3157 | 513 | songsPage.line2 = model.title | ||
3158 | 514 | songsPage.isAlbum = true | ||
3159 | 515 | songsPage.covers = [{art: model.art}] | ||
3160 | 516 | songsPage.genre = undefined | ||
3161 | 517 | songsPage.title = i18n.tr("Album") | ||
3162 | 518 | |||
3163 | 519 | mainPageStack.push(songsPage) | ||
3164 | 520 | >>>>>>> MERGE-SOURCE | ||
3165 | 411 | } | 521 | } |
3166 | 412 | } | 522 | } |
3167 | 413 | } | 523 | } |
3168 | 414 | 524 | ||
3169 | === modified file 'common/BlurredBackground.qml' | |||
3170 | --- common/BlurredBackground.qml 2014-09-20 15:41:33 +0000 | |||
3171 | +++ common/BlurredBackground.qml 2014-10-21 15:31:33 +0000 | |||
3172 | @@ -23,8 +23,14 @@ | |||
3173 | 23 | 23 | ||
3174 | 24 | // Blurred background | 24 | // Blurred background |
3175 | 25 | Rectangle { | 25 | Rectangle { |
3178 | 26 | anchors.fill: parent | 26 | width: parent.width |
3179 | 27 | property string art: player.currentMetaFile === "" ? Qt.resolvedUrl("../images/music-app-cover@30.png") : player.currentMetaArt | 27 | property string art // : player.currentMetaFile === "" ? Qt.resolvedUrl("../images/music-app-cover@30.png") : player.currentMetaArt |
3180 | 28 | |||
3181 | 29 | // dark layer | ||
3182 | 30 | Rectangle { | ||
3183 | 31 | anchors.fill: parent | ||
3184 | 32 | color: "black" | ||
3185 | 33 | } | ||
3186 | 28 | 34 | ||
3187 | 29 | // the album art | 35 | // the album art |
3188 | 30 | Image { | 36 | Image { |
3189 | @@ -32,27 +38,19 @@ | |||
3190 | 32 | anchors.horizontalCenter: parent.horizontalCenter | 38 | anchors.horizontalCenter: parent.horizontalCenter |
3191 | 33 | anchors.verticalCenter: parent.verticalCenter | 39 | anchors.verticalCenter: parent.verticalCenter |
3192 | 34 | source: art // this has to be fixed for the default cover art to work - cant find in this dir | 40 | source: art // this has to be fixed for the default cover art to work - cant find in this dir |
3194 | 35 | height: Math.max(parent.height, parent.width) | 41 | fillMode: Image.PreserveAspectCrop |
3195 | 42 | height: parent.height | ||
3196 | 36 | width: Math.max(parent.height, parent.width) | 43 | width: Math.max(parent.height, parent.width) |
3197 | 37 | visible: false | 44 | visible: false |
3198 | 38 | onStatusChanged: { | ||
3199 | 39 | if (status === Image.Error) { | ||
3200 | 40 | source = Qt.resolvedUrl("../images/music-app-cover@30.png") | ||
3201 | 41 | } | ||
3202 | 42 | } | ||
3203 | 43 | } | 45 | } |
3204 | 46 | |||
3205 | 44 | // the blur | 47 | // the blur |
3206 | 45 | FastBlur { | 48 | FastBlur { |
3207 | 46 | id: backgroundBlur | 49 | id: backgroundBlur |
3208 | 47 | anchors.fill: backgroundImage | 50 | anchors.fill: backgroundImage |
3209 | 48 | source: backgroundImage | 51 | source: backgroundImage |
3210 | 49 | radius: units.dp(42) | 52 | radius: units.dp(42) |
3217 | 50 | } | 53 | opacity: 0.2 |
3212 | 51 | // transparent white layer | ||
3213 | 52 | Rectangle { | ||
3214 | 53 | anchors.fill: parent | ||
3215 | 54 | color: "white" | ||
3216 | 55 | opacity: 0.7 | ||
3218 | 56 | } | 54 | } |
3219 | 57 | onArtChanged: { | 55 | onArtChanged: { |
3220 | 58 | // TODO: This is a work around for LP:1261078 and LP:1306845. Ideally, | 56 | // TODO: This is a work around for LP:1261078 and LP:1306845. Ideally, |
3221 | 59 | 57 | ||
3222 | === added file 'common/BlurredHeader.qml' | |||
3223 | --- common/BlurredHeader.qml 1970-01-01 00:00:00 +0000 | |||
3224 | +++ common/BlurredHeader.qml 2014-10-21 15:31:33 +0000 | |||
3225 | @@ -0,0 +1,69 @@ | |||
3226 | 1 | /* | ||
3227 | 2 | * Copyright (C) 2014 | ||
3228 | 3 | * Andrew Hayzen <ahayzen@gmail.com> | ||
3229 | 4 | * Victor Thompson <victor.thompson@gmail.com> | ||
3230 | 5 | * | ||
3231 | 6 | * This program is free software; you can redistribute it and/or modify | ||
3232 | 7 | * it under the terms of the GNU General Public License as published by | ||
3233 | 8 | * the Free Software Foundation; version 3. | ||
3234 | 9 | * | ||
3235 | 10 | * This program is distributed in the hope that it will be useful, | ||
3236 | 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
3237 | 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
3238 | 13 | * GNU General Public License for more details. | ||
3239 | 14 | * | ||
3240 | 15 | * You should have received a copy of the GNU General Public License | ||
3241 | 16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
3242 | 17 | */ | ||
3243 | 18 | |||
3244 | 19 | import QtQuick 2.3 | ||
3245 | 20 | import Ubuntu.Components 1.1 | ||
3246 | 21 | import Ubuntu.Components.ListItems 1.0 as ListItem | ||
3247 | 22 | |||
3248 | 23 | ListItem.Standard { | ||
3249 | 24 | id: albumInfo | ||
3250 | 25 | width: parent.width | ||
3251 | 26 | |||
3252 | 27 | property alias bottomColumn: bottomColumnLoader.sourceComponent | ||
3253 | 28 | property alias coverSources: coversImage.covers | ||
3254 | 29 | property alias rightColumn: rightColumnLoader.sourceComponent | ||
3255 | 30 | |||
3256 | 31 | BlurredBackground { | ||
3257 | 32 | id: blurredBackground | ||
3258 | 33 | height: parent.height | ||
3259 | 34 | art: coversImage.firstSource | ||
3260 | 35 | } | ||
3261 | 36 | |||
3262 | 37 | CoverGrid { | ||
3263 | 38 | id: coversImage | ||
3264 | 39 | anchors { | ||
3265 | 40 | bottomMargin: units.gu(2) | ||
3266 | 41 | left: parent.left | ||
3267 | 42 | leftMargin: units.gu(2) | ||
3268 | 43 | rightMargin: units.gu(2) | ||
3269 | 44 | top: parent.top | ||
3270 | 45 | topMargin: units.gu(3) | ||
3271 | 46 | } | ||
3272 | 47 | size: units.gu(18) | ||
3273 | 48 | } | ||
3274 | 49 | |||
3275 | 50 | Loader { | ||
3276 | 51 | id: rightColumnLoader | ||
3277 | 52 | anchors { | ||
3278 | 53 | bottom: coversImage.bottom | ||
3279 | 54 | left: coversImage.right | ||
3280 | 55 | leftMargin: units.gu(2) | ||
3281 | 56 | } | ||
3282 | 57 | } | ||
3283 | 58 | |||
3284 | 59 | Loader { | ||
3285 | 60 | id: bottomColumnLoader | ||
3286 | 61 | anchors { | ||
3287 | 62 | left: coversImage.left | ||
3288 | 63 | right: parent.right | ||
3289 | 64 | rightMargin: units.gu(2) | ||
3290 | 65 | top: coversImage.bottom | ||
3291 | 66 | topMargin: units.gu(1) | ||
3292 | 67 | } | ||
3293 | 68 | } | ||
3294 | 69 | } | ||
3295 | 0 | 70 | ||
3296 | === added file 'common/Card.qml' | |||
3297 | --- common/Card.qml 1970-01-01 00:00:00 +0000 | |||
3298 | +++ common/Card.qml 2014-10-21 15:31:33 +0000 | |||
3299 | @@ -0,0 +1,151 @@ | |||
3300 | 1 | /* | ||
3301 | 2 | * Copyright (C) 2014 | ||
3302 | 3 | * Andrew Hayzen <ahayzen@gmail.com> | ||
3303 | 4 | * | ||
3304 | 5 | * This program is free software; you can redistribute it and/or modify | ||
3305 | 6 | * it under the terms of the GNU General Public License as published by | ||
3306 | 7 | * the Free Software Foundation; version 3. | ||
3307 | 8 | * | ||
3308 | 9 | * This program is distributed in the hope that it will be useful, | ||
3309 | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
3310 | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
3311 | 12 | * GNU General Public License for more details. | ||
3312 | 13 | * | ||
3313 | 14 | * You should have received a copy of the GNU General Public License | ||
3314 | 15 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
3315 | 16 | */ | ||
3316 | 17 | |||
3317 | 18 | import QtQuick 2.3 | ||
3318 | 19 | import Ubuntu.Components 1.1 | ||
3319 | 20 | |||
3320 | 21 | |||
3321 | 22 | Rectangle { | ||
3322 | 23 | id: card | ||
3323 | 24 | color: "transparent" | ||
3324 | 25 | height: cardColumn.childrenRect.height + 2 * bg.anchors.margins | ||
3325 | 26 | |||
3326 | 27 | property alias coverSources: coverGrid.covers | ||
3327 | 28 | property alias primaryText: primaryLabel.text | ||
3328 | 29 | property alias secondaryText: secondaryLabel.text | ||
3329 | 30 | property alias secondaryTextVisible: secondaryLabel.visible | ||
3330 | 31 | |||
3331 | 32 | signal clicked(var mouse) | ||
3332 | 33 | signal pressAndHold(var mouse) | ||
3333 | 34 | |||
3334 | 35 | /* Animations */ | ||
3335 | 36 | Behavior on height { | ||
3336 | 37 | UbuntuNumberAnimation { | ||
3337 | 38 | |||
3338 | 39 | } | ||
3339 | 40 | } | ||
3340 | 41 | |||
3341 | 42 | Behavior on width { | ||
3342 | 43 | UbuntuNumberAnimation { | ||
3343 | 44 | |||
3344 | 45 | } | ||
3345 | 46 | } | ||
3346 | 47 | |||
3347 | 48 | Behavior on x { | ||
3348 | 49 | UbuntuNumberAnimation { | ||
3349 | 50 | |||
3350 | 51 | } | ||
3351 | 52 | } | ||
3352 | 53 | |||
3353 | 54 | Behavior on y { | ||
3354 | 55 | UbuntuNumberAnimation { | ||
3355 | 56 | |||
3356 | 57 | } | ||
3357 | 58 | } | ||
3358 | 59 | |||
3359 | 60 | /* Background for card */ | ||
3360 | 61 | Rectangle { | ||
3361 | 62 | id: bg | ||
3362 | 63 | anchors { | ||
3363 | 64 | fill: parent | ||
3364 | 65 | margins: units.gu(1) | ||
3365 | 66 | } | ||
3366 | 67 | color: "#2c2c34" | ||
3367 | 68 | } | ||
3368 | 69 | |||
3369 | 70 | /* Column containing image and labels */ | ||
3370 | 71 | Column { | ||
3371 | 72 | id: cardColumn | ||
3372 | 73 | anchors { | ||
3373 | 74 | fill: bg | ||
3374 | 75 | } | ||
3375 | 76 | spacing: units.gu(0.5) | ||
3376 | 77 | |||
3377 | 78 | CoverGrid { | ||
3378 | 79 | id: coverGrid | ||
3379 | 80 | size: parent.width | ||
3380 | 81 | } | ||
3381 | 82 | |||
3382 | 83 | Rectangle { | ||
3383 | 84 | color: "transparent" | ||
3384 | 85 | height: units.gu(1) | ||
3385 | 86 | width: units.gu(1) | ||
3386 | 87 | } | ||
3387 | 88 | |||
3388 | 89 | Label { | ||
3389 | 90 | id: primaryLabel | ||
3390 | 91 | anchors { | ||
3391 | 92 | left: parent.left | ||
3392 | 93 | leftMargin: units.gu(1) | ||
3393 | 94 | right: parent.right | ||
3394 | 95 | rightMargin: units.gu(1) | ||
3395 | 96 | } | ||
3396 | 97 | color: "#FFF" | ||
3397 | 98 | elide: Text.ElideRight | ||
3398 | 99 | fontSize: "small" | ||
3399 | 100 | opacity: 1.0 | ||
3400 | 101 | wrapMode: Text.WordWrap | ||
3401 | 102 | } | ||
3402 | 103 | |||
3403 | 104 | Label { | ||
3404 | 105 | id: secondaryLabel | ||
3405 | 106 | anchors { | ||
3406 | 107 | left: parent.left | ||
3407 | 108 | leftMargin: units.gu(1) | ||
3408 | 109 | right: parent.right | ||
3409 | 110 | rightMargin: units.gu(1) | ||
3410 | 111 | } | ||
3411 | 112 | color: "#FFF" | ||
3412 | 113 | elide: Text.ElideRight | ||
3413 | 114 | fontSize: "small" | ||
3414 | 115 | opacity: 0.4 | ||
3415 | 116 | wrapMode: Text.WordWrap | ||
3416 | 117 | } | ||
3417 | 118 | |||
3418 | 119 | Rectangle { | ||
3419 | 120 | color: "transparent" | ||
3420 | 121 | height: units.gu(1.5) | ||
3421 | 122 | width: units.gu(1) | ||
3422 | 123 | } | ||
3423 | 124 | } | ||
3424 | 125 | |||
3425 | 126 | /* Overlay for when card is pressed */ | ||
3426 | 127 | Rectangle { | ||
3427 | 128 | id: overlay | ||
3428 | 129 | anchors { | ||
3429 | 130 | fill: bg | ||
3430 | 131 | } | ||
3431 | 132 | color: "#000" | ||
3432 | 133 | opacity: 0 | ||
3433 | 134 | |||
3434 | 135 | Behavior on opacity { | ||
3435 | 136 | UbuntuNumberAnimation { | ||
3436 | 137 | |||
3437 | 138 | } | ||
3438 | 139 | } | ||
3439 | 140 | } | ||
3440 | 141 | |||
3441 | 142 | /* Capture mouse events */ | ||
3442 | 143 | MouseArea { | ||
3443 | 144 | anchors { | ||
3444 | 145 | fill: parent | ||
3445 | 146 | } | ||
3446 | 147 | onClicked: card.clicked(mouse) | ||
3447 | 148 | onPressAndHold: card.pressAndHold(mouse) | ||
3448 | 149 | onPressedChanged: overlay.opacity = pressed ? 0.3 : 0 | ||
3449 | 150 | } | ||
3450 | 151 | } | ||
3451 | 0 | 152 | ||
3452 | === added file 'common/CardView.qml' | |||
3453 | --- common/CardView.qml 1970-01-01 00:00:00 +0000 | |||
3454 | +++ common/CardView.qml 2014-10-21 15:31:33 +0000 | |||
3455 | @@ -0,0 +1,61 @@ | |||
3456 | 1 | /* | ||
3457 | 2 | * Copyright (C) 2014 | ||
3458 | 3 | * Andrew Hayzen <ahayzen@gmail.com> | ||
3459 | 4 | * | ||
3460 | 5 | * This program is free software; you can redistribute it and/or modify | ||
3461 | 6 | * it under the terms of the GNU General Public License as published by | ||
3462 | 7 | * the Free Software Foundation; version 3. | ||
3463 | 8 | * | ||
3464 | 9 | * This program is distributed in the hope that it will be useful, | ||
3465 | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
3466 | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
3467 | 12 | * GNU General Public License for more details. | ||
3468 | 13 | * | ||
3469 | 14 | * You should have received a copy of the GNU General Public License | ||
3470 | 15 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
3471 | 16 | */ | ||
3472 | 17 | |||
3473 | 18 | import QtQuick 2.3 | ||
3474 | 19 | import Ubuntu.Components 1.1 | ||
3475 | 20 | |||
3476 | 21 | |||
3477 | 22 | Flickable { | ||
3478 | 23 | anchors { | ||
3479 | 24 | fill: parent | ||
3480 | 25 | } | ||
3481 | 26 | |||
3482 | 27 | // dont use flow.contentHeight as it is inaccurate due to height of labels | ||
3483 | 28 | // changing as they load | ||
3484 | 29 | contentHeight: headerLoader.childrenRect.height + flowContainer.height | ||
3485 | 30 | contentWidth: width | ||
3486 | 31 | |||
3487 | 32 | property alias count: flow.count | ||
3488 | 33 | property alias delegate: flow.delegate | ||
3489 | 34 | property alias header: headerLoader.sourceComponent | ||
3490 | 35 | property alias model: flow.model | ||
3491 | 36 | property real itemWidth: units.gu(15) | ||
3492 | 37 | |||
3493 | 38 | Loader { | ||
3494 | 39 | id: headerLoader | ||
3495 | 40 | width: parent.width | ||
3496 | 41 | } | ||
3497 | 42 | |||
3498 | 43 | Item { | ||
3499 | 44 | id: flowContainer | ||
3500 | 45 | anchors { | ||
3501 | 46 | top: headerLoader.bottom | ||
3502 | 47 | } | ||
3503 | 48 | height: flow.childrenRect.height + flow.anchors.margins * 2 | ||
3504 | 49 | width: parent.width | ||
3505 | 50 | |||
3506 | 51 | ColumnFlow { | ||
3507 | 52 | id: flow | ||
3508 | 53 | anchors { | ||
3509 | 54 | fill: parent | ||
3510 | 55 | margins: units.gu(1) | ||
3511 | 56 | } | ||
3512 | 57 | |||
3513 | 58 | columns: parseInt(width / itemWidth) | ||
3514 | 59 | } | ||
3515 | 60 | } | ||
3516 | 61 | } | ||
3517 | 0 | 62 | ||
3518 | === added file 'common/ColumnFlow.qml' | |||
3519 | --- common/ColumnFlow.qml 1970-01-01 00:00:00 +0000 | |||
3520 | +++ common/ColumnFlow.qml 2014-10-21 15:31:33 +0000 | |||
3521 | @@ -0,0 +1,160 @@ | |||
3522 | 1 | /* | ||
3523 | 2 | * Copyright (C) 2014 | ||
3524 | 3 | * Andrew Hayzen <ahayzen@gmail.com> | ||
3525 | 4 | * Michael Spencer <sonrisesoftware@gmail.com> | ||
3526 | 5 | * | ||
3527 | 6 | * This program is free software; you can redistribute it and/or modify | ||
3528 | 7 | * it under the terms of the GNU General Public License as published by | ||
3529 | 8 | * the Free Software Foundation; version 3. | ||
3530 | 9 | * | ||
3531 | 10 | * This program is distributed in the hope that it will be useful, | ||
3532 | 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
3533 | 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
3534 | 13 | * GNU General Public License for more details. | ||
3535 | 14 | * | ||
3536 | 15 | * You should have received a copy of the GNU General Public License | ||
3537 | 16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
3538 | 17 | * | ||
3539 | 18 | * Upstream location: | ||
3540 | 19 | * https://github.com/iBeliever/ubuntu-ui-extras/blob/master/ColumnFlow.qml | ||
3541 | 20 | */ | ||
3542 | 21 | |||
3543 | 22 | import QtQuick 2.3 | ||
3544 | 23 | |||
3545 | 24 | |||
3546 | 25 | Item { | ||
3547 | 26 | id: columnFlow | ||
3548 | 27 | property int columns: 1 | ||
3549 | 28 | property bool repeaterCompleted: false | ||
3550 | 29 | property alias count: repeater.count | ||
3551 | 30 | property alias model: repeater.model | ||
3552 | 31 | property alias delegate: repeater.delegate | ||
3553 | 32 | property int contentHeight: 0 | ||
3554 | 33 | |||
3555 | 34 | onColumnsChanged: reEvalColumns() | ||
3556 | 35 | onModelChanged: reEvalColumns() | ||
3557 | 36 | onWidthChanged: updateWidths() | ||
3558 | 37 | |||
3559 | 38 | function updateWidths() { | ||
3560 | 39 | if (repeaterCompleted) { | ||
3561 | 40 | var count = 0 | ||
3562 | 41 | |||
3563 | 42 | //add the first <column> elements | ||
3564 | 43 | for (var i = 0; count < columns && i < columnFlow.children.length; i++) { | ||
3565 | 44 | //print(i, count) | ||
3566 | 45 | if (!columnFlow.children[i] || String(columnFlow.children[i]).indexOf("QQuickRepeater") == 0) | ||
3567 | 46 | //|| !columnFlow.children[i].visible) // CUSTOM - view is invisible at start | ||
3568 | 47 | continue | ||
3569 | 48 | |||
3570 | 49 | columnFlow.children[i].width = width / columns | ||
3571 | 50 | |||
3572 | 51 | count++ | ||
3573 | 52 | } | ||
3574 | 53 | } | ||
3575 | 54 | } | ||
3576 | 55 | |||
3577 | 56 | function reEvalColumns() { | ||
3578 | 57 | if (columnFlow.repeaterCompleted === false) | ||
3579 | 58 | return | ||
3580 | 59 | |||
3581 | 60 | if (columns === 0) { | ||
3582 | 61 | contentHeight = 0 | ||
3583 | 62 | return | ||
3584 | 63 | } | ||
3585 | 64 | |||
3586 | 65 | var i, j | ||
3587 | 66 | var columnHeights = new Array(columns); | ||
3588 | 67 | var lastItem = new Array(columns) | ||
3589 | 68 | var lastI = -1 | ||
3590 | 69 | var count = 0 | ||
3591 | 70 | |||
3592 | 71 | //add the first <column> elements | ||
3593 | 72 | for (i = 0; count < columns && i < columnFlow.children.length; i++) { | ||
3594 | 73 | // CUSTOM - ignore if has just been removed | ||
3595 | 74 | if (i === repeater.removeHintIndex && columnFlow.children[i] === repeater.removeHintItem) { | ||
3596 | 75 | continue | ||
3597 | 76 | } | ||
3598 | 77 | |||
3599 | 78 | if (!columnFlow.children[i] || String(columnFlow.children[i]).indexOf("QQuickRepeater") == 0) | ||
3600 | 79 | //|| !columnFlow.children[i].visible) // CUSTOM - view is invisible at start | ||
3601 | 80 | continue | ||
3602 | 81 | |||
3603 | 82 | lastItem[count] = i | ||
3604 | 83 | |||
3605 | 84 | columnHeights[count] = columnFlow.children[i].height | ||
3606 | 85 | columnFlow.children[i].anchors.top = columnFlow.top | ||
3607 | 86 | columnFlow.children[i].anchors.left = (lastI === -1 ? columnFlow.left : columnFlow.children[lastI].right) | ||
3608 | 87 | columnFlow.children[i].anchors.right = undefined | ||
3609 | 88 | columnFlow.children[i].width = columnFlow.width / columns | ||
3610 | 89 | |||
3611 | 90 | lastI = i | ||
3612 | 91 | count++ | ||
3613 | 92 | } | ||
3614 | 93 | |||
3615 | 94 | //add the other elements | ||
3616 | 95 | for (i = i; i < columnFlow.children.length; i++) { | ||
3617 | 96 | var highestHeight = Number.MAX_VALUE | ||
3618 | 97 | var newColumn = 0 | ||
3619 | 98 | |||
3620 | 99 | // CUSTOM - ignore if has just been removed | ||
3621 | 100 | if (i === repeater.removeHintIndex && columnFlow.children[i] === repeater.removeHintItem) { | ||
3622 | 101 | continue | ||
3623 | 102 | } | ||
3624 | 103 | |||
3625 | 104 | if (!columnFlow.children[i] || String(columnFlow.children[i]).indexOf("QQuickRepeater") == 0) | ||
3626 | 105 | //|| !columnFlow.children[i].visible) // CUSTOM - view is invisible at start | ||
3627 | 106 | continue | ||
3628 | 107 | |||
3629 | 108 | // find the shortest column | ||
3630 | 109 | for (j = 0; j < columns; j++) { | ||
3631 | 110 | if (columnHeights[j] !== null && columnHeights[j] < highestHeight) { | ||
3632 | 111 | newColumn = j | ||
3633 | 112 | highestHeight = columnHeights[j] | ||
3634 | 113 | } | ||
3635 | 114 | } | ||
3636 | 115 | |||
3637 | 116 | // add the element to the shortest column | ||
3638 | 117 | columnFlow.children[i].anchors.top = columnFlow.children[lastItem[newColumn]].bottom | ||
3639 | 118 | columnFlow.children[i].anchors.left = columnFlow.children[lastItem[newColumn]].left | ||
3640 | 119 | columnFlow.children[i].anchors.right = columnFlow.children[lastItem[newColumn]].right | ||
3641 | 120 | |||
3642 | 121 | lastItem[newColumn] = i | ||
3643 | 122 | columnHeights[newColumn] += columnFlow.children[i].height | ||
3644 | 123 | } | ||
3645 | 124 | |||
3646 | 125 | var cHeight = 0 | ||
3647 | 126 | |||
3648 | 127 | for (i = 0; i < columnHeights.length; i++) { | ||
3649 | 128 | if (columnHeights[i]) | ||
3650 | 129 | cHeight = Math.max(cHeight, columnHeights[i]) | ||
3651 | 130 | } | ||
3652 | 131 | |||
3653 | 132 | contentHeight = cHeight | ||
3654 | 133 | updateWidths() | ||
3655 | 134 | } | ||
3656 | 135 | |||
3657 | 136 | Repeater { | ||
3658 | 137 | id: repeater | ||
3659 | 138 | model: columnFlow.model | ||
3660 | 139 | Component.onCompleted: { | ||
3661 | 140 | columnFlow.repeaterCompleted = true | ||
3662 | 141 | columnFlow.reEvalColumns() | ||
3663 | 142 | } | ||
3664 | 143 | |||
3665 | 144 | // Provide a hint of the removed item | ||
3666 | 145 | property int removeHintIndex: -1 // CUSTOM | ||
3667 | 146 | property var removeHintItem // CUSTOM | ||
3668 | 147 | |||
3669 | 148 | onItemAdded: columnFlow.reEvalColumns() // CUSTOM - ms2 models are live | ||
3670 | 149 | onItemRemoved: { | ||
3671 | 150 | removeHintIndex = index | ||
3672 | 151 | removeHintItem = item | ||
3673 | 152 | |||
3674 | 153 | columnFlow.reEvalColumns() // CUSTOM - ms2 models are live | ||
3675 | 154 | |||
3676 | 155 | // Set back to null to allow freeing of memory | ||
3677 | 156 | removeHintIndex = -1 | ||
3678 | 157 | removeHintItem = undefined | ||
3679 | 158 | } | ||
3680 | 159 | } | ||
3681 | 160 | } | ||
3682 | 0 | 161 | ||
3683 | === added file 'common/CoverGrid.qml' | |||
3684 | --- common/CoverGrid.qml 1970-01-01 00:00:00 +0000 | |||
3685 | +++ common/CoverGrid.qml 2014-10-21 15:31:33 +0000 | |||
3686 | @@ -0,0 +1,78 @@ | |||
3687 | 1 | /* | ||
3688 | 2 | * Copyright (C) 2013, 2014 | ||
3689 | 3 | * Andrew Hayzen <ahayzen@gmail.com> | ||
3690 | 4 | * Nekhelesh Ramananthan <krnekhelesh@gmail.com> | ||
3691 | 5 | * Victor Thompson <victor.thompson@gmail.com> | ||
3692 | 6 | * | ||
3693 | 7 | * This program is free software; you can redistribute it and/or modify | ||
3694 | 8 | * it under the terms of the GNU General Public License as published by | ||
3695 | 9 | * the Free Software Foundation; version 3. | ||
3696 | 10 | * | ||
3697 | 11 | * This program is distributed in the hope that it will be useful, | ||
3698 | 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
3699 | 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
3700 | 14 | * GNU General Public License for more details. | ||
3701 | 15 | * | ||
3702 | 16 | * You should have received a copy of the GNU General Public License | ||
3703 | 17 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
3704 | 18 | */ | ||
3705 | 19 | |||
3706 | 20 | import QtQuick 2.3 | ||
3707 | 21 | import Ubuntu.Components 1.1 | ||
3708 | 22 | |||
3709 | 23 | Rectangle { | ||
3710 | 24 | id: coverGrid | ||
3711 | 25 | color: "transparent" | ||
3712 | 26 | height: size | ||
3713 | 27 | width: size | ||
3714 | 28 | |||
3715 | 29 | // Property (array) to store the cover images | ||
3716 | 30 | property var covers | ||
3717 | 31 | |||
3718 | 32 | // Property to set the size of the cover image | ||
3719 | 33 | property int size | ||
3720 | 34 | |||
3721 | 35 | property string firstSource | ||
3722 | 36 | |||
3723 | 37 | onCoversChanged: { | ||
3724 | 38 | if (covers !== undefined) { | ||
3725 | 39 | while (covers.length > 4) { // remove any covers after 4 | ||
3726 | 40 | covers.pop() | ||
3727 | 41 | } | ||
3728 | 42 | } | ||
3729 | 43 | } | ||
3730 | 44 | |||
3731 | 45 | // Flow of the cover arts in either 1, 1x1, 2x1, 2x2 | ||
3732 | 46 | Flow { | ||
3733 | 47 | id: imageRow | ||
3734 | 48 | anchors { | ||
3735 | 49 | fill: parent | ||
3736 | 50 | } | ||
3737 | 51 | |||
3738 | 52 | Repeater { | ||
3739 | 53 | id: repeat | ||
3740 | 54 | model: coverGrid.covers.length === 0 ? 1 : coverGrid.covers.length | ||
3741 | 55 | delegate: Image { | ||
3742 | 56 | fillMode: Image.PreserveAspectCrop | ||
3743 | 57 | height: coverGrid.size / (coverGrid.covers.length > 1 ? 2 : 1) | ||
3744 | 58 | width: coverGrid.size / (coverGrid.covers.length > 2 && !(coverGrid.covers.length === 3 && index === 2) ? 2 : 1) | ||
3745 | 59 | source: coverGrid.covers.length !== 0 && coverGrid.covers[index] !== "" && coverGrid.covers[index] !== undefined | ||
3746 | 60 | ? (coverGrid.covers[index].art !== undefined | ||
3747 | 61 | ? coverGrid.covers[index].art | ||
3748 | 62 | : "image://albumart/artist=" + coverGrid.covers[index].author + "&album=" + coverGrid.covers[index].album) | ||
3749 | 63 | : undefined | ||
3750 | 64 | sourceSize.height: height | ||
3751 | 65 | sourceSize.width: width | ||
3752 | 66 | |||
3753 | 67 | onStatusChanged: { | ||
3754 | 68 | if (status === Image.Error) { | ||
3755 | 69 | source = Qt.resolvedUrl("../images/music-app-cover@30.png") | ||
3756 | 70 | } else if (status === Image.Ready && index === 0) { | ||
3757 | 71 | firstSource = source | ||
3758 | 72 | } | ||
3759 | 73 | } | ||
3760 | 74 | } | ||
3761 | 75 | } | ||
3762 | 76 | } | ||
3763 | 77 | } | ||
3764 | 78 | |||
3765 | 0 | 79 | ||
3766 | === modified file 'common/CoverRow.qml' | |||
3767 | --- common/CoverRow.qml 2014-09-20 15:41:33 +0000 | |||
3768 | +++ common/CoverRow.qml 2014-10-21 15:31:33 +0000 | |||
3769 | @@ -63,6 +63,8 @@ | |||
3770 | 63 | ? coverRow.covers[index].art | 63 | ? coverRow.covers[index].art |
3771 | 64 | : "image://albumart/artist=" + coverRow.covers[index].author + "&album=" + coverRow.covers[index].album) | 64 | : "image://albumart/artist=" + coverRow.covers[index].author + "&album=" + coverRow.covers[index].album) |
3772 | 65 | : Qt.resolvedUrl("../images/music-app-cover@30.png") | 65 | : Qt.resolvedUrl("../images/music-app-cover@30.png") |
3773 | 66 | sourceSize.height: height | ||
3774 | 67 | sourceSize.width: width | ||
3775 | 66 | onStatusChanged: { | 68 | onStatusChanged: { |
3776 | 67 | if (status === Image.Error) { | 69 | if (status === Image.Error) { |
3777 | 68 | source = Qt.resolvedUrl("../images/music-app-cover@30.png") | 70 | source = Qt.resolvedUrl("../images/music-app-cover@30.png") |
3778 | 69 | 71 | ||
3779 | === removed file 'common/ListItemActions/DeletePlaylist.qml' | |||
3780 | --- common/ListItemActions/DeletePlaylist.qml 2014-09-20 10:50:45 +0000 | |||
3781 | +++ common/ListItemActions/DeletePlaylist.qml 1970-01-01 00:00:00 +0000 | |||
3782 | @@ -1,29 +0,0 @@ | |||
3783 | 1 | /* | ||
3784 | 2 | * Copyright (C) 2014 Andrew Hayzen <ahayzen@gmail.com> | ||
3785 | 3 | * Daniel Holm <d.holmen@gmail.com> | ||
3786 | 4 | * Victor Thompson <victor.thompson@gmail.com> | ||
3787 | 5 | * | ||
3788 | 6 | * This program is free software; you can redistribute it and/or modify | ||
3789 | 7 | * it under the terms of the GNU General Public License as published by | ||
3790 | 8 | * the Free Software Foundation; version 3. | ||
3791 | 9 | * | ||
3792 | 10 | * This program is distributed in the hope that it will be useful, | ||
3793 | 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
3794 | 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
3795 | 13 | * GNU General Public License for more details. | ||
3796 | 14 | * | ||
3797 | 15 | * You should have received a copy of the GNU General Public License | ||
3798 | 16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
3799 | 17 | */ | ||
3800 | 18 | |||
3801 | 19 | import QtQuick 2.3 | ||
3802 | 20 | import Ubuntu.Components 1.1 | ||
3803 | 21 | import Ubuntu.Components.Popups 1.0 | ||
3804 | 22 | |||
3805 | 23 | Action { | ||
3806 | 24 | iconName: "delete" | ||
3807 | 25 | // TRANSLATORS: this refers to deleting a playlist | ||
3808 | 26 | text: i18n.tr("Delete") | ||
3809 | 27 | |||
3810 | 28 | property bool primed: false | ||
3811 | 29 | } | ||
3812 | 30 | 0 | ||
3813 | === removed file 'common/ListItemActions/EditPlaylist.qml' | |||
3814 | --- common/ListItemActions/EditPlaylist.qml 2014-09-20 10:50:45 +0000 | |||
3815 | +++ common/ListItemActions/EditPlaylist.qml 1970-01-01 00:00:00 +0000 | |||
3816 | @@ -1,35 +0,0 @@ | |||
3817 | 1 | /* | ||
3818 | 2 | * Copyright (C) 2014 Andrew Hayzen <ahayzen@gmail.com> | ||
3819 | 3 | * Daniel Holm <d.holmen@gmail.com> | ||
3820 | 4 | * Victor Thompson <victor.thompson@gmail.com> | ||
3821 | 5 | * | ||
3822 | 6 | * This program is free software; you can redistribute it and/or modify | ||
3823 | 7 | * it under the terms of the GNU General Public License as published by | ||
3824 | 8 | * the Free Software Foundation; version 3. | ||
3825 | 9 | * | ||
3826 | 10 | * This program is distributed in the hope that it will be useful, | ||
3827 | 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
3828 | 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
3829 | 13 | * GNU General Public License for more details. | ||
3830 | 14 | * | ||
3831 | 15 | * You should have received a copy of the GNU General Public License | ||
3832 | 16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
3833 | 17 | */ | ||
3834 | 18 | |||
3835 | 19 | import QtQuick 2.3 | ||
3836 | 20 | import Ubuntu.Components 1.1 | ||
3837 | 21 | import Ubuntu.Components.Popups 1.0 | ||
3838 | 22 | |||
3839 | 23 | Action { | ||
3840 | 24 | iconName: "edit" | ||
3841 | 25 | // TRANSLATORS: this refers to editing a playlist | ||
3842 | 26 | text: i18n.tr("Edit") | ||
3843 | 27 | |||
3844 | 28 | property bool primed: false | ||
3845 | 29 | |||
3846 | 30 | onTriggered: { | ||
3847 | 31 | customdebug("Edit playlist") | ||
3848 | 32 | oldPlaylistName = model.name | ||
3849 | 33 | PopupUtils.open(editPlaylistDialog, mainView) | ||
3850 | 34 | } | ||
3851 | 35 | } | ||
3852 | 36 | 0 | ||
3853 | === modified file 'common/MusicPage.qml' | |||
3854 | --- common/MusicPage.qml 2014-08-20 17:35:52 +0000 | |||
3855 | +++ common/MusicPage.qml 2014-10-21 15:31:33 +0000 | |||
3856 | @@ -23,6 +23,10 @@ | |||
3857 | 23 | // generic page for music, could be useful for bottomedge implementation | 23 | // generic page for music, could be useful for bottomedge implementation |
3858 | 24 | Page { | 24 | Page { |
3859 | 25 | id: thisPage | 25 | id: thisPage |
3860 | 26 | anchors { | ||
3861 | 27 | bottomMargin: musicToolbar.visible ? musicToolbar.currentHeight : 0 | ||
3862 | 28 | fill: parent | ||
3863 | 29 | } | ||
3864 | 26 | 30 | ||
3865 | 27 | onVisibleChanged: { | 31 | onVisibleChanged: { |
3866 | 28 | if (visible) { | 32 | if (visible) { |
3867 | 29 | 33 | ||
3868 | === modified file 'common/MusicRow.qml' | |||
3869 | --- common/MusicRow.qml 2014-09-20 10:50:45 +0000 | |||
3870 | +++ common/MusicRow.qml 2014-10-21 15:31:33 +0000 | |||
3871 | @@ -24,35 +24,54 @@ | |||
3872 | 24 | Row { | 24 | Row { |
3873 | 25 | anchors { | 25 | anchors { |
3874 | 26 | left: parent.left | 26 | left: parent.left |
3876 | 27 | leftMargin: units.gu(1) | 27 | leftMargin: units.gu(2) |
3877 | 28 | right: parent.right | 28 | right: parent.right |
3879 | 29 | rightMargin: units.gu(1) | 29 | rightMargin: units.gu(2) |
3880 | 30 | } | 30 | } |
3881 | 31 | 31 | ||
3882 | 32 | property alias covers: coverRow.covers | 32 | property alias covers: coverRow.covers |
3883 | 33 | property bool showCovers: true | ||
3884 | 34 | property bool isSquare: false | ||
3885 | 33 | property alias pressed: coverRow.pressed | 35 | property alias pressed: coverRow.pressed |
3886 | 34 | property alias column: columnComponent.sourceComponent | 36 | property alias column: columnComponent.sourceComponent |
3887 | 37 | property real coverSize: styleMusic.common.albumSize | ||
3888 | 35 | 38 | ||
3889 | 36 | spacing: units.gu(1) | 39 | spacing: units.gu(1) |
3890 | 37 | 40 | ||
3891 | 38 | CoverRow { | 41 | CoverRow { |
3892 | 39 | id: coverRow | 42 | id: coverRow |
3893 | 43 | visible: showCovers && !isSquare | ||
3894 | 40 | anchors { | 44 | anchors { |
3895 | 41 | top: parent.top | 45 | top: parent.top |
3896 | 42 | topMargin: units.gu(1) | 46 | topMargin: units.gu(1) |
3897 | 43 | } | 47 | } |
3898 | 44 | count: covers.length | 48 | count: covers.length |
3899 | 45 | covers: [] | 49 | covers: [] |
3901 | 46 | size: styleMusic.common.albumSize | 50 | size: coverSize |
3902 | 51 | } | ||
3903 | 52 | |||
3904 | 53 | CoverGrid { | ||
3905 | 54 | id: coverSquare | ||
3906 | 55 | anchors { | ||
3907 | 56 | verticalCenter: parent.verticalCenter | ||
3908 | 57 | topMargin: units.gu(0.5) | ||
3909 | 58 | bottomMargin: units.gu(0.5) | ||
3910 | 59 | leftMargin: units.gu(2) | ||
3911 | 60 | } | ||
3912 | 61 | covers: coverRow.covers | ||
3913 | 62 | size: coverSize | ||
3914 | 63 | visible: showCovers && isSquare | ||
3915 | 47 | } | 64 | } |
3916 | 48 | 65 | ||
3917 | 49 | Loader { | 66 | Loader { |
3918 | 50 | id: columnComponent | 67 | id: columnComponent |
3919 | 51 | anchors { | 68 | anchors { |
3920 | 52 | top: parent.top | 69 | top: parent.top |
3922 | 53 | topMargin: units.gu(2) | 70 | topMargin: units.gu(1) |
3923 | 54 | } | 71 | } |
3925 | 55 | width: parent.width - coverRow.width - parent.spacing | 72 | width: !showCovers ? parent.width - parent.spacing |
3926 | 73 | : (isSquare ? parent.width - coverSquare.width - parent.spacing | ||
3927 | 74 | : parent.width - coverRow.width - parent.spacing) | ||
3928 | 56 | 75 | ||
3929 | 57 | onSourceComponentChanged: { | 76 | onSourceComponentChanged: { |
3930 | 58 | for (var i=0; i < item.children.length; i++) { | 77 | for (var i=0; i < item.children.length; i++) { |
3931 | 59 | 78 | ||
3932 | === modified file 'common/SongsPage.qml' | |||
3933 | --- common/SongsPage.qml 2014-09-20 15:41:33 +0000 | |||
3934 | +++ common/SongsPage.qml 2014-10-21 15:31:33 +0000 | |||
3935 | @@ -20,6 +20,7 @@ | |||
3936 | 20 | import QtQuick 2.3 | 20 | import QtQuick 2.3 |
3937 | 21 | import Ubuntu.Components 1.1 | 21 | import Ubuntu.Components 1.1 |
3938 | 22 | import Ubuntu.Components.ListItems 1.0 as ListItem | 22 | import Ubuntu.Components.ListItems 1.0 as ListItem |
3939 | 23 | import Ubuntu.Components.Popups 1.0 | ||
3940 | 23 | import Ubuntu.MediaScanner 0.1 | 24 | import Ubuntu.MediaScanner 0.1 |
3941 | 24 | import Ubuntu.Thumbnailer 0.1 | 25 | import Ubuntu.Thumbnailer 0.1 |
3942 | 25 | import QtQuick.LocalStorage 2.0 | 26 | import QtQuick.LocalStorage 2.0 |
3943 | @@ -29,7 +30,6 @@ | |||
3944 | 29 | 30 | ||
3945 | 30 | MusicPage { | 31 | MusicPage { |
3946 | 31 | id: songStackPage | 32 | id: songStackPage |
3947 | 32 | anchors.bottomMargin: units.gu(.5) | ||
3948 | 33 | objectName: "songsPage" | 33 | objectName: "songsPage" |
3949 | 34 | visible: false | 34 | visible: false |
3950 | 35 | 35 | ||
3951 | @@ -44,6 +44,47 @@ | |||
3952 | 44 | property alias album: songsModel.album | 44 | property alias album: songsModel.album |
3953 | 45 | property alias genre: songsModel.genre | 45 | property alias genre: songsModel.genre |
3954 | 46 | 46 | ||
3955 | 47 | state: songStackPage.line1 === i18n.tr("Playlist") ? "playlist" : "album" | ||
3956 | 48 | states: [ | ||
3957 | 49 | PageHeadState { | ||
3958 | 50 | id: albumState | ||
3959 | 51 | name: "album" | ||
3960 | 52 | PropertyChanges { | ||
3961 | 53 | target: songStackPage.head | ||
3962 | 54 | backAction: albumState.backAction | ||
3963 | 55 | actions: albumState.actions | ||
3964 | 56 | } | ||
3965 | 57 | }, | ||
3966 | 58 | PageHeadState { | ||
3967 | 59 | id: playlistState | ||
3968 | 60 | |||
3969 | 61 | name: "playlist" | ||
3970 | 62 | actions: [ | ||
3971 | 63 | Action { | ||
3972 | 64 | objectName: "editPlaylist" | ||
3973 | 65 | iconName: "edit" | ||
3974 | 66 | onTriggered: { | ||
3975 | 67 | var dialog = PopupUtils.open(editPlaylistDialog, mainView) | ||
3976 | 68 | dialog.oldPlaylistName = line2 | ||
3977 | 69 | } | ||
3978 | 70 | }, | ||
3979 | 71 | Action { | ||
3980 | 72 | objectName: "deletePlaylist" | ||
3981 | 73 | iconName: "delete" | ||
3982 | 74 | onTriggered: { | ||
3983 | 75 | var dialog = PopupUtils.open(removePlaylistDialog, mainView) | ||
3984 | 76 | dialog.oldPlaylistName = line2 | ||
3985 | 77 | } | ||
3986 | 78 | } | ||
3987 | 79 | ] | ||
3988 | 80 | PropertyChanges { | ||
3989 | 81 | target: songStackPage.head | ||
3990 | 82 | backAction: playlistState.backAction | ||
3991 | 83 | actions: playlistState.actions | ||
3992 | 84 | } | ||
3993 | 85 | } | ||
3994 | 86 | ] | ||
3995 | 87 | |||
3996 | 47 | SongsModel { | 88 | SongsModel { |
3997 | 48 | id: songsModel | 89 | id: songsModel |
3998 | 49 | store: musicStore | 90 | store: musicStore |
3999 | @@ -52,160 +93,141 @@ | |||
4000 | 52 | ListView { | 93 | ListView { |
4001 | 53 | id: albumtrackslist | 94 | id: albumtrackslist |
4002 | 54 | anchors { | 95 | anchors { |
4003 | 55 | bottomMargin: wideAspect ? musicToolbar.fullHeight : musicToolbar.mouseAreaOffset + musicToolbar.minimizedHeight | ||
4004 | 56 | fill: parent | 96 | fill: parent |
4005 | 57 | } | 97 | } |
4006 | 58 | delegate: albumTracksDelegate | 98 | delegate: albumTracksDelegate |
4007 | 59 | model: isAlbum ? songsModel : albumTracksModel.model | 99 | model: isAlbum ? songsModel : albumTracksModel.model |
4008 | 60 | objectName: "songspage-listview" | 100 | objectName: "songspage-listview" |
4009 | 61 | width: parent.width | 101 | width: parent.width |
4024 | 62 | header: ListItem.Standard { | 102 | header: BlurredHeader { |
4025 | 63 | id: albumInfo | 103 | rightColumn: Column { |
4012 | 64 | height: units.gu(22) | ||
4013 | 65 | |||
4014 | 66 | CoverRow { | ||
4015 | 67 | id: albumImage | ||
4016 | 68 | anchors { | ||
4017 | 69 | top: parent.top | ||
4018 | 70 | left: parent.left | ||
4019 | 71 | margins: units.gu(1) | ||
4020 | 72 | } | ||
4021 | 73 | count: songStackPage.covers.length | ||
4022 | 74 | size: units.gu(20) | ||
4023 | 75 | covers: songStackPage.covers | ||
4026 | 76 | spacing: units.gu(2) | 104 | spacing: units.gu(2) |
4103 | 77 | } | 105 | Button { |
4104 | 78 | 106 | id: shuffleRow | |
4105 | 79 | Label { | 107 | height: units.gu(4) |
4106 | 80 | id: albumArtist | 108 | strokeColor: UbuntuColors.green |
4107 | 81 | objectName: "songsPageHeaderAlbumArtist" | 109 | width: units.gu(15) |
4108 | 82 | wrapMode: Text.NoWrap | 110 | Text { |
4109 | 83 | maximumLineCount: 1 | 111 | anchors { |
4110 | 84 | fontSize: "small" | 112 | centerIn: parent |
4111 | 85 | color: styleMusic.common.subtitle | 113 | } |
4112 | 86 | anchors.left: albumImage.right | 114 | color: "white" |
4113 | 87 | anchors.leftMargin: units.gu(1) | 115 | text: i18n.tr("Shuffle") |
4114 | 88 | anchors.top: parent.top | 116 | } |
4115 | 89 | anchors.topMargin: units.gu(1.5) | 117 | MouseArea { |
4116 | 90 | anchors.right: parent.right | 118 | anchors.fill: parent |
4117 | 91 | anchors.rightMargin: units.gu(1.5) | 119 | onClicked: { |
4118 | 92 | elide: Text.ElideRight | 120 | shuffleModel(albumtrackslist.model) // play track |
4119 | 93 | text: line1 | 121 | |
4120 | 94 | } | 122 | if (isAlbum && songStackPage.line1 !== i18n.tr("Genre")) { |
4121 | 95 | Label { | 123 | Library.addRecent(songStackPage.line2, songStackPage.line1, songStackPage.covers[0], songStackPage.line2, "album") |
4122 | 96 | id: albumLabel | 124 | recentModel.filterRecent() |
4123 | 97 | wrapMode: Text.NoWrap | 125 | } else if (songStackPage.line1 === i18n.tr("Playlist")) { |
4124 | 98 | maximumLineCount: 2 | 126 | Library.addRecent(songStackPage.line2, "Playlist", songStackPage.covers[0], songStackPage.line2, "playlist") |
4125 | 99 | fontSize: "medium" | 127 | recentModel.filterRecent() |
4126 | 100 | color: styleMusic.common.music | 128 | } |
4127 | 101 | anchors.left: albumImage.right | 129 | } |
4128 | 102 | anchors.leftMargin: units.gu(1) | 130 | } |
4129 | 103 | anchors.top: albumArtist.bottom | 131 | } |
4130 | 104 | anchors.topMargin: units.gu(0.8) | 132 | Button { |
4131 | 105 | anchors.right: parent.right | 133 | id: queueAllRow |
4132 | 106 | anchors.rightMargin: units.gu(1.5) | 134 | height: units.gu(4) |
4133 | 107 | elide: Text.ElideRight | 135 | strokeColor: UbuntuColors.green |
4134 | 108 | text: line2 | 136 | width: units.gu(15) |
4135 | 109 | } | 137 | Text { |
4136 | 110 | Label { | 138 | anchors { |
4137 | 111 | id: albumYear | 139 | centerIn: parent |
4138 | 112 | wrapMode: Text.NoWrap | 140 | } |
4139 | 113 | maximumLineCount: 1 | 141 | color: "white" |
4140 | 114 | fontSize: "x-small" | 142 | text: i18n.tr("Queue all") |
4141 | 115 | color: styleMusic.common.subtitle | 143 | } |
4142 | 116 | anchors.left: albumImage.right | 144 | MouseArea { |
4143 | 117 | anchors.leftMargin: units.gu(1) | 145 | anchors.fill: parent |
4144 | 118 | anchors.top: albumLabel.bottom | 146 | onClicked: addQueueFromModel(albumtrackslist.model) |
4145 | 119 | anchors.topMargin: units.gu(2) | 147 | } |
4146 | 120 | anchors.right: parent.right | 148 | } |
4147 | 121 | anchors.rightMargin: units.gu(1.5) | 149 | Button { |
4148 | 122 | elide: Text.ElideRight | 150 | id: playRow |
4149 | 123 | text: isAlbum && line1 !== i18n.tr("Genre") ? year + " | " + i18n.tr("%1 song", "%1 songs", albumtrackslist.count).arg(albumtrackslist.count) | 151 | color: UbuntuColors.green |
4150 | 124 | : i18n.tr("%1 song", "%1 songs", albumtrackslist.count).arg(albumtrackslist.count) | 152 | height: units.gu(4) |
4075 | 125 | |||
4076 | 126 | } | ||
4077 | 127 | |||
4078 | 128 | // Play | ||
4079 | 129 | Rectangle { | ||
4080 | 130 | id: playRow | ||
4081 | 131 | anchors.top: albumYear.bottom | ||
4082 | 132 | anchors.topMargin: units.gu(1) | ||
4083 | 133 | anchors.left: albumImage.right | ||
4084 | 134 | anchors.leftMargin: units.gu(1) | ||
4085 | 135 | color: "transparent" | ||
4086 | 136 | height: units.gu(4) | ||
4087 | 137 | width: units.gu(15) | ||
4088 | 138 | Icon { | ||
4089 | 139 | id: playTrack | ||
4090 | 140 | objectName: "songspage-playtrack" | ||
4091 | 141 | anchors.verticalCenter: parent.verticalCenter | ||
4092 | 142 | name: "media-playback-start" | ||
4093 | 143 | height: styleMusic.common.expandedItem | ||
4094 | 144 | width: styleMusic.common.expandedItem | ||
4095 | 145 | } | ||
4096 | 146 | Label { | ||
4097 | 147 | anchors.left: playTrack.right | ||
4098 | 148 | anchors.leftMargin: units.gu(0.5) | ||
4099 | 149 | anchors.verticalCenter: parent.verticalCenter | ||
4100 | 150 | fontSize: "small" | ||
4101 | 151 | color: styleMusic.common.subtitle | ||
4102 | 152 | width: parent.width - playTrack.width - units.gu(1) | ||
4151 | 153 | text: i18n.tr("Play all") | 153 | text: i18n.tr("Play all") |
4159 | 154 | wrapMode: Text.WordWrap | 154 | width: units.gu(15) |
4160 | 155 | maximumLineCount: 3 | 155 | MouseArea { |
4161 | 156 | } | 156 | anchors.fill: parent |
4162 | 157 | MouseArea { | 157 | onClicked: { |
4163 | 158 | anchors.fill: parent | 158 | trackClicked(albumtrackslist.model, 0) // play track |
4157 | 159 | onClicked: { | ||
4158 | 160 | trackClicked(albumtrackslist.model, 0) // play track | ||
4164 | 161 | 159 | ||
4173 | 162 | if (isAlbum && songStackPage.line1 !== i18n.tr("Genre")) { | 160 | if (isAlbum && songStackPage.line1 !== i18n.tr("Genre")) { |
4174 | 163 | Library.addRecent(songStackPage.line2, songStackPage.line1, songStackPage.covers[0], songStackPage.line2, "album") | 161 | Library.addRecent(songStackPage.line2, songStackPage.line1, songStackPage.covers[0], songStackPage.line2, "album") |
4175 | 164 | mainView.hasRecent = true | 162 | recentModel.filterRecent() |
4176 | 165 | recentModel.filterRecent() | 163 | } else if (songStackPage.line1 === i18n.tr("Playlist")) { |
4177 | 166 | } else if (songStackPage.line1 === i18n.tr("Playlist")) { | 164 | Library.addRecent(songStackPage.line2, "Playlist", songStackPage.covers[0], songStackPage.line2, "playlist") |
4178 | 167 | Library.addRecent(songStackPage.line2, "Playlist", songStackPage.covers[0], songStackPage.line2, "playlist") | 165 | recentModel.filterRecent() |
4179 | 168 | mainView.hasRecent = true | 166 | } |
4172 | 169 | recentModel.filterRecent() | ||
4180 | 170 | } | 167 | } |
4181 | 171 | } | 168 | } |
4182 | 172 | } | 169 | } |
4183 | 173 | } | 170 | } |
4219 | 174 | 171 | coverSources: songStackPage.covers | |
4220 | 175 | // Queue | 172 | height: songStackPage.line1 !== i18n.tr("Playlist") && |
4221 | 176 | Rectangle { | 173 | songStackPage.line1 !== i18n.tr("Genre") ? |
4222 | 177 | id: queueAllRow | 174 | units.gu(33) : units.gu(30) |
4223 | 178 | anchors.top: playRow.bottom | 175 | bottomColumn: Column { |
4224 | 179 | anchors.topMargin: units.gu(1) | 176 | Label { |
4225 | 180 | anchors.left: albumImage.right | 177 | id: albumLabel |
4226 | 181 | anchors.leftMargin: units.gu(1) | 178 | anchors { |
4227 | 182 | color: "transparent" | 179 | left: parent.left |
4228 | 183 | height: units.gu(4) | 180 | right: parent.right |
4229 | 184 | width: units.gu(15) | 181 | } |
4230 | 185 | Icon { | 182 | color: styleMusic.common.music |
4231 | 186 | id: queueAll | 183 | elide: Text.ElideRight |
4232 | 187 | objectName: "songspage-queue-all" | 184 | fontSize: "x-large" |
4233 | 188 | anchors.verticalCenter: parent.verticalCenter | 185 | maximumLineCount: 1 |
4234 | 189 | name: "add" | 186 | text: line2 |
4235 | 190 | height: styleMusic.common.expandedItem | 187 | wrapMode: Text.NoWrap |
4236 | 191 | width: styleMusic.common.expandedItem | 188 | } |
4237 | 192 | } | 189 | |
4238 | 193 | Label { | 190 | Item { |
4239 | 194 | anchors.left: queueAll.right | 191 | height: units.gu(0.75) |
4240 | 195 | anchors.leftMargin: units.gu(0.5) | 192 | width: parent.width |
4241 | 196 | anchors.verticalCenter: parent.verticalCenter | 193 | visible: albumArtist.visible |
4242 | 197 | fontSize: "small" | 194 | } |
4243 | 198 | color: styleMusic.common.subtitle | 195 | |
4244 | 199 | width: parent.width - queueAll.width - units.gu(1) | 196 | Label { |
4245 | 200 | text: i18n.tr("Add to queue") | 197 | id: albumArtist |
4246 | 201 | wrapMode: Text.WordWrap | 198 | anchors { |
4247 | 202 | maximumLineCount: 3 | 199 | left: parent.left |
4248 | 203 | } | 200 | right: parent.right |
4249 | 204 | MouseArea { | 201 | } |
4250 | 205 | anchors.fill: parent | 202 | color: styleMusic.common.subtitle |
4251 | 206 | onClicked: { | 203 | elide: Text.ElideRight |
4252 | 207 | addQueueFromModel(albumtrackslist.model) | 204 | fontSize: "small" |
4253 | 208 | } | 205 | maximumLineCount: 1 |
4254 | 206 | objectName: "songsPageHeaderAlbumArtist" | ||
4255 | 207 | text: line1 | ||
4256 | 208 | visible: text !== i18n.tr("Playlist") && | ||
4257 | 209 | text !== i18n.tr("Genre") | ||
4258 | 210 | wrapMode: Text.NoWrap | ||
4259 | 211 | } | ||
4260 | 212 | |||
4261 | 213 | Item { | ||
4262 | 214 | height: units.gu(1) | ||
4263 | 215 | width: parent.width | ||
4264 | 216 | } | ||
4265 | 217 | |||
4266 | 218 | Label { | ||
4267 | 219 | id: albumYear | ||
4268 | 220 | anchors { | ||
4269 | 221 | left: parent.left | ||
4270 | 222 | right: parent.right | ||
4271 | 223 | } | ||
4272 | 224 | color: styleMusic.common.subtitle | ||
4273 | 225 | elide: Text.ElideRight | ||
4274 | 226 | fontSize: "small" | ||
4275 | 227 | maximumLineCount: 1 | ||
4276 | 228 | text: isAlbum && line1 !== i18n.tr("Genre") ? year + " | " + i18n.tr("%1 song", "%1 songs", albumtrackslist.count).arg(albumtrackslist.count) | ||
4277 | 229 | : i18n.tr("%1 song", "%1 songs", albumtrackslist.count).arg(albumtrackslist.count) | ||
4278 | 230 | wrapMode: Text.NoWrap | ||
4279 | 209 | } | 231 | } |
4280 | 210 | } | 232 | } |
4281 | 211 | } | 233 | } |
4282 | @@ -219,7 +241,8 @@ | |||
4283 | 219 | objectName: "songsPageListItem" + index | 241 | objectName: "songsPageListItem" + index |
4284 | 220 | iconFrame: false | 242 | iconFrame: false |
4285 | 221 | progression: false | 243 | progression: false |
4287 | 222 | height: styleMusic.common.itemHeight | 244 | showDivider: false |
4288 | 245 | height: units.gu(6) | ||
4289 | 223 | 246 | ||
4290 | 224 | leftSideAction: songStackPage.line1 === i18n.tr("Playlist") | 247 | leftSideAction: songStackPage.line1 === i18n.tr("Playlist") |
4291 | 225 | ? playlistRemoveAction.item : null | 248 | ? playlistRemoveAction.item : null |
4292 | @@ -239,11 +262,9 @@ | |||
4293 | 239 | 262 | ||
4294 | 240 | if (isAlbum && songStackPage.line1 !== i18n.tr("Genre")) { | 263 | if (isAlbum && songStackPage.line1 !== i18n.tr("Genre")) { |
4295 | 241 | Library.addRecent(songStackPage.line2, songStackPage.line1, model.art, songStackPage.line2, "album") | 264 | Library.addRecent(songStackPage.line2, songStackPage.line1, model.art, songStackPage.line2, "album") |
4296 | 242 | mainView.hasRecent = true | ||
4297 | 243 | recentModel.filterRecent() | 265 | recentModel.filterRecent() |
4298 | 244 | } else if (songStackPage.line1 === i18n.tr("Playlist")) { | 266 | } else if (songStackPage.line1 === i18n.tr("Playlist")) { |
4299 | 245 | Library.addRecent(songStackPage.line2, "Playlist", songStackPage.covers[0], songStackPage.line2, "playlist") | 267 | Library.addRecent(songStackPage.line2, "Playlist", songStackPage.covers[0], songStackPage.line2, "playlist") |
4300 | 246 | mainView.hasRecent = true | ||
4301 | 247 | recentModel.filterRecent() | 268 | recentModel.filterRecent() |
4302 | 248 | } | 269 | } |
4303 | 249 | } | 270 | } |
4304 | @@ -272,30 +293,23 @@ | |||
4305 | 272 | 293 | ||
4306 | 273 | MusicRow { | 294 | MusicRow { |
4307 | 274 | id: musicRow | 295 | id: musicRow |
4309 | 275 | covers: model.art !== undefined ? [{art: model.art}] : [{author: model.author, album: model.album}] | 296 | covers: [] |
4310 | 297 | showCovers: false | ||
4311 | 276 | column: Column { | 298 | column: Column { |
4313 | 277 | spacing: units.gu(1) | 299 | Label { |
4314 | 300 | id: trackTitle | ||
4315 | 301 | color: styleMusic.common.music | ||
4316 | 302 | fontSize: "small" | ||
4317 | 303 | objectName: "songspage-tracktitle" | ||
4318 | 304 | text: model.title | ||
4319 | 305 | } | ||
4320 | 306 | |||
4321 | 278 | Label { | 307 | Label { |
4322 | 279 | id: trackArtist | 308 | id: trackArtist |
4323 | 280 | color: styleMusic.common.subtitle | 309 | color: styleMusic.common.subtitle |
4324 | 281 | fontSize: "x-small" | 310 | fontSize: "x-small" |
4325 | 282 | text: model.author | 311 | text: model.author |
4326 | 283 | } | 312 | } |
4327 | 284 | |||
4328 | 285 | Label { | ||
4329 | 286 | id: trackTitle | ||
4330 | 287 | color: styleMusic.common.subtitle | ||
4331 | 288 | fontSize: "medium" | ||
4332 | 289 | objectName: "songspage-tracktitle" | ||
4333 | 290 | text: model.title | ||
4334 | 291 | } | ||
4335 | 292 | |||
4336 | 293 | Label { | ||
4337 | 294 | id: trackAlbum | ||
4338 | 295 | color: styleMusic.common.subtitle | ||
4339 | 296 | fontSize: "xx-small" | ||
4340 | 297 | text: model.album | ||
4341 | 298 | } | ||
4342 | 299 | } | 313 | } |
4343 | 300 | } | 314 | } |
4344 | 301 | 315 | ||
4345 | @@ -309,4 +323,103 @@ | |||
4346 | 309 | } | 323 | } |
4347 | 310 | } | 324 | } |
4348 | 311 | } | 325 | } |
4349 | 326 | |||
4350 | 327 | // Edit name of playlist dialog | ||
4351 | 328 | Component { | ||
4352 | 329 | id: editPlaylistDialog | ||
4353 | 330 | Dialog { | ||
4354 | 331 | id: dialogEditPlaylist | ||
4355 | 332 | // TRANSLATORS: this is a title of a dialog with a prompt to rename a playlist | ||
4356 | 333 | title: i18n.tr("Change name") | ||
4357 | 334 | text: i18n.tr("Enter the new name of the playlist.") | ||
4358 | 335 | |||
4359 | 336 | property alias oldPlaylistName: playlistName.placeholderText | ||
4360 | 337 | |||
4361 | 338 | TextField { | ||
4362 | 339 | id: playlistName | ||
4363 | 340 | inputMethodHints: Qt.ImhNoPredictiveText | ||
4364 | 341 | |||
4365 | 342 | onPlaceholderTextChanged: text = placeholderText | ||
4366 | 343 | } | ||
4367 | 344 | Label { | ||
4368 | 345 | id: editplaylistoutput | ||
4369 | 346 | color: "red" | ||
4370 | 347 | visible: false | ||
4371 | 348 | } | ||
4372 | 349 | |||
4373 | 350 | Button { | ||
4374 | 351 | text: i18n.tr("Change") | ||
4375 | 352 | color: styleMusic.dialog.confirmButtonColor | ||
4376 | 353 | onClicked: { | ||
4377 | 354 | editplaylistoutput.visible = true | ||
4378 | 355 | |||
4379 | 356 | if (playlistName.text.length > 0) { // make sure something is acually inputed | ||
4380 | 357 | console.debug("Debug: User changed name from "+playlistName.placeholderText+" to "+playlistName.text) | ||
4381 | 358 | |||
4382 | 359 | if (Playlists.renamePlaylist(playlistName.placeholderText, playlistName.text) === true) { | ||
4383 | 360 | playlistModel.filterPlaylists() | ||
4384 | 361 | |||
4385 | 362 | if (Library.recentContainsPlaylist(playlistName.placeholderText)) { | ||
4386 | 363 | Library.recentRenamePlaylist(playlistName.placeholderText, playlistName.text) | ||
4387 | 364 | recentModel.filterRecent() | ||
4388 | 365 | } | ||
4389 | 366 | |||
4390 | 367 | PopupUtils.close(dialogEditPlaylist) | ||
4391 | 368 | |||
4392 | 369 | line2 = playlistName.text | ||
4393 | 370 | } | ||
4394 | 371 | else { | ||
4395 | 372 | editplaylistoutput.text = i18n.tr("Playlist already exists") | ||
4396 | 373 | } | ||
4397 | 374 | } | ||
4398 | 375 | else { | ||
4399 | 376 | editplaylistoutput.text = i18n.tr("Please type in a name.") | ||
4400 | 377 | } | ||
4401 | 378 | } | ||
4402 | 379 | } | ||
4403 | 380 | Button { | ||
4404 | 381 | text: i18n.tr("Cancel") | ||
4405 | 382 | color: styleMusic.dialog.cancelButtonColor | ||
4406 | 383 | onClicked: PopupUtils.close(dialogEditPlaylist) | ||
4407 | 384 | } | ||
4408 | 385 | } | ||
4409 | 386 | } | ||
4410 | 387 | |||
4411 | 388 | // Remove playlist dialog | ||
4412 | 389 | Component { | ||
4413 | 390 | id: removePlaylistDialog | ||
4414 | 391 | Dialog { | ||
4415 | 392 | id: dialogRemovePlaylist | ||
4416 | 393 | // TRANSLATORS: this is a title of a dialog with a prompt to delete a playlist | ||
4417 | 394 | title: i18n.tr("Are you sure?") | ||
4418 | 395 | text: i18n.tr("This will delete your playlist.") | ||
4419 | 396 | |||
4420 | 397 | property string oldPlaylistName | ||
4421 | 398 | |||
4422 | 399 | Button { | ||
4423 | 400 | text: i18n.tr("Remove") | ||
4424 | 401 | color: styleMusic.dialog.confirmButtonColor | ||
4425 | 402 | onClicked: { | ||
4426 | 403 | // removing playlist | ||
4427 | 404 | Playlists.removePlaylist(dialogRemovePlaylist.oldPlaylistName) | ||
4428 | 405 | |||
4429 | 406 | playlistModel.filterPlaylists(); | ||
4430 | 407 | |||
4431 | 408 | if (Library.recentContainsPlaylist(dialogRemovePlaylist.oldPlaylistName)) { | ||
4432 | 409 | Library.recentRemovePlaylist(dialogRemovePlaylist.oldPlaylistName) | ||
4433 | 410 | recentModel.filterRecent() | ||
4434 | 411 | } | ||
4435 | 412 | |||
4436 | 413 | PopupUtils.close(dialogRemovePlaylist) | ||
4437 | 414 | |||
4438 | 415 | musicToolbar.goBack() | ||
4439 | 416 | } | ||
4440 | 417 | } | ||
4441 | 418 | Button { | ||
4442 | 419 | text: i18n.tr("Cancel") | ||
4443 | 420 | color: styleMusic.dialog.cancelButtonColor | ||
4444 | 421 | onClicked: PopupUtils.close(dialogRemovePlaylist) | ||
4445 | 422 | } | ||
4446 | 423 | } | ||
4447 | 424 | } | ||
4448 | 312 | } | 425 | } |
4449 | 313 | 426 | ||
4450 | === modified file 'music-app.qml' | |||
4451 | --- music-app.qml 2014-10-16 22:19:13 +0000 | |||
4452 | +++ music-app.qml 2014-10-21 15:31:33 +0000 | |||
4453 | @@ -40,18 +40,13 @@ | |||
4454 | 40 | id: mainView | 40 | id: mainView |
4455 | 41 | useDeprecatedToolbar: false | 41 | useDeprecatedToolbar: false |
4456 | 42 | 42 | ||
4460 | 43 | // Use toolbar color for header | 43 | backgroundColor: "#1e1e23" |
4461 | 44 | headerColor: styleMusic.toolbar.fullBackgroundColor | 44 | headerColor: "#1e1e23" |
4459 | 45 | backgroundColor: styleMusic.toolbar.fullBackgroundColor | ||
4462 | 46 | 45 | ||
4463 | 47 | // Global keyboard shortcuts | 46 | // Global keyboard shortcuts |
4464 | 48 | focus: true | 47 | focus: true |
4465 | 49 | Keys.onPressed: { | 48 | Keys.onPressed: { |
4471 | 50 | if (event.key === Qt.Key_Alt) { | 49 | if(event.key === Qt.Key_Escape) { |
4467 | 51 | // On alt key press show toolbar and start autohide timer | ||
4468 | 52 | musicToolbar.showToolbar(); | ||
4469 | 53 | } | ||
4470 | 54 | else if(event.key === Qt.Key_Escape) { | ||
4472 | 55 | musicToolbar.goBack(); // Esc Go back | 50 | musicToolbar.goBack(); // Esc Go back |
4473 | 56 | } | 51 | } |
4474 | 57 | else if(event.modifiers === Qt.AltModifier) { | 52 | else if(event.modifiers === Qt.AltModifier) { |
4475 | @@ -94,13 +89,11 @@ | |||
4476 | 94 | } | 89 | } |
4477 | 95 | break; | 90 | break; |
4478 | 96 | case Qt.Key_J: // Ctrl+J Jump to playing song | 91 | case Qt.Key_J: // Ctrl+J Jump to playing song |
4482 | 97 | nowPlaying.visible = true; | 92 | tabs.pushNowPlaying() |
4483 | 98 | nowPlaying.positionAt(player.currentIndex); | 93 | nowPlaying.isListView = true; |
4481 | 99 | musicToolbar.showToolbar(); | ||
4484 | 100 | break; | 94 | break; |
4485 | 101 | case Qt.Key_N: // Ctrl+N Show now playing | 95 | case Qt.Key_N: // Ctrl+N Show now playing |
4488 | 102 | nowPlaying.visible = true; | 96 | tabs.pushNowPlaying() |
4487 | 103 | musicToolbar.showToolbar(); | ||
4489 | 104 | break; | 97 | break; |
4490 | 105 | case Qt.Key_P: // Ctrl+P Toggle playing state | 98 | case Qt.Key_P: // Ctrl+P Toggle playing state |
4491 | 106 | player.toggle(); | 99 | player.toggle(); |
4492 | @@ -218,7 +211,6 @@ | |||
4493 | 218 | 211 | ||
4494 | 219 | // Add album to recent list | 212 | // Add album to recent list |
4495 | 220 | Library.addRecent(songsAlbumArtistModel.album, songsAlbumArtistModel.artist, songsAlbumArtistModel.art, songsAlbumArtistModel.album, "album") | 213 | Library.addRecent(songsAlbumArtistModel.album, songsAlbumArtistModel.artist, songsAlbumArtistModel.art, songsAlbumArtistModel.album, "album") |
4496 | 221 | mainView.hasRecent = true | ||
4497 | 222 | recentModel.filterRecent() | 214 | recentModel.filterRecent() |
4498 | 223 | } | 215 | } |
4499 | 224 | 216 | ||
4500 | @@ -583,7 +575,9 @@ | |||
4501 | 583 | // TODO: Switch tabs back and forth to get the background color in the | 575 | // TODO: Switch tabs back and forth to get the background color in the |
4502 | 584 | // header to work properly. | 576 | // header to work properly. |
4503 | 585 | tabs.selectedTabIndex = 1 | 577 | tabs.selectedTabIndex = 1 |
4505 | 586 | tabs.selectedTabIndex = 0 | 578 | |
4506 | 579 | // goto Recent if there are items otherwise go to Albums | ||
4507 | 580 | tabs.selectedTabIndex = Library.isRecentEmpty() ? 2 : 0 | ||
4508 | 587 | 581 | ||
4509 | 588 | // Run post load | 582 | // Run post load |
4510 | 589 | tabs.ensurePopulated(tabs.selectedTab); | 583 | tabs.ensurePopulated(tabs.selectedTab); |
4511 | @@ -591,28 +585,20 @@ | |||
4512 | 591 | if (args.values.url) { | 585 | if (args.values.url) { |
4513 | 592 | uriHandler.process(args.values.url, true); | 586 | uriHandler.process(args.values.url, true); |
4514 | 593 | } | 587 | } |
4515 | 594 | |||
4516 | 595 | // Show toolbar and start timer if there is music | ||
4517 | 596 | if (!emptyPage.noMusic) { | ||
4518 | 597 | musicToolbar.showToolbar(); | ||
4519 | 598 | musicToolbar.startAutohideTimer(); | ||
4520 | 599 | } | ||
4521 | 600 | } | 588 | } |
4522 | 601 | 589 | ||
4523 | 602 | // VARIABLES | 590 | // VARIABLES |
4524 | 603 | property string musicName: i18n.tr("Music") | 591 | property string musicName: i18n.tr("Music") |
4525 | 604 | property string appVersion: '1.2' | 592 | property string appVersion: '1.2' |
4526 | 605 | property bool hasRecent: !Library.isRecentEmpty() | ||
4527 | 606 | property bool scrobble: false | 593 | property bool scrobble: false |
4528 | 607 | property string lastfmusername | 594 | property string lastfmusername |
4529 | 608 | property string lastfmpassword | 595 | property string lastfmpassword |
4530 | 609 | property string timestamp // used to scrobble | 596 | property string timestamp // used to scrobble |
4531 | 610 | property var chosenElement: null | 597 | property var chosenElement: null |
4533 | 611 | property bool toolbarShown: musicToolbar.shown | 598 | property bool toolbarShown: musicToolbar.visible |
4534 | 612 | property bool selectedAlbum: false | 599 | property bool selectedAlbum: false |
4535 | 613 | 600 | ||
4536 | 614 | signal listItemSwiping(int i) | 601 | signal listItemSwiping(int i) |
4537 | 615 | signal onToolbarShownChanged(bool shown, var currentPage, var currentTab) | ||
4538 | 616 | 602 | ||
4539 | 617 | property bool wideAspect: width >= units.gu(70) && loadedUI | 603 | property bool wideAspect: width >= units.gu(70) && loadedUI |
4540 | 618 | property bool loadedUI: false // property to detect if the UI has finished | 604 | property bool loadedUI: false // property to detect if the UI has finished |
4541 | @@ -693,9 +679,6 @@ | |||
4542 | 693 | 679 | ||
4543 | 694 | // Show the Now Playing page and make sure the track is visible | 680 | // Show the Now Playing page and make sure the track is visible |
4544 | 695 | tabs.pushNowPlaying(); | 681 | tabs.pushNowPlaying(); |
4545 | 696 | nowPlaying.ensureVisibleIndex = index; | ||
4546 | 697 | |||
4547 | 698 | musicToolbar.showToolbar(); | ||
4548 | 699 | } | 682 | } |
4549 | 700 | else { | 683 | else { |
4550 | 701 | player.source = file; | 684 | player.source = file; |
4551 | @@ -711,10 +694,9 @@ | |||
4552 | 711 | } | 694 | } |
4553 | 712 | 695 | ||
4554 | 713 | // Show the Now Playing page and make sure the track is visible | 696 | // Show the Now Playing page and make sure the track is visible |
4559 | 714 | tabs.pushNowPlaying(); | 697 | if (!nowPlaying.isListView) { |
4560 | 715 | nowPlaying.ensureVisibleIndex = index; | 698 | tabs.pushNowPlaying(); |
4561 | 716 | 699 | } | |
4558 | 717 | musicToolbar.showToolbar(); | ||
4562 | 718 | } | 700 | } |
4563 | 719 | 701 | ||
4564 | 720 | function playRandomSong(shuffle) | 702 | function playRandomSong(shuffle) |
4565 | @@ -730,6 +712,17 @@ | |||
4566 | 730 | trackClicked(allSongsModel, index, true) | 712 | trackClicked(allSongsModel, index, true) |
4567 | 731 | } | 713 | } |
4568 | 732 | 714 | ||
4569 | 715 | function shuffleModel(model) | ||
4570 | 716 | { | ||
4571 | 717 | var now = new Date(); | ||
4572 | 718 | var seed = now.getSeconds(); | ||
4573 | 719 | var index = Math.floor(model.count * Math.random(seed)); | ||
4574 | 720 | |||
4575 | 721 | player.shuffle = true; | ||
4576 | 722 | |||
4577 | 723 | trackClicked(model, index, true) | ||
4578 | 724 | } | ||
4579 | 725 | |||
4580 | 733 | // Load mediascanner store | 726 | // Load mediascanner store |
4581 | 734 | MediaStore { | 727 | MediaStore { |
4582 | 735 | id: musicStore | 728 | id: musicStore |
4583 | @@ -881,10 +874,6 @@ | |||
4584 | 881 | id: searchSheet | 874 | id: searchSheet |
4585 | 882 | } | 875 | } |
4586 | 883 | 876 | ||
4587 | 884 | // Blurred background | ||
4588 | 885 | BlurredBackground { | ||
4589 | 886 | } | ||
4590 | 887 | |||
4591 | 888 | // Popover for tracks, queue and add to playlist, for example | 877 | // Popover for tracks, queue and add to playlist, for example |
4592 | 889 | Component { | 878 | Component { |
4593 | 890 | id: trackPopoverComponent | 879 | id: trackPopoverComponent |
4594 | @@ -987,6 +976,7 @@ | |||
4595 | 987 | 976 | ||
4596 | 988 | MusicToolbar { | 977 | MusicToolbar { |
4597 | 989 | id: musicToolbar | 978 | id: musicToolbar |
4598 | 979 | visible: nowPlaying.isListView || !nowPlaying.visible | ||
4599 | 990 | objectName: "musicToolbarObject" | 980 | objectName: "musicToolbarObject" |
4600 | 991 | z: 200 // put on top of everything else | 981 | z: 200 // put on top of everything else |
4601 | 992 | } | 982 | } |
4602 | @@ -997,7 +987,6 @@ | |||
4603 | 997 | Tabs { | 987 | Tabs { |
4604 | 998 | id: tabs | 988 | id: tabs |
4605 | 999 | anchors { | 989 | anchors { |
4606 | 1000 | bottomMargin: wideAspect ? musicToolbar.fullHeight : undefined | ||
4607 | 1001 | fill: parent | 990 | fill: parent |
4608 | 1002 | } | 991 | } |
4609 | 1003 | 992 | ||
4610 | @@ -1124,6 +1113,8 @@ | |||
4611 | 1124 | if (mainPageStack.currentPage !== nowPlaying) { | 1113 | if (mainPageStack.currentPage !== nowPlaying) { |
4612 | 1125 | mainPageStack.push(nowPlaying); | 1114 | mainPageStack.push(nowPlaying); |
4613 | 1126 | } | 1115 | } |
4614 | 1116 | |||
4615 | 1117 | nowPlaying.isListView = false; // ensure full view | ||
4616 | 1127 | } | 1118 | } |
4617 | 1128 | 1119 | ||
4618 | 1129 | Component.onCompleted: musicToolbar.currentTab = selectedTab | 1120 | Component.onCompleted: musicToolbar.currentTab = selectedTab |
4619 | 1130 | 1121 | ||
4620 | === added file 'po/ca@valencia.po' | |||
4621 | --- po/ca@valencia.po 1970-01-01 00:00:00 +0000 | |||
4622 | +++ po/ca@valencia.po 2014-10-21 15:31:33 +0000 | |||
4623 | @@ -0,0 +1,459 @@ | |||
4624 | 1 | # Catalan (Valencian) translation for music-app | ||
4625 | 2 | # Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014 | ||
4626 | 3 | # This file is distributed under the same license as the music-app package. | ||
4627 | 4 | # FIRST AUTHOR <EMAIL@ADDRESS>, 2014. | ||
4628 | 5 | # | ||
4629 | 6 | msgid "" | ||
4630 | 7 | msgstr "" | ||
4631 | 8 | "Project-Id-Version: music-app\n" | ||
4632 | 9 | "Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" | ||
4633 | 10 | "POT-Creation-Date: 2014-10-20 15:09+0100\n" | ||
4634 | 11 | "PO-Revision-Date: 2014-10-17 05:37+0000\n" | ||
4635 | 12 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" | ||
4636 | 13 | "Language-Team: Catalan (Valencian) <ca@valencia@li.org>\n" | ||
4637 | 14 | "MIME-Version: 1.0\n" | ||
4638 | 15 | "Content-Type: text/plain; charset=UTF-8\n" | ||
4639 | 16 | "Content-Transfer-Encoding: 8bit\n" | ||
4640 | 17 | "Plural-Forms: nplurals=2; plural=n != 1;\n" | ||
4641 | 18 | "X-Launchpad-Export-Date: 2014-10-21 07:54+0000\n" | ||
4642 | 19 | "X-Generator: Launchpad (build 17203)\n" | ||
4643 | 20 | |||
4644 | 21 | #: ../LoginLastFM.qml:48 ../MusicSettings.qml:134 ../MusicSettings.qml:142 | ||
4645 | 22 | msgid "Last.fm" | ||
4646 | 23 | msgstr "Last.fm" | ||
4647 | 24 | |||
4648 | 25 | #: ../LoginLastFM.qml:54 | ||
4649 | 26 | msgid "Login to be able to scrobble." | ||
4650 | 27 | msgstr "Inicia una sessió per poder navegar." | ||
4651 | 28 | |||
4652 | 29 | #: ../LoginLastFM.qml:62 | ||
4653 | 30 | msgid "Username" | ||
4654 | 31 | msgstr "Nom d'usuari" | ||
4655 | 32 | |||
4656 | 33 | #: ../LoginLastFM.qml:72 | ||
4657 | 34 | msgid "Password" | ||
4658 | 35 | msgstr "Contrasenya" | ||
4659 | 36 | |||
4660 | 37 | #: ../LoginLastFM.qml:94 | ||
4661 | 38 | msgid "Login" | ||
4662 | 39 | msgstr "Inicia la sessió" | ||
4663 | 40 | |||
4664 | 41 | #: ../LoginLastFM.qml:101 | ||
4665 | 42 | msgid "Trying to login..." | ||
4666 | 43 | msgstr "S'està intentant iniciar la sessió..." | ||
4667 | 44 | |||
4668 | 45 | #: ../LoginLastFM.qml:115 | ||
4669 | 46 | msgid "Login Successful" | ||
4670 | 47 | msgstr "Inici de sessió correcte" | ||
4671 | 48 | |||
4672 | 49 | #: ../LoginLastFM.qml:121 | ||
4673 | 50 | msgid "Login Failed" | ||
4674 | 51 | msgstr "Error en l'inici de sessió" | ||
4675 | 52 | |||
4676 | 53 | #: ../LoginLastFM.qml:127 | ||
4677 | 54 | msgid "You forgot to set your username and/or password" | ||
4678 | 55 | msgstr "Vos heu oblidat d'establir el vostre nom d'usuari i/o la contrasenya" | ||
4679 | 56 | |||
4680 | 57 | #: ../MusicAlbums.qml:29 | ||
4681 | 58 | msgid "Albums" | ||
4682 | 59 | msgstr "Àlbums" | ||
4683 | 60 | |||
4684 | 61 | #: ../MusicAlbums.qml:57 ../MusicStart.qml:71 ../common/AlbumsPage.qml:155 | ||
4685 | 62 | msgid "Album" | ||
4686 | 63 | msgstr "Àlbum" | ||
4687 | 64 | |||
4688 | 65 | #: ../MusicArtists.qml:37 | ||
4689 | 66 | msgid "Artists" | ||
4690 | 67 | msgstr "Artistes" | ||
4691 | 68 | |||
4692 | 69 | #: ../MusicArtists.qml:78 | ||
4693 | 70 | msgid "Artist" | ||
4694 | 71 | msgstr "Artista" | ||
4695 | 72 | |||
4696 | 73 | #: ../MusicNowPlaying.qml:33 | ||
4697 | 74 | msgid "Queue" | ||
4698 | 75 | msgstr "" | ||
4699 | 76 | |||
4700 | 77 | #: ../MusicNowPlaying.qml:33 | ||
4701 | 78 | msgid "Now playing" | ||
4702 | 79 | msgstr "" | ||
4703 | 80 | |||
4704 | 81 | #. TRANSLATORS: this is the name of the playlists page shown in the tab header. | ||
4705 | 82 | #. Remember to keep the translation short to fit the screen width | ||
4706 | 83 | #: ../MusicPlaylists.qml:35 | ||
4707 | 84 | msgid "Playlists" | ||
4708 | 85 | msgstr "Llistes de reproducció" | ||
4709 | 86 | |||
4710 | 87 | #: ../MusicPlaylists.qml:61 ../MusicaddtoPlaylist.qml:105 | ||
4711 | 88 | #: ../common/SongsPage.qml:228 ../common/SongsPage.qml:229 | ||
4712 | 89 | #, qt-format | ||
4713 | 90 | msgid "%1 song" | ||
4714 | 91 | msgid_plural "%1 songs" | ||
4715 | 92 | msgstr[0] "%1 tema" | ||
4716 | 93 | msgstr[1] "%1 temes" | ||
4717 | 94 | |||
4718 | 95 | #: ../MusicPlaylists.qml:66 ../MusicPlaylists.qml:70 ../MusicStart.qml:57 | ||
4719 | 96 | #: ../MusicStart.qml:71 ../common/SongsPage.qml:47 ../common/SongsPage.qml:125 | ||
4720 | 97 | #: ../common/SongsPage.qml:163 ../common/SongsPage.qml:172 | ||
4721 | 98 | #: ../common/SongsPage.qml:208 ../common/SongsPage.qml:247 | ||
4722 | 99 | #: ../common/SongsPage.qml:249 ../common/SongsPage.qml:266 | ||
4723 | 100 | msgid "Playlist" | ||
4724 | 101 | msgstr "Llista de reproducció" | ||
4725 | 102 | |||
4726 | 103 | #: ../MusicSearch.qml:44 ../MusicSearch.qml:75 ../music-app.qml:88 | ||
4727 | 104 | #: ../music-app.qml:134 ../music-app.qml:140 | ||
4728 | 105 | msgid "Search" | ||
4729 | 106 | msgstr "Cerca" | ||
4730 | 107 | |||
4731 | 108 | #: ../MusicSettings.qml:30 ../music-app.qml:184 | ||
4732 | 109 | msgid "Settings" | ||
4733 | 110 | msgstr "Paràmetres" | ||
4734 | 111 | |||
4735 | 112 | #: ../MusicSettings.qml:70 | ||
4736 | 113 | msgid "Equaliser" | ||
4737 | 114 | msgstr "Equalitzador" | ||
4738 | 115 | |||
4739 | 116 | #: ../MusicSettings.qml:71 | ||
4740 | 117 | msgid "Default" | ||
4741 | 118 | msgstr "Per defecte" | ||
4742 | 119 | |||
4743 | 120 | #: ../MusicSettings.qml:72 | ||
4744 | 121 | msgid "Acoustic" | ||
4745 | 122 | msgstr "Acústic" | ||
4746 | 123 | |||
4747 | 124 | #: ../MusicSettings.qml:73 | ||
4748 | 125 | msgid "Classical" | ||
4749 | 126 | msgstr "Clàssica" | ||
4750 | 127 | |||
4751 | 128 | #: ../MusicSettings.qml:74 | ||
4752 | 129 | msgid "Electronic" | ||
4753 | 130 | msgstr "Electrònica" | ||
4754 | 131 | |||
4755 | 132 | #: ../MusicSettings.qml:75 | ||
4756 | 133 | msgid "Flat" | ||
4757 | 134 | msgstr "Pla" | ||
4758 | 135 | |||
4759 | 136 | #: ../MusicSettings.qml:76 | ||
4760 | 137 | msgid "Hip Hop" | ||
4761 | 138 | msgstr "Hip Hop" | ||
4762 | 139 | |||
4763 | 140 | #: ../MusicSettings.qml:77 | ||
4764 | 141 | msgid "Jazz" | ||
4765 | 142 | msgstr "Jazz" | ||
4766 | 143 | |||
4767 | 144 | #: ../MusicSettings.qml:78 | ||
4768 | 145 | msgid "Metal" | ||
4769 | 146 | msgstr "Metal" | ||
4770 | 147 | |||
4771 | 148 | #: ../MusicSettings.qml:79 | ||
4772 | 149 | msgid "Pop" | ||
4773 | 150 | msgstr "Pop" | ||
4774 | 151 | |||
4775 | 152 | #: ../MusicSettings.qml:80 | ||
4776 | 153 | msgid "Rock" | ||
4777 | 154 | msgstr "Rock" | ||
4778 | 155 | |||
4779 | 156 | #: ../MusicSettings.qml:81 | ||
4780 | 157 | msgid "Custom" | ||
4781 | 158 | msgstr "Personalitzada" | ||
4782 | 159 | |||
4783 | 160 | #: ../MusicSettings.qml:101 | ||
4784 | 161 | msgid "" | ||
4785 | 162 | "Snap to current song \n" | ||
4786 | 163 | "when opening toolbar" | ||
4787 | 164 | msgstr "" | ||
4788 | 165 | "Salta a la cançó actual \n" | ||
4789 | 166 | "quan s'estiga obrint una barra d'eines" | ||
4790 | 167 | |||
4791 | 168 | #: ../MusicSettings.qml:121 | ||
4792 | 169 | msgid "Accounts" | ||
4793 | 170 | msgstr "Comptes" | ||
4794 | 171 | |||
4795 | 172 | #: ../MusicSettings.qml:135 | ||
4796 | 173 | msgid "Login to scrobble and import playlists" | ||
4797 | 174 | msgstr "Inicieu una sessió per navegar i importar llistes de reproducció" | ||
4798 | 175 | |||
4799 | 176 | #: ../MusicSettings.qml:158 | ||
4800 | 177 | msgid "Music Streaming" | ||
4801 | 178 | msgstr "Transmissió de música" | ||
4802 | 179 | |||
4803 | 180 | #: ../MusicSettings.qml:168 | ||
4804 | 181 | msgid "Ubuntu One" | ||
4805 | 182 | msgstr "Ubuntu One" | ||
4806 | 183 | |||
4807 | 184 | #: ../MusicSettings.qml:169 | ||
4808 | 185 | msgid "Sign in to stream your cloud music" | ||
4809 | 186 | msgstr "Inicieu una sessió per transmetre la vostra música al núvol" | ||
4810 | 187 | |||
4811 | 188 | #: ../MusicSettings.qml:185 | ||
4812 | 189 | msgid "Stream only on Wi-Fi" | ||
4813 | 190 | msgstr "Transmet únicament amb la connexió inalàmbrica" | ||
4814 | 191 | |||
4815 | 192 | #: ../MusicSettings.qml:219 | ||
4816 | 193 | msgid "Clean everything!" | ||
4817 | 194 | msgstr "Neteja-ho tot" | ||
4818 | 195 | |||
4819 | 196 | #: ../MusicStart.qml:35 | ||
4820 | 197 | msgid "Recent" | ||
4821 | 198 | msgstr "Recents" | ||
4822 | 199 | |||
4823 | 200 | #: ../MusicToolbar.qml:150 | ||
4824 | 201 | msgid "Tap to shuffle music" | ||
4825 | 202 | msgstr "" | ||
4826 | 203 | |||
4827 | 204 | #: ../MusicTracks.qml:35 | ||
4828 | 205 | msgid "Songs" | ||
4829 | 206 | msgstr "Temes" | ||
4830 | 207 | |||
4831 | 208 | #: ../MusicaddtoPlaylist.qml:41 | ||
4832 | 209 | msgid "Select playlist" | ||
4833 | 210 | msgstr "Seleccioneu una llista de reproducció" | ||
4834 | 211 | |||
4835 | 212 | #: ../MusicaddtoPlaylist.qml:48 | ||
4836 | 213 | msgid "New playlist" | ||
4837 | 214 | msgstr "Llista de reproducció nova" | ||
4838 | 215 | |||
4839 | 216 | #: ../common/AlbumsPage.qml:55 ../common/SongsPage.qml:115 | ||
4840 | 217 | msgid "Shuffle" | ||
4841 | 218 | msgstr "" | ||
4842 | 219 | |||
4843 | 220 | #: ../common/AlbumsPage.qml:72 ../common/SongsPage.qml:142 | ||
4844 | 221 | msgid "Queue all" | ||
4845 | 222 | msgstr "" | ||
4846 | 223 | |||
4847 | 224 | #: ../common/AlbumsPage.qml:83 ../common/SongsPage.qml:153 | ||
4848 | 225 | msgid "Play all" | ||
4849 | 226 | msgstr "Reprodueix-ho tot" | ||
4850 | 227 | |||
4851 | 228 | #: ../common/AlbumsPage.qml:124 | ||
4852 | 229 | #, qt-format | ||
4853 | 230 | msgid "%1 album" | ||
4854 | 231 | msgid_plural "%1 albums" | ||
4855 | 232 | msgstr[0] "%1 àlbum" | ||
4856 | 233 | msgstr[1] "%1 àlbums" | ||
4857 | 234 | |||
4858 | 235 | #: ../common/ListItemActions/AddToPlaylist.qml:25 ../music-app.qml:905 | ||
4859 | 236 | msgid "Add to playlist" | ||
4860 | 237 | msgstr "Afig a la llista de reproducció" | ||
4861 | 238 | |||
4862 | 239 | #: ../common/ListItemActions/AddToQueue.qml:25 | ||
4863 | 240 | msgid "Add to Queue" | ||
4864 | 241 | msgstr "Afig a la cua" | ||
4865 | 242 | |||
4866 | 243 | #: ../common/ListItemActions/Remove.qml:27 ../common/SongsPage.qml:400 | ||
4867 | 244 | msgid "Remove" | ||
4868 | 245 | msgstr "Suprimeix-la" | ||
4869 | 246 | |||
4870 | 247 | #: ../common/LoadingSpinnerComponent.qml:47 | ||
4871 | 248 | msgid "Loading..." | ||
4872 | 249 | msgstr "S'està carregant..." | ||
4873 | 250 | |||
4874 | 251 | #: ../common/SongsPage.qml:122 ../common/SongsPage.qml:160 | ||
4875 | 252 | #: ../common/SongsPage.qml:173 ../common/SongsPage.qml:209 | ||
4876 | 253 | #: ../common/SongsPage.qml:228 ../common/SongsPage.qml:263 | ||
4877 | 254 | msgid "Genre" | ||
4878 | 255 | msgstr "Gènere" | ||
4879 | 256 | |||
4880 | 257 | #. TRANSLATORS: this is a title of a dialog with a prompt to rename a playlist | ||
4881 | 258 | #: ../common/SongsPage.qml:333 | ||
4882 | 259 | msgid "Change name" | ||
4883 | 260 | msgstr "Canvia el nom" | ||
4884 | 261 | |||
4885 | 262 | #: ../common/SongsPage.qml:334 | ||
4886 | 263 | msgid "Enter the new name of the playlist." | ||
4887 | 264 | msgstr "Escriviu un nom nou per a la llista de reproducció." | ||
4888 | 265 | |||
4889 | 266 | #: ../common/SongsPage.qml:351 | ||
4890 | 267 | msgid "Change" | ||
4891 | 268 | msgstr "Canvia" | ||
4892 | 269 | |||
4893 | 270 | #: ../common/SongsPage.qml:372 ../music-app.qml:959 | ||
4894 | 271 | msgid "Playlist already exists" | ||
4895 | 272 | msgstr "Ja existeix la llista de reproducció" | ||
4896 | 273 | |||
4897 | 274 | #: ../common/SongsPage.qml:376 ../music-app.qml:964 | ||
4898 | 275 | msgid "Please type in a name." | ||
4899 | 276 | msgstr "Escriviu un nom" | ||
4900 | 277 | |||
4901 | 278 | #: ../common/SongsPage.qml:381 ../common/SongsPage.qml:420 | ||
4902 | 279 | #: ../music-app.qml:499 ../music-app.qml:970 | ||
4903 | 280 | msgid "Cancel" | ||
4904 | 281 | msgstr "Cancel·la" | ||
4905 | 282 | |||
4906 | 283 | #. TRANSLATORS: this is a title of a dialog with a prompt to delete a playlist | ||
4907 | 284 | #: ../common/SongsPage.qml:394 | ||
4908 | 285 | msgid "Are you sure?" | ||
4909 | 286 | msgstr "" | ||
4910 | 287 | |||
4911 | 288 | #: ../common/SongsPage.qml:395 | ||
4912 | 289 | msgid "This will delete your playlist." | ||
4913 | 290 | msgstr "" | ||
4914 | 291 | |||
4915 | 292 | #: ../common/SwipeDelete.qml:52 ../common/SwipeDelete.qml:88 | ||
4916 | 293 | msgid "Clear" | ||
4917 | 294 | msgstr "Esborra" | ||
4918 | 295 | |||
4919 | 296 | #: ../meta-database.js:90 ../meta-database.js:92 | ||
4920 | 297 | msgid "Unknown Album" | ||
4921 | 298 | msgstr "Àlbum desconegut" | ||
4922 | 299 | |||
4923 | 300 | #: ../meta-database.js:91 | ||
4924 | 301 | msgid "Unknown Artist" | ||
4925 | 302 | msgstr "Artista desconegut" | ||
4926 | 303 | |||
4927 | 304 | #: ../music-app.qml:135 | ||
4928 | 305 | msgid "Search Track" | ||
4929 | 306 | msgstr "Cerca de temes" | ||
4930 | 307 | |||
4931 | 308 | #: ../music-app.qml:147 | ||
4932 | 309 | msgid "Next" | ||
4933 | 310 | msgstr "Següent" | ||
4934 | 311 | |||
4935 | 312 | #: ../music-app.qml:148 | ||
4936 | 313 | msgid "Next Track" | ||
4937 | 314 | msgstr "Tema següent" | ||
4938 | 315 | |||
4939 | 316 | #: ../music-app.qml:154 | ||
4940 | 317 | msgid "Pause" | ||
4941 | 318 | msgstr "Posa en pausa" | ||
4942 | 319 | |||
4943 | 320 | #: ../music-app.qml:154 | ||
4944 | 321 | msgid "Play" | ||
4945 | 322 | msgstr "Reprodueix" | ||
4946 | 323 | |||
4947 | 324 | #: ../music-app.qml:156 | ||
4948 | 325 | msgid "Pause Playback" | ||
4949 | 326 | msgstr "Posa la reproducció en pausa" | ||
4950 | 327 | |||
4951 | 328 | #: ../music-app.qml:156 | ||
4952 | 329 | msgid "Continue or start playback" | ||
4953 | 330 | msgstr "Continua o inicia la reproducció" | ||
4954 | 331 | |||
4955 | 332 | #: ../music-app.qml:161 | ||
4956 | 333 | msgid "Back" | ||
4957 | 334 | msgstr "Arrere" | ||
4958 | 335 | |||
4959 | 336 | #: ../music-app.qml:162 | ||
4960 | 337 | msgid "Go back to last page" | ||
4961 | 338 | msgstr "Torna a la pàgina anterior" | ||
4962 | 339 | |||
4963 | 340 | #: ../music-app.qml:170 | ||
4964 | 341 | msgid "Previous" | ||
4965 | 342 | msgstr "Anterior" | ||
4966 | 343 | |||
4967 | 344 | #: ../music-app.qml:171 | ||
4968 | 345 | msgid "Previous Track" | ||
4969 | 346 | msgstr "Tema anterior" | ||
4970 | 347 | |||
4971 | 348 | #: ../music-app.qml:176 | ||
4972 | 349 | msgid "Stop" | ||
4973 | 350 | msgstr "Para" | ||
4974 | 351 | |||
4975 | 352 | #: ../music-app.qml:177 | ||
4976 | 353 | msgid "Stop Playback" | ||
4977 | 354 | msgstr "Para la reproducció" | ||
4978 | 355 | |||
4979 | 356 | #: ../music-app.qml:185 | ||
4980 | 357 | msgid "Music Settings" | ||
4981 | 358 | msgstr "Paràmetres de la música" | ||
4982 | 359 | |||
4983 | 360 | #. TRANSLATORS: This string represents that the target destination filepath does not start with ~/Music/Imported/ | ||
4984 | 361 | #: ../music-app.qml:342 | ||
4985 | 362 | msgid "Filepath must start with" | ||
4986 | 363 | msgstr "El camí del fitxer ha de començar per" | ||
4987 | 364 | |||
4988 | 365 | #. TRANSLATORS: This string represents that a blank filepath destination has been used | ||
4989 | 366 | #: ../music-app.qml:368 | ||
4990 | 367 | msgid "Filepath must be a file" | ||
4991 | 368 | msgstr "El camí del fitxer ha d'apuntar a un fitxer" | ||
4992 | 369 | |||
4993 | 370 | #. TRANSLATORS: This string represents that there was failure moving the file to the target destination | ||
4994 | 371 | #: ../music-app.qml:374 | ||
4995 | 372 | msgid "Failed to move file" | ||
4996 | 373 | msgstr "Ha fallat el trasllat del fitxer" | ||
4997 | 374 | |||
4998 | 375 | #: ../music-app.qml:453 | ||
4999 | 376 | msgid "Waiting for file(s)..." | ||
5000 | 377 | msgstr "S'estan esperant els fitxers..." |