Merge lp:~ahayzen/music-app/remix-remove-jumping-fix-1379894 into lp:music-app/remix

Proposed by Andrew Hayzen
Status: Merged
Approved by: Victor Thompson
Approved revision: 668
Merged at revision: 665
Proposed branch: lp:~ahayzen/music-app/remix-remove-jumping-fix-1379894
Merge into: lp:music-app/remix
Diff against target: 129 lines (+10/-46)
2 files modified
MusicNowPlaying.qml (+9/-42)
music-app.qml (+1/-4)
To merge this branch: bzr merge lp:~ahayzen/music-app/remix-remove-jumping-fix-1379894
Reviewer Review Type Date Requested Status
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Victor Thompson Approve
Review via email: mp+238051@code.launchpad.net

Commit message

* Switch to use positionAt when isListView becomes true
* Strip out jumpTo/ensureVisible code for the now playing queue
* Fix for console errors when pressing items in queue

Description of the change

* Switch to use positionAt when isListView becomes true
* Strip out jumpTo/ensureVisible code for the now playing queue
* Fix for console errors when pressing items in queue

To post a comment you must log in.
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Victor Thompson (vthompson) wrote :

One inline comment so far.

review: Needs Fixing
665. By Andrew Hayzen

* Put positionAt back in and ensure Ctrl+J shows the queue

666. By Andrew Hayzen

* Switch to using ListView.Center

667. By Andrew Hayzen

* Switch to use positionAt when isListView becomes true

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
668. By Andrew Hayzen

* Don't use highlight as causes the queue to jump

Revision history for this message
Victor Thompson (vthompson) wrote :

LGTM!

review: Approve
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'MusicNowPlaying.qml'
2--- MusicNowPlaying.qml 2014-10-10 20:05:14 +0000
3+++ MusicNowPlaying.qml 2014-10-11 17:28:37 +0000
4@@ -33,9 +33,14 @@
5 title: isListView ? i18n.tr("Queue") : i18n.tr("Now playing")
6 visible: false
7
8- property int ensureVisibleIndex: 0 // ensure first index is visible at startup
9 property bool isListView: false
10
11+ onIsListViewChanged: {
12+ if (isListView) {
13+ positionAt(player.currentIndex);
14+ }
15+ }
16+
17 head.backAction: Action {
18 iconName: "back";
19 objectName: "backButton"
20@@ -60,36 +65,8 @@
21 ]
22 }
23
24- Connections {
25- target: player
26- onCurrentIndexChanged: {
27- if (player.source === "") {
28- return;
29- }
30-
31- queuelist.currentIndex = player.currentIndex;
32-
33- customdebug("MusicQueue update currentIndex: " + player.source);
34-
35- // TODO: Never jump to track? Or only jump to track in queue view?
36- if (isListView) {
37- nowPlaying.jumpToCurrent(musicToolbar.opened, nowPlaying, musicToolbar.currentTab)
38- }
39- }
40- }
41-
42- function jumpToCurrent(shown, currentPage, currentTab)
43- {
44- // If the toolbar is shown, the page is now playing and snaptrack is enabled
45- if (shown && currentPage === nowPlaying && Settings.getSetting("snaptrack") === "1")
46- {
47- // Then position the view at the current index
48- queuelist.positionViewAtIndex(queuelist.currentIndex, ListView.Beginning);
49- }
50- }
51-
52 function positionAt(index) {
53- queuelist.positionViewAtIndex(index, ListView.Beginning);
54+ queuelist.positionViewAtIndex(index, ListView.Center);
55 }
56
57 Rectangle {
58@@ -402,13 +379,6 @@
59 height: mainView.height - (styleMusic.common.expandHeight + queuelist.currentHeight) + units.gu(8)
60 }
61 model: trackQueue.model
62- highlightFollowsCurrentItem: true
63- highlightMoveDuration: 0
64- highlight: Rectangle {
65- color: "#2c2c34"
66- focus: true
67- }
68-
69 objectName: "nowPlayingQueueList"
70 state: "normal"
71 states: [
72@@ -440,7 +410,7 @@
73 id: queueDelegate
74 ListItemWithActions {
75 id: queueListItem
76- color: "transparent"
77+ color: player.currentIndex === index ? "#2c2c34" : "transparent"
78 height: queuelist.normalHeight
79 objectName: "nowPlayingListItem" + index
80 showDivider: false
81@@ -495,9 +465,6 @@
82 }
83 }
84
85- // TODO: If http://pad.lv/1354753 is fixed to expose whether the Shape should appear pressed, update this as well.
86- onPressedChanged: trackImage.pressed = pressed
87-
88 Rectangle {
89 id: trackContainer;
90 anchors {
91@@ -529,7 +496,7 @@
92 column: Column {
93 Label {
94 id: trackTitle
95- color: queuelist.currentIndex === index ? UbuntuColors.blue
96+ color: player.currentIndex === index ? UbuntuColors.blue
97 : styleMusic.common.music
98 fontSize: "small"
99 objectName: "titleLabel"
100
101=== modified file 'music-app.qml'
102--- music-app.qml 2014-10-09 02:17:21 +0000
103+++ music-app.qml 2014-10-11 17:28:37 +0000
104@@ -90,7 +90,7 @@
105 break;
106 case Qt.Key_J: // Ctrl+J Jump to playing song
107 tabs.pushNowPlaying()
108- nowPlaying.positionAt(player.currentIndex);
109+ nowPlaying.isListView = true;
110 break;
111 case Qt.Key_N: // Ctrl+N Show now playing
112 tabs.pushNowPlaying()
113@@ -665,7 +665,6 @@
114
115 // Show the Now Playing page and make sure the track is visible
116 tabs.pushNowPlaying();
117- nowPlaying.ensureVisibleIndex = index;
118 }
119 else {
120 player.source = file;
121@@ -684,8 +683,6 @@
122 if (!nowPlaying.isListView) {
123 tabs.pushNowPlaying();
124 }
125-
126- nowPlaying.ensureVisibleIndex = index;
127 }
128
129 function playRandomSong(shuffle)

Subscribers

People subscribed via source and target branches