1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-11 16:44:05 +02:00

make reflection look nice in pathview and remove it from gridview

This commit is contained in:
Michael Zanetti
2012-07-02 00:58:08 +02:00
parent fc69e7d08d
commit fb0a88aa98

View File

@@ -8,18 +8,12 @@ Rectangle {
Component { Component {
id: appDelegate id: pathDelegate
Item { Item {
width: 100; height: 100 width: 100; height: 100
scale: PathView.iconScale scale: PathView.iconScale
// Use Image provider here // TODO: Use Image provider here
// Image {
// id: myIcon
// y: 20; anchors.horizontalCenter: parent.horizontalCenter
// source: icon
// smooth: true
// }
Image { Image {
id: originalImage id: originalImage
width: 80 width: 80
@@ -62,7 +56,7 @@ Rectangle {
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
gradient: Gradient { gradient: Gradient {
// TODO: no clue how to get the RGB component of the container rectangle color // TODO: no clue how to get the RGB component of the container rectangle color
GradientStop { position: 1.0; color: Qt.rgba(1,1,1,0.4) } GradientStop { position: 1.0; color: Qt.rgba(0,0,0,0.4) }
GradientStop { position: 0.3; color: reflectionContainer.color } GradientStop { position: 0.3; color: reflectionContainer.color }
} }
} }
@@ -90,7 +84,7 @@ Rectangle {
preferredHighlightEnd: 0.5 preferredHighlightEnd: 0.5
focus: true focus: true
model: albumsModel model: albumsModel
delegate: appDelegate delegate: pathDelegate
pathItemCount: 8 pathItemCount: 8
path: Path { path: Path {
startX: 10 startX: 10
@@ -103,13 +97,43 @@ Rectangle {
} }
} }
Component {
id: gridDelegate
Item {
width: 100; height: 100
scale: PathView.iconScale
// TODO: Use Image provider here
Image {
id: originalImage
width: 80
height: 80
source: index % 2 === 0 ? "http://www.muktware.com/sites/default/files/images/applications/tomahawk_icon.png" : "http://cloud.ohloh.net/attachments/53867/tomahawk-icon-64x64_med.png"
}
Text {
anchors { top: myIcon.bottom; horizontalCenter: parent.horizontalCenter }
text: label
smooth: true
color: "white"
}
MouseArea {
anchors.fill: parent
onClicked: view.currentIndex = index
}
}
}
GridView { GridView {
id: grid id: grid
anchors { left: parent.left; top: view.bottom; right: parent.right; bottom: parent.bottom } anchors { left: parent.left; top: view.bottom; right: parent.right; bottom: parent.bottom }
model: albumsModel model: albumsModel
delegate: appDelegate delegate: gridDelegate
} }
} }