mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-09-08 21:20:45 +02:00
experiment
This commit is contained in:
@@ -27,6 +27,7 @@ PathView {
|
|||||||
//highlightMoveDuration: 500
|
//highlightMoveDuration: 500
|
||||||
|
|
||||||
delegate: CoverImage {
|
delegate: CoverImage {
|
||||||
|
id: coverDelegate
|
||||||
height: root.coverSize
|
height: root.coverSize
|
||||||
width: root.coverSize
|
width: root.coverSize
|
||||||
backgroundColor: coverView.backgroundColor
|
backgroundColor: coverView.backgroundColor
|
||||||
@@ -44,6 +45,10 @@ PathView {
|
|||||||
opacity: PathView.itemOpacity
|
opacity: PathView.itemOpacity
|
||||||
z: coverView.width - x
|
z: coverView.width - x
|
||||||
|
|
||||||
|
property int _origX
|
||||||
|
property int _origY
|
||||||
|
property int _origZ
|
||||||
|
|
||||||
onPlayClicked: {
|
onPlayClicked: {
|
||||||
console.log("***************")
|
console.log("***************")
|
||||||
coverView.itemPlayPauseClicked(index)
|
coverView.itemPlayPauseClicked(index)
|
||||||
@@ -52,6 +57,40 @@ PathView {
|
|||||||
onClicked: {
|
onClicked: {
|
||||||
coverView.itemClicked(index)
|
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 {
|
path: Path {
|
||||||
|
@@ -36,6 +36,8 @@ Item {
|
|||||||
signal playClicked()
|
signal playClicked()
|
||||||
// will be emitted when the cover is clicked
|
// will be emitted when the cover is clicked
|
||||||
signal clicked()
|
signal clicked()
|
||||||
|
// will be emitted when the cover is hovered by the mouse
|
||||||
|
property alias containsMouse: mouseArea.containsMouse
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
id: mouseArea
|
id: mouseArea
|
||||||
@@ -46,7 +48,6 @@ Item {
|
|||||||
print("Cover clicked");
|
print("Cover clicked");
|
||||||
root.clicked();
|
root.clicked();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Component {
|
Component {
|
||||||
|
Reference in New Issue
Block a user