Merge lp:~vthompson/music-app/now-playing-item-label into lp:music-app/trusty

Proposed by Victor Thompson
Status: Superseded
Proposed branch: lp:~vthompson/music-app/now-playing-item-label
Merge into: lp:music-app/trusty
Prerequisite: lp:~ahayzen/music-app/listitem-actions
Diff against target: 180 lines (+149/-1)
1 file modified
MusicNowPlaying.qml (+149/-1)
To merge this branch: bzr merge lp:~vthompson/music-app/now-playing-item-label
Reviewer Review Type Date Requested Status
Ubuntu Phone Apps Jenkins Bot continuous-integration Needs Fixing
Music App Developers Pending
Review via email: mp+226598@code.launchpad.net

This proposal has been superseded by a proposal from 2014-08-15.

Commit message

Place now playing item in a transparent label

Description of the change

Place now playing item in a transparent label. This is dependent upon the listitems-actions MP.

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: Needs Fixing (continuous-integration)
524. By Victor Thompson

merge prereq branch

525. By Victor Thompson

Update label width

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
526. By Victor Thompson

merge of prereq branch and resolve conflicts.

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Alan Pope 🍺🐧🐱 πŸ¦„ (popey) wrote :
Revision history for this message
Andrew Hayzen (ahayzen) wrote :
Revision history for this message
Victor Thompson (vthompson) wrote :

#unblocked

Unmerged revisions

526. By Victor Thompson

merge of prereq branch and resolve conflicts.

525. By Victor Thompson

Update label width

524. By Victor Thompson

merge prereq branch

523. By Victor Thompson

merge prereq branch

522. By Victor Thompson

