on xenial help sign in
Added artist label
commit3ca75207bed9b3b32092cc7283299941bd606ed9 authorAndrea Cimitan <andrea.cimitan@gmail.com> dateThu 30 Jan 2014, 11:36 (13 years ago) parenta381363
2 files changed+37−11
qml/Dash/Previews/AudioPlayer.qml+36−10 tests/qmltests/Dash/Previews/tst_AudioPlayer.qml+1−1
qml/Dash/Previews/AudioPlayer.qml+36−10
@@ -99,18 +99,44 @@ Item {
9999 }
100100 }
101101
102− Label {
103− objectName: "trackTitleLabel"
104− fontSize: "small"
105− opacity: 0.9
106− color: "white"
107− horizontalAlignment: Text.AlignLeft
102+ Item {
108103 anchors.verticalCenter: parent.verticalCenter
109104 width: parent.column2Width
110− text: modelData["title"]
111− style: Text.Raised
112− styleColor: "black"
113− elide: Text.ElideRight
105+ height: trackArtistLabel.visible ? trackTitleLabel.height + trackArtistLabel.height : trackTitleLabel.height
106+
107+ Label {
108+ id: trackTitleLabel
109+ objectName: "trackTitleLabel"
110+ anchors.top: parent.top
111+ anchors.left: parent.left
112+ anchors.right: parent.right
113+ fontSize: "small"
114+ opacity: 0.9
115+ color: "white"
116+ horizontalAlignment: Text.AlignLeft
117+ text: modelData["title"]
118+ style: Text.Raised
119+ styleColor: "black"
120+ elide: Text.ElideRight
121+ }
122+
123+ Label {
124+ id: trackArtistLabel
125+ objectName: "trackArtistLabel"
126+ fontSize: "small"
127+ opacity: 0.9
128+ color: "white"
129+ horizontalAlignment: Text.AlignLeft
130+ anchors.top: trackTitleLabel.bottom
131+ anchors.left: parent.left
132+ anchors.right: parent.right
133+ width: parent.column2Width
134+ text: modelData["artist"]
135+ style: Text.Raised
136+ styleColor: "black"
137+ elide: Text.ElideRight
138+ visible: modelData["artist"] !== undefined
139+ }
114140
115141 UbuntuShape {
116142 id: progressBarFill
tests/qmltests/Dash/Previews/tst_AudioPlayer.qml+1−1
@@ -36,7 +36,7 @@ Rectangle {
3636
3737 property var tracksModel2: [
3838 { title: "Some track name", length: "30", source: "../../tests/qmltests/Dash/Music/data/testsound1.ogg" },
39− { title: "Some other track name", length: "83", source: "../../tests/qmltests/Dash/Music/data/testsound2.ogg" },
39+ { title: "Some other track name", artist: "Artist name", length: "83", source: "../../tests/qmltests/Dash/Music/data/testsound2.ogg" },
4040 { title: "And another one", length: "7425", source: "../../tests/qmltests/Dash/Music/data/testsound3.ogg" }
4141 ]
4242