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

experiment

This commit is contained in:
Michael Zanetti
2012-11-25 04:50:09 +01:00
parent ffa6f4ebaa
commit 2e2a566061
2 changed files with 41 additions and 1 deletions

View File

@@ -27,6 +27,7 @@ PathView {
//highlightMoveDuration: 500
delegate: CoverImage {
id: coverDelegate
height: root.coverSize
width: root.coverSize
backgroundColor: coverView.backgroundColor
@@ -44,6 +45,10 @@ PathView {
opacity: PathView.itemOpacity
z: coverView.width - x
property int _origX
property int _origY
property int _origZ
onPlayClicked: {
console.log("***************")
coverView.itemPlayPauseClicked(index)
@@ -52,6 +57,40 @@ PathView {
onClicked: {
coverView.itemClicked(index)
}
function newZ() {
return z;
}
onContainsMouseChanged: {
if (containsMouse) {
_origX = x;
_origY = y;
_origZ = z;
}
}
states: [
State {
name: "hovered"; when: coverDelegate.containsMouse && index !== currentIndex
PropertyChanges {
target: coverDelegate
x: _origX + coverDelegate.width * coverDelegate.scale / 2
z: _origZ
}
}
]
transitions: [
Transition {
NumberAnimation {
properties: "x"
duration: 300
easing.type: Easing.InOutSine
}
}
]
}
path: Path {

View File

@@ -36,6 +36,8 @@ Item {
signal playClicked()
// will be emitted when the cover is clicked
signal clicked()
// will be emitted when the cover is hovered by the mouse
property alias containsMouse: mouseArea.containsMouse
MouseArea {
id: mouseArea
@@ -46,7 +48,6 @@ Item {
print("Cover clicked");
root.clicked();
}
}
Component {