Place now playing item in a transparent label

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-07-18 19:01:46 +0000
3+++ MusicNowPlaying.qml 2014-07-18 19:01:46 +0000
4@@ -94,7 +94,7 @@
5 }
6
7 property int normalHeight: units.gu(12)
8- property int currentHeight: units.gu(48)
9+ property int currentHeight: units.gu(40)
10 property int transitionDuration: 250 // transition length of animations
11
12 onCountChanged: {
13@@ -183,6 +183,7 @@
14 anchors.top: parent.top
15 height: (queueListItem.state === "current" ? queuelist.currentHeight - units.gu(8) : queuelist.normalHeight) - units.gu(2)
16 width: height
17+ radius: "medium"
18 image: Image {
19 source: "image://albumart/artist=" + model.author + "&album=" + model.album
20 onStatusChanged: {
21@@ -296,12 +297,159 @@
22 }
23 }
24
25+ onFocusChanged: {
26+ if (focus == false) {
27+ selected = false
28+ } else {
29+ selected = false
30+ }
31+ }
32+
33+ Rectangle {
34+ id: trackContainer;
35+ anchors {
36+ fill: parent
37+ margins: units.gu(0.5)
38+ }
39+ color: "transparent"
40+
41+ UbuntuShape {
42+ id: trackImage
43+ anchors.left: parent.left
44+ anchors.leftMargin: units.gu(1.5)
45+ anchors.top: parent.top
46+ height: (queueListItem.state === "current" ? queuelist.currentHeight : queuelist.normalHeight) - units.gu(2)
47+ width: height
48+ radius: "medium"
49+ image: Image {
50+ source: "image://albumart/artist=" + model.author + "&album=" + model.album
51+ onStatusChanged: {
52+ if (status === Image.Error) {
53+ source = Qt.resolvedUrl("images/music-app-cover@30.png")
54+ }
55+ }
56+ }
57+
58+ Item { // Background so can see text in current state
59+ id: albumBg
60+ visible: false
61+ anchors {
62+ bottom: parent.bottom
63+ left: parent.left
64+ right: parent.right
65+ }
66+ height: units.gu(9)
67+ clip: true
68+ UbuntuShape{
69+ anchors {
70+ bottom: parent.bottom
71+ left: parent.left
72+ right: parent.right
73+ }
74+ height: trackImage.height
75+ radius: "medium"
76+ color: styleMusic.common.black
77+ opacity: 0.6
78+ }
79+ }
80+
81+ function calcAnchors() {
82+ if (trackImage.height > queuelist.normalHeight && mainView.wideAspect) {
83+ trackImage.anchors.left = undefined
84+ trackImage.anchors.horizontalCenter = trackImage.parent.horizontalCenter
85+ } else {
86+ trackImage.anchors.left = trackImage.parent.left
87+ trackImage.anchors.horizontalCenter = undefined
88+ }
89+
90+ trackImage.width = trackImage.height; // force width to match height
91+ }
92+
93+ Connections {
94+ target: mainView
95+ onWideAspectChanged: trackImage.calcAnchors()
96+ }
97+
98+ onHeightChanged: {
99+ calcAnchors()
100+ }
101+ Behavior on height {
102+ NumberAnimation {
103+ target: trackImage;
104+ property: "height";
105+ duration: queuelist.transitionDuration;
106+ }
107+ }
108+ }
109+ Label {
110+ id: nowPlayingArtist
111+ objectName: "nowplayingartist"
112+ color: styleMusic.nowPlaying.labelSecondaryColor
113+ elide: Text.ElideRight
114+ height: units.gu(1)
115+ text: model.author
116+ fontSize: 'small'
117+ width: parent.width - trackImage.width - units.gu(3.5)
118+ x: trackImage.x + trackImage.width + units.gu(1)
119+ y: trackImage.y + units.gu(1)
120+ }
121+ Label {
122+ id: nowPlayingTitle
123+ objectName: "nowplayingtitle"
124+ color: styleMusic.common.white
125+ elide: Text.ElideRight
126+ height: units.gu(1)
127+ text: model.title
128+ fontSize: 'medium'
129+ width: parent.width - trackImage.width - units.gu(3.5)
130+ x: trackImage.x + trackImage.width + units.gu(1)
131+ y: nowPlayingArtist.y + nowPlayingArtist.height + units.gu(1.25)
132+ }
133+ Label {
134+ id: nowPlayingAlbum
135+ objectName: "nowplayingalbum"
136+ color: styleMusic.nowPlaying.labelSecondaryColor
137+ elide: Text.ElideRight
138+ height: units.gu(1)
139+ text: model.album
140+ fontSize: 'x-small'
141+ width: parent.width - trackImage.width - units.gu(3.5)
142+ x: trackImage.x + trackImage.width + units.gu(1)
143+ y: nowPlayingTitle.y + nowPlayingTitle.height + units.gu(1.25)
144+ }
145+ }
146+
147 states: State {
148 name: "current"
149 PropertyChanges {
150 target: queueListItem
151 height: queuelist.currentHeight
152 }
153+ PropertyChanges {
154+ target: nowPlayingArtist
155+ width: trackImage.width - units.gu(4)
156+ x: trackImage.x + units.gu(2)
157+ y: trackImage.y + trackImage.height - albumBg.height + units.gu(1)
158+ color: styleMusic.common.white
159+ }
160+ PropertyChanges {
161+ target: nowPlayingTitle
162+ width: trackImage.width - units.gu(4)
163+ x: trackImage.x + units.gu(2)
164+ y: nowPlayingArtist.y + nowPlayingArtist.height + units.gu(1.25)
165+ color: styleMusic.common.white
166+ }
167+ PropertyChanges {
168+ target: nowPlayingAlbum
169+ width: trackImage.width - units.gu(4)
170+ x: trackImage.x + units.gu(2)
171+ y: nowPlayingTitle.y + nowPlayingTitle.height + units.gu(1.25)
172+ color: styleMusic.common.white
173+ }
174+ PropertyChanges {
175+ target: albumBg
176+ visible: true
177+ }
178 }
179 transitions: Transition {
180 from: ",current"

Subscribers

People subscribed via source and target branches

to status/vote changes: