diff --git a/src/qml/AlbumView.qml b/src/qml/AlbumView.qml index df9ee5a8..358b2677 100644 --- a/src/qml/AlbumView.qml +++ b/src/qml/AlbumView.qml @@ -1,124 +1,124 @@ /* * Copyright 2018 Matthieu Gallien * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see . */ import QtQuick 2.10 import QtQuick.Controls 2.3 import org.kde.elisa 1.0 FocusScope { id: viewHeader property var viewType property alias mainTitle: albumGridView.mainTitle property alias secondaryTitle: albumGridView.secondaryTitle property alias image: albumGridView.image property alias databaseId: albumGridView.databaseId DataModel { id: realModel } SingleAlbumProxyModel { id: proxyModel sourceModel: realModel onEntriesToEnqueue: elisa.mediaPlayList.enqueue(newEntries, databaseIdType, enqueueMode, triggerPlay) } ListBrowserView { id: albumGridView focus: true activeFocusOnTab: true anchors.fill: parent contentModel: proxyModel isSubPage: true enableSorting: false delegate: MediaAlbumTrackDelegate { id: entry width: albumGridView.delegateWidth height: ((true && !true) ? elisaTheme.delegateHeight*2 : elisaTheme.delegateHeight) focus: true databaseId: model.databaseId title: model.title artist: model.artist album: (model.album !== undefined && model.album !== '' ? model.album : '') albumArtist: model.albumArtist duration: model.duration imageUrl: (model.imageUrl !== undefined && model.imageUrl !== '' ? model.imageUrl : '') trackNumber: model.trackNumber discNumber: model.discNumber rating: model.rating isFirstTrackOfDisc: true isSingleDiscAlbum: true isAlternateColor: (index % 2) === 1 mediaTrack.onEnqueue: elisa.mediaPlayList.enqueue(databaseId, name, ElisaUtils.Track, ElisaUtils.AppendPlayList, ElisaUtils.DoNotTriggerPlay) mediaTrack.onReplaceAndPlay: elisa.mediaPlayList.enqueue(databaseId, name, ElisaUtils.Track, ElisaUtils.ReplacePlayList, ElisaUtils.TriggerPlay) mediaTrack.onClicked: albumGridView.currentIndex = index } allowArtistNavigation: true onShowArtist: { - viewManager.openChildView(name, '', elisaTheme.artistIcon, 0, ElisaUtils.Artist) + viewManager.openChildView(secondaryTitle, '', elisaTheme.artistIcon, 0, ElisaUtils.Artist) } onGoBack: viewManager.goBack() Loader { anchors.fill: parent visible: realModel.isBusy active: realModel.isBusy sourceComponent: BusyIndicator { anchors.fill: parent } } } Connections { target: elisa onMusicManagerChanged: realModel.initializeById(elisa.musicManager, elisa.musicManager.viewDatabase, ElisaUtils.Track, databaseId) } Component.onCompleted: { if (elisa.musicManager) { realModel.initializeById(elisa.musicManager, elisa.musicManager.viewDatabase, ElisaUtils.Track, databaseId) } } }