diff --git a/data/qml/CoverFlip.qml b/data/qml/CoverFlip.qml index c389ce83e..565379df3 100644 --- a/data/qml/CoverFlip.qml +++ b/data/qml/CoverFlip.qml @@ -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 } diff --git a/data/qml/CoverImage.qml b/data/qml/CoverImage.qml index 946e5d702..6f255b5f1 100644 --- a/data/qml/CoverImage.qml +++ b/data/qml/CoverImage.qml @@ -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: { diff --git a/data/qml/StationView.qml b/data/qml/StationView.qml index 40cf0b223..8ccb38f06 100644 --- a/data/qml/StationView.qml +++ b/data/qml/StationView.qml @@ -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 diff --git a/src/libtomahawk/playlist/dynamic/widgets/DynamicQmlWidget.cpp b/src/libtomahawk/playlist/dynamic/widgets/DynamicQmlWidget.cpp index 73b7a174e..b2a04d891 100644 --- a/src/libtomahawk/playlist/dynamic/widgets/DynamicQmlWidget.cpp +++ b/src/libtomahawk/playlist/dynamic/widgets/DynamicQmlWidget.cpp @@ -57,7 +57,7 @@ DynamicQmlWidget::DynamicQmlWidget( const dynplaylist_ptr& playlist, QWidget* pa 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 ) ), this, SLOT( tracksGenerated( QList ) ) ); 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 ) ) ); @@ -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( 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)); } -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() ); } diff --git a/src/libtomahawk/playlist/dynamic/widgets/DynamicQmlWidget.h b/src/libtomahawk/playlist/dynamic/widgets/DynamicQmlWidget.h index 2a97cf023..257e93336 100644 --- a/src/libtomahawk/playlist/dynamic/widgets/DynamicQmlWidget.h +++ b/src/libtomahawk/playlist/dynamic/widgets/DynamicQmlWidget.h @@ -63,7 +63,7 @@ public slots: void startStationFromArtist(const QString &artist); private slots: - void currentItemChanged( const QPersistentModelIndex ¤tIndex ); + void currentIndexChanged( const QPersistentModelIndex ¤tIndex ); void tracksGenerated( const QList< Tomahawk::query_ptr>& queries ); void nextTrackGenerated( const Tomahawk::query_ptr& track ); void error( const QString& title, const QString& body);