Warning, /multimedia/elisa/src/qml/BasicPlayListAlbumHeader.qml is written in an unsupported language. File is not indexed.

0001 /*
0002    SPDX-FileCopyrightText: 2016 (c) Matthieu Gallien <matthieu_gallien@yahoo.fr>
0003 
0004    SPDX-License-Identifier: LGPL-3.0-or-later
0005  */
0006 
0007 import QtQuick 2.7
0008 import QtQuick.Window 2.2
0009 import QtQuick.Layouts 1.2
0010 import QtQuick.Controls 2.3
0011 import org.kde.kirigami 2.10 as Kirigami
0012 
0013 import org.kde.elisa 1.0
0014 
0015 import QtQuick 2.0
0016 
0017 Rectangle {
0018     property var headerData
0019     property string album: headerData[0]
0020     property string albumArtist: headerData[1]
0021     property url imageUrl: headerData[2]
0022 
0023     property bool simpleMode: false
0024 
0025     implicitHeight: contentLayout.height + contentLayout.anchors.topMargin * 2
0026 
0027     color: simpleMode ? "transparent" : myPalette.window
0028 
0029     RowLayout {
0030         id: contentLayout
0031 
0032         anchors {
0033             top: parent.top
0034             topMargin: Kirigami.Units.smallSpacing
0035             left: parent.left
0036             right: parent.right
0037         }
0038 
0039         spacing: Kirigami.Units.smallSpacing
0040 
0041         // keep section's elements aligned with playlistEntry's ones
0042         Item {
0043             visible: !simpleMode
0044             Layout.preferredWidth: Kirigami.Units.iconSizes.smallMedium
0045             Layout.preferredHeight: Kirigami.Units.iconSizes.smallMedium
0046         }
0047 
0048         ImageWithFallback {
0049             Layout.preferredWidth: elisaTheme.coverArtSize
0050             Layout.preferredHeight: elisaTheme.coverArtSize
0051 
0052             source: imageUrl
0053             fallback: elisaTheme.defaultAlbumImage
0054 
0055             sourceSize.width: height * Screen.devicePixelRatio
0056             sourceSize.height: height * Screen.devicePixelRatio
0057 
0058             fillMode: Image.PreserveAspectFit
0059             asynchronous: true
0060         }
0061 
0062         ColumnLayout {
0063             id: albumHeaderTextColumn
0064 
0065             Layout.fillWidth: true
0066             spacing: 0
0067 
0068             LabelWithToolTip {
0069                 id: mainLabel
0070 
0071                 Layout.fillWidth: true
0072                 Layout.alignment: Qt.AlignBottom | Qt.AlignLeft
0073 
0074                 text: album
0075                 level: 2
0076             }
0077 
0078             LabelWithToolTip {
0079                 id: authorLabel
0080 
0081                 Layout.fillWidth: true
0082                 Layout.alignment: Qt.AlignTop | Qt.AlignLeft
0083 
0084                 text: albumArtist
0085                 type: Kirigami.Heading.Type.Secondary
0086             }
0087         }
0088     }
0089 }