Changeset View
Changeset View
Standalone View
Standalone View
src/android/AlbumsView.qml
- This file was added.
1 | /* | ||||
---|---|---|---|---|---|
2 | * Copyright 2018 Matthieu Gallien <matthieu_gallien@yahoo.fr> | ||||
3 | * | ||||
4 | * This program is free software: you can redistribute it and/or | ||||
5 | * modify it under the terms of the GNU Lesser General Public | ||||
6 | * License as published by the Free Software Foundation; either | ||||
7 | * version 3 of the License, or (at your option) any later version. | ||||
8 | * | ||||
9 | * This program is distributed in the hope that it will be useful, | ||||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||||
12 | * Lesser General Public License for more details. | ||||
13 | * | ||||
14 | * You should have received a copy of the GNU Lesser General Public License | ||||
15 | * along with this program. If not, see <https://www.gnu.org/licenses/>. | ||||
16 | */ | ||||
17 | | ||||
18 | import QtQuick 2.11 | ||||
19 | import QtQuick.Controls 2.4 | ||||
20 | import org.kde.kirigami 2.5 as Kirigami | ||||
21 | import org.kde.elisa 1.0 | ||||
22 | | ||||
23 | Kirigami.Page { | ||||
24 | id: pageElement | ||||
25 | | ||||
26 | property bool isSubPage: false | ||||
27 | property string mainTitle | ||||
28 | property string secondaryTitle | ||||
29 | property url image | ||||
30 | property var contentModel: elisa.allAlbumsProxyModel | ||||
31 | property bool showRating: false | ||||
32 | property bool delegateDisplaySecondaryText: true | ||||
33 | property bool expandedFilterView: false | ||||
34 | property var stackView | ||||
35 | | ||||
36 | title: i18nc("Title of the view of all albums", "Albums") | ||||
37 | | ||||
38 | GridView { | ||||
39 | id: gridView | ||||
40 | | ||||
41 | focus: true | ||||
42 | anchors.fill: parent | ||||
43 | | ||||
44 | cellWidth: gridView.width / 2 | ||||
45 | cellHeight: gridView.width / 2 | ||||
46 | | ||||
47 | model: contentModel | ||||
48 | | ||||
49 | delegate: GridBrowserDelegate { | ||||
50 | width: gridView.cellWidth | ||||
51 | height: gridView.cellHeight | ||||
52 | | ||||
53 | focus: true | ||||
54 | | ||||
55 | isPartial: false | ||||
56 | | ||||
57 | mainText: model.display | ||||
58 | secondaryText: if (pageElement.delegateDisplaySecondaryText) {model.secondaryText} else {""} | ||||
59 | imageUrl: model.imageUrl | ||||
60 | shadowForImage: if (model.shadowForImage) {model.shadowForImage} else {false} | ||||
61 | containerData: model.containerData | ||||
62 | delegateDisplaySecondaryText: pageElement.delegateDisplaySecondaryText | ||||
63 | | ||||
64 | onEnqueue: elisa.mediaPlayList.enqueue(data) | ||||
65 | onReplaceAndPlay: elisa.mediaPlayList.replaceAndPlay(data) | ||||
66 | onOpen: pageElement.open(model.display, model.secondaryText, model.imageUrl, model.databaseId) | ||||
67 | onSelected: { | ||||
68 | forceActiveFocus() | ||||
69 | contentDirectoryView.currentIndex = model.index | ||||
70 | } | ||||
71 | } | ||||
72 | } | ||||
73 | } |