diff --git a/data/qml/CoverFlip.qml b/data/qml/CoverFlip.qml index 4b1120776..345542ffe 100644 --- a/data/qml/CoverFlip.qml +++ b/data/qml/CoverFlip.qml @@ -34,64 +34,64 @@ PathView { width: root.coverSize scale: PathView.itemScale -// itemBrightness: PathView.itemBrightness - ((coverView.itemHovered && !coverDelegate.containsMouse) ? .4 : 0) + // itemBrightness: PathView.itemBrightness - ((coverView.itemHovered && !coverDelegate.containsMouse) ? .4 : 0) property double itemBrightness: PathView.itemBrightness property double itemOpacity: PathView.itemOpacity + property int _origZ + z: coverView.width - x CoverImage { - id: coverDelegate - height: root.coverSize - width: root.coverSize - anchors { - top: parent.top - right: parent.right - } - - backgroundColor: coverView.backgroundColor - - showLabels: true - showMirror: true - artistName: model.artistName - trackName: model.trackName - artworkId: model.coverID - showPlayButton: true - currentlyPlaying: isPlaying - -// itemBrightness: PathView.itemBrightness - ((coverView.itemHovered && !coverDelegate.containsMouse) ? .4 : 0) - itemBrightness: coverDelegate.containsMouse ? 1 : parent.itemBrightness * (coverView.itemHovered ? .5 : 1) - opacity: parent.itemOpacity - z: coverView.width - x - - property int _origZ - - onPlayClicked: { - console.log("***************") - coverView.itemPlayPauseClicked(index) - } - - onClicked: { - coverView.itemClicked(index) - } - - onContainsMouseChanged: { - if (containsMouse) { - _origZ = z; - coverView.itemHovered = true - } else { - coverView.itemHovered = false + id: coverDelegate + height: root.coverSize + width: root.coverSize + anchors { + top: parent.top + right: parent.right } + + backgroundColor: coverView.backgroundColor + + showLabels: true + showMirror: true + artistName: model.artistName + trackName: model.trackName + artworkId: model.coverID + showPlayButton: true + currentlyPlaying: isPlaying + + // itemBrightness: PathView.itemBrightness - ((coverView.itemHovered && !coverDelegate.containsMouse) ? .4 : 0) + itemBrightness: coverDelegate.containsMouse ? 1 : parent.itemBrightness * (coverView.itemHovered ? .5 : 1) + opacity: parent.itemOpacity + z: coverView.width - x + + onPlayClicked: { + console.log("***************") + coverView.itemPlayPauseClicked(index) + } + + onClicked: { + coverView.itemClicked(index) + } + + onContainsMouseChanged: { + if (containsMouse) { + delegateItem._origZ = delegateItem.z; + coverView.itemHovered = true + } else { + coverView.itemHovered = false + } + } + + } - - - } states: [ State { name: "hovered"; when: coverDelegate.containsMouse && !coverView.moving && index !== currentIndex PropertyChanges { target: delegateItem width: root.coverSize * 2 - z: _origZ + z: coverDelegate._origZ } } ] diff --git a/data/qml/StationScene.qml b/data/qml/StationScene.qml index 953362e92..198542abd 100644 --- a/data/qml/StationScene.qml +++ b/data/qml/StationScene.qml @@ -103,6 +103,10 @@ Rectangle { InputField { anchors.centerIn: parent width: parent.width + onAccepted: { + rootView.startStationFromArtist(text) + stationListView.incrementCurrentIndex(); + } } } @@ -116,7 +120,7 @@ Rectangle { opacity: echonestStation.configured ? 0 : 1 onTagClicked: { - echonestStation.setMainControl( EchonestStation.StationTypeStyle, item ); + rootView.startStationFromGenre(item) stationListView.incrementCurrentIndex(); } @@ -140,6 +144,10 @@ Rectangle { InputField { anchors.centerIn: parent width: parent.width + onAccepted: { + rootView.startStationFromGenre(text) + stationListView.incrementCurrentIndex(); + } } } } diff --git a/src/libtomahawk/playlist/dynamic/widgets/DynamicQmlWidget.cpp b/src/libtomahawk/playlist/dynamic/widgets/DynamicQmlWidget.cpp index 7fe39f558..e2b701c02 100644 --- a/src/libtomahawk/playlist/dynamic/widgets/DynamicQmlWidget.cpp +++ b/src/libtomahawk/playlist/dynamic/widgets/DynamicQmlWidget.cpp @@ -128,9 +128,13 @@ void DynamicQmlWidget::pause() void DynamicQmlWidget::startStationFromArtist(const QString &artist) { - tDebug() << "should start startion from artist" << artist; - // m_playlist->generator()->startFromArtist(Artist::get(artist)); - m_playlist->generator()->startFromGenre( "rock" ); + m_playlist->generator()->startFromArtist(Artist::get(artist)); +} + +void DynamicQmlWidget::startStationFromGenre(const QString &genre) +{ + tDebug() << "should start startion from genre" << genre; + m_playlist->generator()->startFromGenre( genre ); } void DynamicQmlWidget::currentIndexChanged( const QPersistentModelIndex ¤tIndex ) diff --git a/src/libtomahawk/playlist/dynamic/widgets/DynamicQmlWidget.h b/src/libtomahawk/playlist/dynamic/widgets/DynamicQmlWidget.h index 257e93336..15d8fb0a1 100644 --- a/src/libtomahawk/playlist/dynamic/widgets/DynamicQmlWidget.h +++ b/src/libtomahawk/playlist/dynamic/widgets/DynamicQmlWidget.h @@ -61,6 +61,7 @@ public slots: void playItem(int index); void pause(); void startStationFromArtist(const QString &artist); + void startStationFromGenre(const QString &genre); private slots: void currentIndexChanged( const QPersistentModelIndex ¤tIndex );