From 967631b30c20280d0f390f9762dc41f23b053487 Mon Sep 17 00:00:00 2001 From: Michael Zanetti Date: Sun, 25 Nov 2012 23:17:48 +0100 Subject: [PATCH] pimped cover gradient --- data/qml/CoverImage.qml | 42 +++++++++++++++++---------------------- data/qml/StationScene.qml | 3 ++- 2 files changed, 20 insertions(+), 25 deletions(-) diff --git a/data/qml/CoverImage.qml b/data/qml/CoverImage.qml index 2b4b3466f..c6da8b7f3 100644 --- a/data/qml/CoverImage.qml +++ b/data/qml/CoverImage.qml @@ -64,17 +64,28 @@ Item { source: "image://albumart/" + artworkId } + Rectangle { + id: itemGlow + color: "white" + anchors.fill: parent + + opacity: mouseArea.containsMouse ? .2 : 0 + + Behavior on opacity { + NumberAnimation { easing.type: Easing.Linear; duration: 300 } + } + } + Rectangle { id: textBackground anchors { left: parent.left; right: parent.right; bottom: parent.bottom } anchors.margins: -1 - height: (artistText.height + trackText.height) * 2 - opacity: 1// showLabels ? 1 : 0 - radius: 3 + height: (artistText.height + trackText.height) * 3 + opacity: showLabels ? 1 : 0 gradient: Gradient { GradientStop { position: 0.0; color: "#00000000" } - GradientStop { position: 0.75; color: "black" } - GradientStop { position: 1.0; color: "black" } + GradientStop { position: 0.6; color: "#E1000000" } + GradientStop { position: 1.0; color: "#E1000000" } } } @@ -93,13 +104,14 @@ Item { Text { id: artistText color: "white" + font.bold: trackText.text.length == 0 text: artistName anchors { left: parent.left; right: parent.right; bottom: parent.bottom } anchors.margins: root.height / 20 horizontalAlignment: Text.AlignHCenter elide: Text.ElideRight opacity: showLabels ? 1 : 0 - font.pixelSize: root.height / 15 + font.pixelSize: trackText.text.length == 0 ? root.height / 10 : root.height / 15 } } @@ -139,24 +151,6 @@ Item { } } - Rectangle { - id: itemGlow - color: "white" - anchors.fill: parent - anchors.bottomMargin: - parent.height - - // scaling might be off a pixel... make sure that the shadow is at least as large as the image - anchors.leftMargin: -2 - anchors.rightMargin: -2 - anchors.topMargin: -2 - - opacity: mouseArea.containsMouse ? .2 : 0 - - Behavior on opacity { - NumberAnimation { easing.type: Easing.Linear; duration: 300 } - } - } - Rectangle { id: mirrorShadow color: parent.backgroundColor diff --git a/data/qml/StationScene.qml b/data/qml/StationScene.qml index ef99a338a..d5ff6c94c 100644 --- a/data/qml/StationScene.qml +++ b/data/qml/StationScene.qml @@ -71,12 +71,13 @@ Rectangle { cellHeight: cellWidth delegate: Item { - height: gridView.cellHeight * .9 + height: gridView.cellHeight// * .9 width: height CoverImage { artistName: modelData anchors.fill: parent + showPlayButton: true onClicked: { rootView.startStationFromArtist(modelData);