Debian Codegraph @

rc/qml/AlbumEditor/AlbumCoverMenu.qml

raw
1 /*
2 * Copyright (C) 2012-2015 Canonical Ltd.
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as
6 * published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors:
17 * Eric Gregory <[email protected]>
18 */
19
20 import QtQuick 2.9
21 import Lomiri.Components.Popups 1.3
22 import Lomiri.Components.ListItems 1.3 as ListItem
23 import "../AlbumViewer"
24
25 /*!
26 Menu to select the album cover
27 */
28 Popover {
29 id: albumCoverMenu
30
31 signal newCoverSelected(string coverName)
32
33 Column {
34 anchors {
35 left: parent.left
36 right: parent.right
37 top: parent.top
38 }
39
40 Repeater {
41 model: AlbumCoverList {}
42
43 delegate: ListItem.Standard {
44 objectName: "albumCoverMenuItem_" + coverName
45 text: title
46 icon: Qt.resolvedUrl(iconFilename)
47 onClicked: {
48 albumCoverMenu.newCoverSelected(coverName);
49 hide();
50 }
51 }
52 }
53 }
54 }