3
* Andrew Hayzen <ahayzen@gmail.com>
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License as published by
7
* the Free Software Foundation; version 3.
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with this program. If not, see <http://www.gnu.org/licenses/>.
19
import Ubuntu.Components 1.1
25
height: cardColumn.childrenRect.height + 2 * bg.anchors.margins
27
property alias imageSource: image.source
28
property alias primaryText: primaryLabel.text
29
property alias secondaryText: secondaryLabel.text
31
signal clicked(var mouse)
32
signal pressAndHold(var mouse)
36
UbuntuNumberAnimation {
42
UbuntuNumberAnimation {
48
UbuntuNumberAnimation {
54
UbuntuNumberAnimation {
59
/* Background for card */
69
/* Column containing image and labels */
75
spacing: units.gu(0.5)
83
if (status === Image.Error) {
84
source = Qt.resolvedUrl("../images/music-app-cover@30.png")
99
leftMargin: units.gu(1)
101
rightMargin: units.gu(1)
104
elide: Text.ElideRight
107
wrapMode: Text.WordWrap
114
leftMargin: units.gu(1)
116
rightMargin: units.gu(1)
119
elide: Text.ElideRight
122
wrapMode: Text.WordWrap
127
height: units.gu(1.5)
132
/* Overlay for when card is pressed */
141
Behavior on opacity {
142
UbuntuNumberAnimation {
148
/* Capture mouse events */
153
onClicked: card.clicked(mouse)
154
onPressAndHold: card.pressAndHold(mouse)
155
onPressedChanged: overlay.opacity = pressed ? 0.3 : 0