mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-09-03 02:42:52 +02:00
fix pathview area and currentIndex
This commit is contained in:
@@ -8,7 +8,7 @@ PathView {
|
|||||||
// The start coordinates for the covers
|
// The start coordinates for the covers
|
||||||
// Default is left, centered in height
|
// Default is left, centered in height
|
||||||
property int pathStartX: 0
|
property int pathStartX: 0
|
||||||
property int pathStartY: height / 2
|
property int pathStartY: height
|
||||||
|
|
||||||
// The size of the covers in the path
|
// The size of the covers in the path
|
||||||
property int coverSize: 100
|
property int coverSize: 100
|
||||||
@@ -21,8 +21,8 @@ PathView {
|
|||||||
// emitted when a cover is clicked
|
// emitted when a cover is clicked
|
||||||
signal itemPlayPauseClicked(int index)
|
signal itemPlayPauseClicked(int index)
|
||||||
|
|
||||||
// preferredHighlightBegin: 0.2 // scene.width / 11000
|
preferredHighlightBegin: 0.2 // scene.width / 11000
|
||||||
// preferredHighlightEnd: preferredHighlightBegin
|
preferredHighlightEnd: preferredHighlightBegin
|
||||||
pathItemCount: 5
|
pathItemCount: 5
|
||||||
//highlightMoveDuration: 500
|
//highlightMoveDuration: 500
|
||||||
|
|
||||||
@@ -42,7 +42,7 @@ PathView {
|
|||||||
scale: PathView.itemScale
|
scale: PathView.itemScale
|
||||||
itemBrightness: PathView.itemBrightness
|
itemBrightness: PathView.itemBrightness
|
||||||
opacity: PathView.itemOpacity
|
opacity: PathView.itemOpacity
|
||||||
z: -x
|
z: coverView.width - x
|
||||||
|
|
||||||
onPlayClicked: {
|
onPlayClicked: {
|
||||||
console.log("***************")
|
console.log("***************")
|
||||||
@@ -58,24 +58,22 @@ PathView {
|
|||||||
startX: coverView.pathStartX
|
startX: coverView.pathStartX
|
||||||
startY: coverView.pathStartY
|
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: "itemOpacity"; value: 1 }
|
||||||
PathAttribute { name: "itemBrightness"; value: 1 }
|
PathAttribute { name: "itemBrightness"; value: 1 }
|
||||||
PathAttribute { name: "itemScale"; 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 }
|
PathLine { x: coverView.width; y: 0 }
|
||||||
PathPercent { value: 1 }
|
PathPercent { value: 1 }
|
||||||
PathAttribute { name: "itemOpacity"; value: 1 }
|
PathAttribute { name: "itemOpacity"; value: 1 }
|
||||||
|
@@ -71,7 +71,7 @@ Item {
|
|||||||
radius: 3
|
radius: 3
|
||||||
gradient: Gradient {
|
gradient: Gradient {
|
||||||
GradientStop { position: 0.0; color: "#00000000" }
|
GradientStop { position: 0.0; color: "#00000000" }
|
||||||
GradientStop { position: 0.5; color: "black" }
|
GradientStop { position: 0.75; color: "black" }
|
||||||
GradientStop { position: 1.0; color: "black" }
|
GradientStop { position: 1.0; color: "black" }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -86,16 +86,18 @@ Item {
|
|||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignHCenter
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
opacity: showLabels ? 1 : 0
|
opacity: showLabels ? 1 : 0
|
||||||
|
font.pixelSize: root.height / 15
|
||||||
}
|
}
|
||||||
Text {
|
Text {
|
||||||
id: artistText
|
id: artistText
|
||||||
color: "white"
|
color: "white"
|
||||||
text: artistName
|
text: artistName
|
||||||
anchors { left: parent.left; right: parent.right; bottom: parent.bottom }
|
anchors { left: parent.left; right: parent.right; bottom: parent.bottom }
|
||||||
anchors.margins: 2
|
anchors.margins: root.height / 20
|
||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignHCenter
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
opacity: showLabels ? 1 : 0
|
opacity: showLabels ? 1 : 0
|
||||||
|
font.pixelSize: root.height / 15
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -156,6 +158,8 @@ Item {
|
|||||||
visible: showPlayButton ? (mouseArea.containsMouse || currentlyPlaying) : false
|
visible: showPlayButton ? (mouseArea.containsMouse || currentlyPlaying) : false
|
||||||
source: currentlyPlaying ? "../images/pause-rest.png" : "../images/play-rest.png"
|
source: currentlyPlaying ? "../images/pause-rest.png" : "../images/play-rest.png"
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
|
height: mirroredCover.height / 5
|
||||||
|
width: height
|
||||||
MouseArea {
|
MouseArea {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
onClicked: {
|
onClicked: {
|
||||||
|
@@ -9,25 +9,6 @@ Item {
|
|||||||
signal configure()
|
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 {
|
Item {
|
||||||
anchors { top: parent.top; left: parent.left; bottom: parent.bottom }
|
anchors { top: parent.top; left: parent.left; bottom: parent.bottom }
|
||||||
anchors.margins: 50
|
anchors.margins: 50
|
||||||
@@ -51,7 +32,6 @@ Item {
|
|||||||
text: rootView.title
|
text: rootView.title
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
@@ -67,41 +47,6 @@ Item {
|
|||||||
text: "Now Playing:"
|
text: "Now Playing:"
|
||||||
visible: currentlyPlayedIndex !== -1
|
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 {
|
Text {
|
||||||
color: "white"
|
color: "white"
|
||||||
font.pointSize: 16
|
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 {
|
Button {
|
||||||
id: configureButton
|
id: configureButton
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
|
@@ -57,7 +57,7 @@ DynamicQmlWidget::DynamicQmlWidget( const dynplaylist_ptr& playlist, QWidget* pa
|
|||||||
|
|
||||||
setSource( QUrl( "qrc" RESPATH "qml/StationScene.qml" ) );
|
setSource( QUrl( "qrc" RESPATH "qml/StationScene.qml" ) );
|
||||||
|
|
||||||
connect( m_model, SIGNAL( currentItemChanged( QPersistentModelIndex ) ), SLOT( currentItemChanged( QPersistentModelIndex ) ) );
|
connect( m_model, SIGNAL( currentItemChanged(QPersistentModelIndex)), SLOT( currentIndexChanged( QPersistentModelIndex ) ) );
|
||||||
connect( m_playlist->generator().data(), SIGNAL( generated( QList<Tomahawk::query_ptr> ) ), this, SLOT( tracksGenerated( QList<Tomahawk::query_ptr> ) ) );
|
connect( m_playlist->generator().data(), SIGNAL( generated( QList<Tomahawk::query_ptr> ) ), this, SLOT( tracksGenerated( QList<Tomahawk::query_ptr> ) ) );
|
||||||
connect( m_playlist->generator().data(), SIGNAL( nextTrackGenerated( Tomahawk::query_ptr ) ), this, SLOT( nextTrackGenerated( Tomahawk::query_ptr ) ) );
|
connect( m_playlist->generator().data(), SIGNAL( nextTrackGenerated( Tomahawk::query_ptr ) ), this, SLOT( nextTrackGenerated( Tomahawk::query_ptr ) ) );
|
||||||
connect( m_playlist.data(), SIGNAL( dynamicRevisionLoaded( Tomahawk::DynamicPlaylistRevision ) ), this, SLOT( onRevisionLoaded( Tomahawk::DynamicPlaylistRevision ) ) );
|
connect( m_playlist.data(), SIGNAL( dynamicRevisionLoaded( Tomahawk::DynamicPlaylistRevision ) ), this, SLOT( onRevisionLoaded( Tomahawk::DynamicPlaylistRevision ) ) );
|
||||||
@@ -66,6 +66,8 @@ DynamicQmlWidget::DynamicQmlWidget( const dynplaylist_ptr& playlist, QWidget* pa
|
|||||||
connect( AudioEngine::instance(), SIGNAL( started( Tomahawk::result_ptr ) ), this, SLOT( trackStarted() ) );
|
connect( AudioEngine::instance(), SIGNAL( started( Tomahawk::result_ptr ) ), this, SLOT( trackStarted() ) );
|
||||||
connect( AudioEngine::instance(), SIGNAL( playlistChanged( Tomahawk::playlistinterface_ptr ) ), this, SLOT( playlistChanged( Tomahawk::playlistinterface_ptr ) ) );
|
connect( AudioEngine::instance(), SIGNAL( playlistChanged( Tomahawk::playlistinterface_ptr ) ), this, SLOT( playlistChanged( Tomahawk::playlistinterface_ptr ) ) );
|
||||||
|
|
||||||
|
// m_playlist->generator()->generate( 20 );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -130,8 +132,9 @@ void DynamicQmlWidget::startStationFromArtist(const QString &artist)
|
|||||||
m_playlist->generator()->startFromArtist(Artist::get(artist));
|
m_playlist->generator()->startFromArtist(Artist::get(artist));
|
||||||
}
|
}
|
||||||
|
|
||||||
void DynamicQmlWidget::currentItemChanged( const QPersistentModelIndex ¤tIndex )
|
void DynamicQmlWidget::currentIndexChanged( const QPersistentModelIndex ¤tIndex )
|
||||||
{
|
{
|
||||||
|
tDebug() << "current index is" << currentIndex.row();
|
||||||
rootContext()->setContextProperty( "currentlyPlayedIndex", m_proxyModel->mapFromSource( currentIndex ).row() );
|
rootContext()->setContextProperty( "currentlyPlayedIndex", m_proxyModel->mapFromSource( currentIndex ).row() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -63,7 +63,7 @@ public slots:
|
|||||||
void startStationFromArtist(const QString &artist);
|
void startStationFromArtist(const QString &artist);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void currentItemChanged( const QPersistentModelIndex ¤tIndex );
|
void currentIndexChanged( const QPersistentModelIndex ¤tIndex );
|
||||||
void tracksGenerated( const QList< Tomahawk::query_ptr>& queries );
|
void tracksGenerated( const QList< Tomahawk::query_ptr>& queries );
|
||||||
void nextTrackGenerated( const Tomahawk::query_ptr& track );
|
void nextTrackGenerated( const Tomahawk::query_ptr& track );
|
||||||
void error( const QString& title, const QString& body);
|
void error( const QString& title, const QString& body);
|
||||||
|
Reference in New Issue
Block a user