Warning, /multimedia/amarok/src/context/applets/photos/package/contents/ui/main.qml is written in an unsupported language. File is not indexed.

0001 /****************************************************************************************
0002  * Copyright (c) 2017 Malte Veerman <malte.veerman@gmail.com>                           *
0003  *                                                                                      *
0004  * This program is free software; you can redistribute it and/or modify it under        *
0005  * the terms of the GNU General Public License as published by the Free Software        *
0006  * Foundation; either version 2 of the License, or (at your option) any later           *
0007  * version.                                                                             *
0008  *                                                                                      *
0009  * This program is distributed in the hope that it will be useful, but WITHOUT ANY      *
0010  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A      *
0011  * PARTICULAR PURPOSE. See the GNU General Public License for more details.             *
0012  *                                                                                      *
0013  * You should have received a copy of the GNU General Public License along with         *
0014  * this program.  If not, see <http://www.gnu.org/licenses/>.                           *
0015  ****************************************************************************************/
0016 
0017 import QtQuick 2.4
0018 import QtQuick.Controls 2.0
0019 import org.kde.kirigami 2.0 as Kirigami
0020 import org.kde.amarok.qml 1.0 as AmarokQml
0021 import org.kde.amarok.photos 1.0
0022 
0023 AmarokQml.Applet {
0024     id: applet
0025 
0026     title: name + ": " + PhotosEngine.artist
0027 
0028     Flickable {
0029         anchors.fill: parent
0030         contentHeight: height
0031         contentWidth: contentRow.width
0032 
0033         Row {
0034             id: contentRow
0035 
0036             height: parent.height
0037             spacing: Kirigami.Units.smallSpacing
0038 
0039             Repeater {
0040                 model: PhotosEngine.photoTitles.length
0041 
0042                 Item {
0043                     height: parent.height
0044                     width: image.width
0045 
0046                     Image {
0047                         id: image
0048 
0049                         anchors.top: parent.top
0050                         height: parent.height
0051                         width: height * sourceSize.width / sourceSize.height
0052                         source: PhotosEngine.photoUrls[index]
0053                         asynchronous: true
0054                         fillMode: Image.PreserveAspectFit
0055                     }
0056                     MouseArea {
0057                         anchors.fill: parent
0058                         cursorShape: Qt.PointingHandCursor
0059 
0060                         onClicked: Context.runLink(PhotosEngine.pageUrls[index]);
0061                     }
0062                 }
0063             }
0064         }
0065     }
0066 
0067     Label {
0068         anchors.centerIn: parent
0069         text: PhotosEngine.error
0070         visible: PhotosEngine.Status === PhotosEngine.Error
0071     }
0072 
0073     BusyIndicator {
0074         anchors.centerIn: parent
0075         running: PhotosEngine.Status === PhotosEngine.Fetching
0076     }
0077 }