diff --git a/src/qml/ContentView.qml b/src/qml/ContentView.qml --- a/src/qml/ContentView.qml +++ b/src/qml/ContentView.qml @@ -34,6 +34,22 @@ viewManager.goBack() } + function openArtist(name) { + viewManager.openOneArtist(viewManager.currentStackView, name, elisaTheme.artistIcon, 0) + } + + function openAlbum(artist, album, image, albumID) { + image = !image ? elisaTheme.defaultAlbumImage : image; + viewManager.openOneAlbum(viewManager.currentStackView, album, artist, image, albumID); + } + + function openNowPlaying() { + viewManager.closeAllViews(); + + // This is needed to trigger the state change + listViews.currentIndex = 0; + } + ViewManager { id: viewManager diff --git a/src/qml/ElisaMainWindow.qml b/src/qml/ElisaMainWindow.qml --- a/src/qml/ElisaMainWindow.qml +++ b/src/qml/ElisaMainWindow.qml @@ -197,6 +197,7 @@ title: elisa.manageHeaderBar.title artist: elisa.manageHeaderBar.artist image: elisa.manageHeaderBar.image + albumID: elisa.manageHeaderBar.albumId ratingVisible: false @@ -222,6 +223,9 @@ playerControl.onPlayNext: elisa.mediaPlayList.skipNextTrack() playerControl.isMaximized: persistentSettings.headerBarIsMaximized + onOpenArtist: { contentView.openArtist(artist) } + onOpenNowPlaying: { contentView.openNowPlaying() } + onOpenAlbum: { contentView.openAlbum(album, artist, image, albumID) } TrackImportNotification { id: importedTracksCountNotification diff --git a/src/qml/HeaderBar.qml b/src/qml/HeaderBar.qml --- a/src/qml/HeaderBar.qml +++ b/src/qml/HeaderBar.qml @@ -32,10 +32,15 @@ property string oldImage property string tracksCount property int trackRating + property int albumID property bool ratingVisible property alias playerControl: playControlItem property alias isMaximized: playControlItem.isMaximized + signal openArtist() + signal openAlbum() + signal openNowPlaying() + onImageChanged: { if (changeBackgroundTransition.running) { @@ -231,6 +236,16 @@ font.bold: true Layout.bottomMargin: titleFontInfo.height * 0.5 + + MouseArea { + id: titleMouseArea + hoverEnabled: true + anchors.fill: parent + cursorShape: Qt.PointingHandCursor + onClicked: { + openNowPlaying() + } + } } LabelWithToolTip { @@ -242,6 +257,16 @@ color: myPalette.highlightedText font.pointSize: elisaTheme.defaultFontPointSize * 1.5 + MouseArea { + id: authorMouseArea + hoverEnabled: true + anchors.fill: parent + cursorShape: Qt.PointingHandCursor + onClicked: { + openArtist() + } + } + layer.effect: Glow { cached: true @@ -271,6 +296,15 @@ samples: 9 } + MouseArea { + id: albumMouseArea + hoverEnabled: true + anchors.fill: parent + cursorShape: Qt.PointingHandCursor + onClicked: { + openAlbum() + } + } } RatingStar {