1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-09-01 18:04:05 +02:00

pimped cover gradient

This commit is contained in:
Michael Zanetti
2012-11-25 23:17:48 +01:00
parent 8899a38053
commit 967631b30c
2 changed files with 20 additions and 25 deletions

View File

@@ -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

View File

@@ -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);