mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-09-02 10:24:01 +02:00
fix pathview area and currentIndex
This commit is contained in:
@@ -8,7 +8,7 @@ PathView {
|
||||
// The start coordinates for the covers
|
||||
// Default is left, centered in height
|
||||
property int pathStartX: 0
|
||||
property int pathStartY: height / 2
|
||||
property int pathStartY: height
|
||||
|
||||
// The size of the covers in the path
|
||||
property int coverSize: 100
|
||||
@@ -21,8 +21,8 @@ PathView {
|
||||
// emitted when a cover is clicked
|
||||
signal itemPlayPauseClicked(int index)
|
||||
|
||||
// preferredHighlightBegin: 0.2 // scene.width / 11000
|
||||
// preferredHighlightEnd: preferredHighlightBegin
|
||||
preferredHighlightBegin: 0.2 // scene.width / 11000
|
||||
preferredHighlightEnd: preferredHighlightBegin
|
||||
pathItemCount: 5
|
||||
//highlightMoveDuration: 500
|
||||
|
||||
@@ -42,7 +42,7 @@ PathView {
|
||||
scale: PathView.itemScale
|
||||
itemBrightness: PathView.itemBrightness
|
||||
opacity: PathView.itemOpacity
|
||||
z: -x
|
||||
z: coverView.width - x
|
||||
|
||||
onPlayClicked: {
|
||||
console.log("***************")
|
||||
@@ -58,24 +58,22 @@ PathView {
|
||||
startX: coverView.pathStartX
|
||||
startY: coverView.pathStartY
|
||||
|
||||
PathAttribute { name: "itemOpacity"; value: 0 }
|
||||
PathAttribute { name: "itemBrightness"; value: 0 }
|
||||
PathAttribute { name: "itemScale"; value: 2 }
|
||||
|
||||
PathLine { x: coverView.width / 4; y: coverView.height / 4 * 3}
|
||||
PathPercent { value: 0.1 }
|
||||
PathAttribute { name: "itemOpacity"; value: 0 }
|
||||
PathAttribute { name: "itemBrightness"; value: 1 }
|
||||
PathAttribute { name: "itemScale"; value: 1.5 }
|
||||
|
||||
PathLine { x: coverView.width / 2; y: coverView.height / 2}
|
||||
PathPercent { value: 0.2 }
|
||||
PathAttribute { name: "itemOpacity"; value: 1 }
|
||||
PathAttribute { name: "itemBrightness"; value: 1 }
|
||||
PathAttribute { name: "itemScale"; value: 1 }
|
||||
// PathLine { x: coverView.pathStartX * 0.9 ; y: coverView.pathStartY * 0.9 }
|
||||
// PathPercent { value: .2 }
|
||||
// PathAttribute { name: "itemOpacity"; value: 1 }
|
||||
// PathAttribute { name: "itemBrightness"; value: 1 }
|
||||
// PathAttribute { name: "itemScale"; value: 1 }
|
||||
// PathLine { x: coverView.pathStartX * .5; y: coverView.pathStartY * .5}
|
||||
// PathPercent { value: .3 }
|
||||
// PathAttribute { name: "itemOpacity"; value: 1 }
|
||||
// PathAttribute { name: "itemBrightness"; value: 1 }
|
||||
// PathAttribute { name: "itemScale"; value: 0.5 }
|
||||
// // PathLine { x: coverView.pathStartX * .25 ; y: coverView.pathStartY * .25 }
|
||||
// // PathPercent { value: .75 }
|
||||
// // PathAttribute { name: "itemOpacity"; value: 1 }
|
||||
// // PathAttribute { name: "itemBrightness"; value: .5 }
|
||||
// // PathAttribute { name: "itemScale"; value: 0.4 }
|
||||
|
||||
PathLine { x: coverView.width; y: 0 }
|
||||
PathPercent { value: 1 }
|
||||
PathAttribute { name: "itemOpacity"; value: 1 }
|
||||
|
@@ -71,7 +71,7 @@ Item {
|
||||
radius: 3
|
||||
gradient: Gradient {
|
||||
GradientStop { position: 0.0; color: "#00000000" }
|
||||
GradientStop { position: 0.5; color: "black" }
|
||||
GradientStop { position: 0.75; color: "black" }
|
||||
GradientStop { position: 1.0; color: "black" }
|
||||
}
|
||||
}
|
||||
@@ -86,16 +86,18 @@ Item {
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
elide: Text.ElideRight
|
||||
opacity: showLabels ? 1 : 0
|
||||
font.pixelSize: root.height / 15
|
||||
}
|
||||
Text {
|
||||
id: artistText
|
||||
color: "white"
|
||||
text: artistName
|
||||
anchors { left: parent.left; right: parent.right; bottom: parent.bottom }
|
||||
anchors.margins: 2
|
||||
anchors.margins: root.height / 20
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
elide: Text.ElideRight
|
||||
opacity: showLabels ? 1 : 0
|
||||
font.pixelSize: root.height / 15
|
||||
}
|
||||
}
|
||||
|
||||
@@ -156,6 +158,8 @@ Item {
|
||||
visible: showPlayButton ? (mouseArea.containsMouse || currentlyPlaying) : false
|
||||
source: currentlyPlaying ? "../images/pause-rest.png" : "../images/play-rest.png"
|
||||
anchors.centerIn: parent
|
||||
height: mirroredCover.height / 5
|
||||
width: height
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: {
|
||||
|
@@ -9,25 +9,6 @@ Item {
|
||||
signal configure()
|
||||
|
||||
|
||||
CoverFlip {
|
||||
id: coverView
|
||||
anchors {
|
||||
top: parent.top
|
||||
right: parent.right
|
||||
bottom:parent.bottom
|
||||
}
|
||||
width: parent.width / 2
|
||||
|
||||
backgroundColor: scene.color
|
||||
|
||||
model: dynamicModel
|
||||
|
||||
onItemPlayPauseClicked: {
|
||||
rootView.playItem(index)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Item {
|
||||
anchors { top: parent.top; left: parent.left; bottom: parent.bottom }
|
||||
anchors.margins: 50
|
||||
@@ -51,7 +32,6 @@ Item {
|
||||
text: rootView.title
|
||||
}
|
||||
}
|
||||
|
||||
Column {
|
||||
anchors.right: parent.right
|
||||
anchors.left: parent.left
|
||||
@@ -67,41 +47,6 @@ Item {
|
||||
text: "Now Playing:"
|
||||
visible: currentlyPlayedIndex !== -1
|
||||
}
|
||||
Rectangle {
|
||||
height: image.height + image.height / 5
|
||||
width: image.width + startPlayingText.width * 1.2
|
||||
radius: height / 2
|
||||
border.width: 2
|
||||
border.color: "white"
|
||||
color: startPlayingMouseArea.containsMouse ? "blue" : "gray"
|
||||
visible: currentlyPlayedIndex === -1
|
||||
Image {
|
||||
id: image
|
||||
source: "../images/play-rest.png"
|
||||
anchors.left: parent.left
|
||||
anchors.margins: 10
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
Text {
|
||||
id: startPlayingText
|
||||
color: "white"
|
||||
font.pointSize: 20
|
||||
anchors.left: image.right
|
||||
anchors.margins: height / 5
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
//width: parent.width - 30 - image.width
|
||||
elide: Text.ElideRight
|
||||
text: "Start playing"
|
||||
}
|
||||
MouseArea {
|
||||
id: startPlayingMouseArea
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
onClicked: echonestStation.playItem( 0 );
|
||||
}
|
||||
}
|
||||
|
||||
Text {
|
||||
color: "white"
|
||||
font.pointSize: 16
|
||||
@@ -126,6 +71,25 @@ Item {
|
||||
}
|
||||
}
|
||||
|
||||
CoverFlip {
|
||||
id: coverView
|
||||
anchors.fill: parent
|
||||
|
||||
backgroundColor: scene.color
|
||||
|
||||
model: dynamicModel
|
||||
currentIndex: currentlyPlayedIndex
|
||||
|
||||
onItemPlayPauseClicked: {
|
||||
rootView.playItem(index)
|
||||
}
|
||||
|
||||
onItemClicked: {
|
||||
rootView.playItem(index)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Button {
|
||||
id: configureButton
|
||||
anchors.bottom: parent.bottom
|
||||
|
Reference in New Issue
Block a user