Merge lp:~ahayzen/music-app/single-expand into lp:music-app/trusty

Proposed by Andrew Hayzen
Status: Merged
Approved by: Daniel Holm
Approved revision: 204
Merged at revision: 206
Proposed branch: lp:~ahayzen/music-app/single-expand
Merge into: lp:music-app/trusty
Diff against target: 192 lines (+74/-8)
5 files modified
MusicAlbums.qml (+18/-2)
MusicArtists.qml (+17/-0)
MusicNowPlaying.qml (+4/-3)
MusicPlaylists.qml (+17/-1)
MusicTracks.qml (+18/-2)
To merge this branch: bzr merge lp:~ahayzen/music-app/single-expand
Reviewer Review Type Date Requested Status
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Music App Developers Pending
Review via email: mp+191227@code.launchpad.net

Commit message

* Only allow one expand to be visible at one time
* Fix for expandable toggle not visible on playlists

Description of the change

* Only allow one expand to be visible at one time
* Fix for expandable toggle not visible on playlists

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)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'MusicAlbums.qml'
2--- MusicAlbums.qml 2013-10-15 05:02:21 +0000
3+++ MusicAlbums.qml 2013-10-15 15:37:53 +0000
4@@ -285,6 +285,7 @@
5 }
6 else {
7 customdebug("clicked expand")
8+ collapseExpand(-1); // collapse all others
9 expandable.visible = true
10 track.height = styleMusic.albums.expandedHeight
11 }
12@@ -299,8 +300,23 @@
13 anchors.fill: parent
14 onClicked: {
15 customdebug("User pressed outside the playlist item and expanded items.")
16- }
17- }
18+ }
19+ }
20+
21+ Component.onCompleted: {
22+ collapseExpand.connect(onCollapseExpand);
23+ }
24+
25+ function onCollapseExpand(indexCol)
26+ {
27+ if ((indexCol === index || indexCol === -1) && expandable !== undefined && expandable.visible === true)
28+ {
29+ customdebug("auto collapse")
30+ expandable.visible = false
31+ track.height = styleMusic.albums.itemHeight
32+ }
33+ }
34+
35 // add to playlist
36 Rectangle {
37 id: playlistRow
38
39=== modified file 'MusicArtists.qml'
40--- MusicArtists.qml 2013-10-15 05:02:21 +0000
41+++ MusicArtists.qml 2013-10-15 15:37:53 +0000
42@@ -358,6 +358,7 @@
43 }
44 else {
45 customdebug("clicked expand")
46+ collapseExpand(-1); // collapse all others
47 expandable.visible = true
48 track.height = styleMusic.artists.expandedHeight
49 }
50@@ -374,6 +375,22 @@
51 customdebug("User pressed outside the playlist item and expanded items.")
52 }
53 }
54+
55+ Component.onCompleted: {
56+ collapseExpand.connect(onCollapseExpand);
57+ }
58+
59+ function onCollapseExpand(indexCol)
60+ {
61+ if ((indexCol === index || indexCol === -1) && expandable !== undefined && expandable.visible === true)
62+ {
63+ customdebug("auto collapse")
64+ expandable.visible = false
65+ track.height = styleMusic.artists.itemHeight
66+ }
67+ }
68+
69+
70 // add to playlist
71 Rectangle {
72 id: playlistRow
73
74=== modified file 'MusicNowPlaying.qml'
75--- MusicNowPlaying.qml 2013-10-15 05:02:21 +0000
76+++ MusicNowPlaying.qml 2013-10-15 15:37:53 +0000
77@@ -494,7 +494,7 @@
78 elide: Text.ElideRight
79 height: units.gu(1)
80 text: artist
81- fontSize: 'small'
82+ fontSize: 'small'
83 width: expandItem.x - x - units.gu(1.5)
84 x: trackImage.x + trackImage.width + units.gu(1)
85 y: trackImage.y + units.gu(1)
86@@ -505,7 +505,7 @@
87 elide: Text.ElideRight
88 height: units.gu(1)
89 text: title
90- fontSize: 'medium'
91+ fontSize: 'medium'
92 width: expandItem.x - x - units.gu(1.5)
93 x: trackImage.x + trackImage.width + units.gu(1)
94 y: nowPlayingArtist.y + nowPlayingArtist.height + units.gu(1.25)
95@@ -516,7 +516,7 @@
96 elide: Text.ElideRight
97 height: units.gu(1)
98 text: album
99- fontSize: 'x-small'
100+ fontSize: 'x-small'
101 width: expandItem.x - x - units.gu(1.5)
102 x: trackImage.x + trackImage.width + units.gu(1)
103 y: nowPlayingTitle.y + nowPlayingTitle.height + units.gu(1.25)
104@@ -549,6 +549,7 @@
105 }
106 else {
107 customdebug("clicked expand");
108+ collapseExpand(-1); // collapse all others first
109 expandable.visible = true;
110 queueListItem.cachedHeight = queueListItem.height;
111 queueListItem.height = queueListItem.state === "current" ? styleMusic.nowPlaying.expandedHeightCurrent : styleMusic.nowPlaying.expandedHeightNormal;
112
113=== modified file 'MusicPlaylists.qml'
114--- MusicPlaylists.qml 2013-10-15 05:02:21 +0000
115+++ MusicPlaylists.qml 2013-10-15 15:37:53 +0000
116@@ -282,6 +282,7 @@
117 }
118 else {
119 customdebug("clicked expand")
120+ collapseExpand(-1); // collapse all others
121 expandable.visible = true
122 playlist.height = styleMusic.playlists.expandedHeight
123 }
124@@ -294,6 +295,21 @@
125 color: "transparent"
126 height: styleMusic.common.expandHeight
127 visible: false
128+
129+ Component.onCompleted: {
130+ collapseExpand.connect(onCollapseExpand);
131+ }
132+
133+ function onCollapseExpand(indexCol)
134+ {
135+ if ((indexCol === index || indexCol === -1) && expandable !== undefined && expandable.visible === true)
136+ {
137+ customdebug("auto collapse")
138+ expandable.visible = false
139+ playlist.height = styleMusic.playlist.playlistItemHeight
140+ }
141+ }
142+
143 Rectangle {
144 id: editColumn
145 anchors.top: parent.top
146@@ -545,7 +561,7 @@
147 anchors.top: parent.top
148 anchors.topMargin: units.gu(4)
149 //name: "dropdown-menu" use for 1.0
150- source: expandable.visible ? "images/dropdown-menu-up.svg" : "images/dropdown-menu.svg"
151+ source: expandableInfo.visible ? "images/dropdown-menu-up.svg" : "images/dropdown-menu.svg"
152 height: styleMusic.common.expandedItem
153 width: styleMusic.common.expandedItem
154 }
155
156=== modified file 'MusicTracks.qml'
157--- MusicTracks.qml 2013-10-15 05:02:21 +0000
158+++ MusicTracks.qml 2013-10-15 15:37:53 +0000
159@@ -206,6 +206,7 @@
160 }
161 else {
162 customdebug("clicked expand")
163+ collapseExpand(-1); // collapse all others
164 expandable.visible = true
165 track.height = styleMusic.common.expandedHeight
166 Rotation: {
167@@ -227,8 +228,23 @@
168 anchors.fill: parent
169 onClicked: {
170 customdebug("User pressed outside the playlist item and expanded items.")
171- }
172- }
173+ }
174+ }
175+
176+ Component.onCompleted: {
177+ collapseExpand.connect(onCollapseExpand);
178+ }
179+
180+ function onCollapseExpand(indexCol)
181+ {
182+ if ((indexCol === index || indexCol === -1) && expandable !== undefined && expandable.visible === true)
183+ {
184+ customdebug("auto collapse")
185+ expandable.visible = false
186+ track.height = styleMusic.common.itemHeight
187+ }
188+ }
189+
190 // add to playlist
191 Rectangle {
192 id: playlistRow

Subscribers

People subscribed via source and target branches

to status/vote changes: