~vthompson/music-app/remix-empty-states-001

« back to all changes in this revision

Viewing changes to common/CardView.qml

* Add support for CardView in AlbumsPage.qml
* Add support for header property in CardView.qml
* Add BlurredHeader.qml
* Make AlbumsPage.qml and SongsPage.qml use BlurredHeader.qml.

Approved by Victor Thompson, Ubuntu Phone Apps Jenkins Bot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
Flickable {
23
23
    anchors {
24
24
        fill: parent
25
 
        margins: units.gu(1)
26
25
    }
27
26
 
28
27
    // dont use flow.contentHeight as it is inaccurate due to height of labels
29
28
    // changing as they load
30
 
    contentHeight: flow.childrenRect.height
 
29
    contentHeight: headerLoader.childrenRect.height + flowContainer.height
31
30
    contentWidth: width
32
31
 
33
32
    property alias count: flow.count
34
33
    property alias delegate: flow.delegate
 
34
    property alias header: headerLoader.sourceComponent
35
35
    property alias model: flow.model
36
36
    property real itemWidth: units.gu(15)
37
37
 
38
 
    ColumnFlow {
39
 
        id: flow
40
 
        columns: parseInt(width / itemWidth)
41
 
        width: parent.width
 
38
    Loader {
 
39
        id: headerLoader
 
40
        width: parent.width
 
41
    }
 
42
 
 
43
    Item {
 
44
        id: flowContainer
 
45
        anchors {
 
46
            top: headerLoader.bottom
 
47
        }
 
48
        height: flow.childrenRect.height + flow.anchors.margins * 2
 
49
        width: parent.width
 
50
 
 
51
        ColumnFlow {
 
52
            id: flow
 
53
            anchors {
 
54
                fill: parent
 
55
                margins: units.gu(1)
 
56
            }
 
57
 
 
58
            columns: parseInt(width / itemWidth)
 
59
        }
42
60
    }
43
61
}