~ahayzen/music-app/remix-image-size-fix

« back to all changes in this revision

Viewing changes to common/BlurredHeader.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:
 
1
/*
 
2
 * Copyright (C) 2014
 
3
 *      Andrew Hayzen <ahayzen@gmail.com>
 
4
 *      Victor Thompson <victor.thompson@gmail.com>
 
5
 *
 
6
 * This program is free software; you can redistribute it and/or modify
 
7
 * it under the terms of the GNU General Public License as published by
 
8
 * the Free Software Foundation; version 3.
 
9
 *
 
10
 * This program is distributed in the hope that it will be useful,
 
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
 * GNU General Public License for more details.
 
14
 *
 
15
 * You should have received a copy of the GNU General Public License
 
16
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
17
 */
 
18
 
 
19
import QtQuick 2.3
 
20
import Ubuntu.Components 1.1
 
21
import Ubuntu.Components.ListItems 1.0 as ListItem
 
22
 
 
23
ListItem.Standard {
 
24
    id: albumInfo
 
25
    width: parent.width
 
26
 
 
27
    property alias bottomColumn: bottomColumnLoader.sourceComponent
 
28
    property alias coverSources: coversImage.covers
 
29
    property alias rightColumn: rightColumnLoader.sourceComponent
 
30
 
 
31
    BlurredBackground {
 
32
        id: blurredBackground
 
33
        height: parent.height
 
34
        art: coversImage.covers.length > 0
 
35
             ? (coversImage.covers[0].art !== undefined
 
36
                ? coversImage.covers[0].art
 
37
                : decodeURIComponent("image://albumart/artist=" + coversImage.covers[0].author + "&album=" + coversImage.covers[0].album))
 
38
             : Qt.resolvedUrl("../images/music-app-cover@30.png")
 
39
    }
 
40
 
 
41
    CoverGrid {
 
42
        id: coversImage
 
43
        anchors {
 
44
            bottomMargin: units.gu(2)
 
45
            left: parent.left
 
46
            leftMargin: units.gu(2)
 
47
            rightMargin: units.gu(2)
 
48
            top: parent.top
 
49
            topMargin: units.gu(3)
 
50
        }
 
51
        size: units.gu(18)
 
52
    }
 
53
 
 
54
    Loader {
 
55
        id: rightColumnLoader
 
56
        anchors {
 
57
            bottom: coversImage.bottom
 
58
            left: coversImage.right
 
59
            leftMargin: units.gu(2)
 
60
        }
 
61
    }
 
62
 
 
63
    Loader {
 
64
        id: bottomColumnLoader
 
65
        anchors {
 
66
            left: coversImage.left
 
67
            right: parent.right
 
68
            rightMargin: units.gu(2)
 
69
            top: coversImage.bottom
 
70
            topMargin: units.gu(1)
 
71
        }
 
72
    }
 
73
}