~vthompson/music-app/lookup-file

« back to all changes in this revision

Viewing changes to common/CoverRow.qml

  • Committer: Nekhelesh Ramananthan
  • Date: 2014-01-09 00:43:35 UTC
  • mto: This revision was merged to the branch mainline in revision 298.
  • Revision ID: krnekhelesh@gmail.com-20140109004335-zs528besph3okml8
Corrected cover row component to match design spec

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
import QtQuick 2.0
18
18
import Ubuntu.Components 0.1
19
19
 
20
 
Row {
 
20
UbuntuShape {
21
21
    id: coverRow
22
22
 
23
23
    // Property (array) to store the cover images
29
29
    // Property to get the playlist count to determine the visibility of a cover image
30
30
    property int count
31
31
 
32
 
    Repeater {
33
 
        model: 4
34
 
        delegate: UbuntuShape {
35
 
            height: coverRow.size
36
 
            width: height
37
 
            visible: coverRow.count > index
38
 
            image: Image {
 
32
    width: size
 
33
    height: size
 
34
    radius: "medium"
 
35
    image: finalImageRender
 
36
 
 
37
    // Component to assemble the pictures in a row with appropriate spacing.
 
38
    Row {
 
39
        id: imageRow
 
40
 
 
41
        width: coverRow.size
 
42
        height: width
 
43
 
 
44
        spacing: -coverRow.size + units.gu(1)
 
45
 
 
46
        Repeater {
 
47
            id: repeat
 
48
            model: 4
 
49
            delegate: Image {
 
50
                width: coverRow.size
 
51
                height: width
 
52
                visible: coverRow.count > index
39
53
                source: coverRow.covers[index] !== "" ? coverRow.covers[index] : Qt.resolvedUrl("../images/cover_default_icon.png")
40
54
            }
41
55
        }
42
56
    }
 
57
 
 
58
    // Component to render the cover images as one image which is then passed as argument to the Ubuntu Shape widget.
 
59
    ShaderEffectSource {
 
60
        id: finalImageRender
 
61
        sourceItem: imageRow
 
62
        width: units.gu(1)
 
63
        height: width
 
64
        anchors.centerIn: parent
 
65
        hideSource: true
 
66
    }
43
67
}
 
68