diff --git a/src/qml/ContentView.qml b/src/qml/ContentView.qml --- a/src/qml/ContentView.qml +++ b/src/qml/ContentView.qml @@ -33,6 +33,22 @@ viewManager.goBack() } + function openArtist(name) { + viewManager.openOneArtist(viewManager.currentStackView, name, elisaTheme.artistIcon, 0) + } + + function openAlbum(artist, album, image) { + image = !image ? elisaTheme.defaultAlbumImage : image; + viewManager.openOneAlbum(viewManager.currentStackView, album, artist, image, 0); + } + + 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 @@ -213,6 +213,10 @@ playerControl.onPlayPrevious: elisa.mediaPlayList.skipPreviousTrack() playerControl.onPlayNext: elisa.mediaPlayList.skipNextTrack() + onOpenArtist: { contentView.openArtist(artist) } + onOpenNowPlaying: { contentView.openNowPlaying() } + onOpenAlbum: { contentView.openAlbum(album, artist, image) } + 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 @@ -37,6 +37,10 @@ property bool ratingVisible property alias playerControl: playControlItem + signal openArtist() + signal openAlbum() + signal openNowPlaying() + onImageChanged: { if (changeBackgroundTransition.running) { @@ -234,6 +238,16 @@ font.bold: true Layout.bottomMargin: titleFontInfo.height * 0.5 + + MouseArea { + id: titleMouseArea + hoverEnabled: true + anchors.fill: parent + cursorShape: Qt.PointingHandCursor + onClicked: { + openNowPlaying() + } + } } LabelWithToolTip { @@ -245,6 +259,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 @@ -274,6 +298,15 @@ samples: 9 } + MouseArea { + id: albumMouseArea + hoverEnabled: true + anchors.fill: parent + cursorShape: Qt.PointingHandCursor + onClicked: { + openAlbum() + } + } } RatingStar {