Warning, /plasma-bigscreen/soundcloud-voice-application/ui/+mediacenter/delegates/SideAudioCard.qml is written in an unsupported language. File is not indexed.

0001 import QtQuick 2.9
0002 import QtQuick.Layouts 1.4
0003 import QtGraphicalEffects 1.0
0004 import QtQuick.Controls 2.3
0005 import org.kde.kirigami 2.8 as Kirigami
0006 import org.kde.plasma.core 2.0 as PlasmaCore
0007 import org.kde.plasma.components 3.0 as PlasmaComponents3
0008 import org.kde.plasma.components 2.0 as PlasmaComponents
0009 import Mycroft 1.0 as Mycroft
0010 import org.kde.mycroft.bigscreen 1.0 as BigScreen
0011 
0012 BigScreen.AbstractDelegate {
0013     id: delegate    
0014     implicitWidth: listView.cellWidth
0015     height: parent.height
0016     property bool busyIndicate: false
0017 
0018     contentItem: ColumnLayout {
0019         spacing: Kirigami.Units.smallSpacing
0020 
0021         Item {
0022             id: imgRoot
0023             Layout.alignment: Qt.AlignTop
0024             Layout.fillWidth: true
0025             Layout.topMargin: -delegate.topPadding + delegate.topInset + extraBorder
0026             Layout.leftMargin: -delegate.leftPadding + delegate.leftInset + extraBorder
0027             Layout.rightMargin: -delegate.rightPadding + delegate.rightInset + extraBorder
0028             Layout.preferredHeight: width * 0.5625 + delegate.baseRadius
0029             property real extraBorder: 0
0030 
0031             layer.enabled: true
0032             layer.effect: OpacityMask {
0033                 cached: true
0034                 maskSource: Rectangle {
0035                     x: imgRoot.x;
0036                     y: imgRoot.y
0037                     width: imgRoot.width
0038                     height: imgRoot.height
0039                     radius: delegate.baseRadius
0040                 }
0041             }
0042 
0043             Image {
0044                 id: img
0045                 source: modelData.thumbnail
0046                 anchors {
0047                     fill: parent
0048                     // To not round under
0049                     bottomMargin: delegate.baseRadius
0050                 }
0051                 opacity: 1
0052                 fillMode: Image.PreserveAspectCrop
0053             }
0054             
0055             states: [
0056                 State {
0057                     when: delegate.isCurrent
0058                     PropertyChanges {
0059                         target: imgRoot
0060                         extraBorder: delegate.borderSize
0061                     }
0062                 },
0063                 State {
0064                     when: !delegate.isCurrent
0065                     PropertyChanges {
0066                         target: imgRoot
0067                         extraBorder: 0
0068                     }
0069                 }
0070             ]
0071             transitions: Transition {
0072                 onRunningChanged: {
0073                     // Optimize when animating the thumbnail
0074                     img.smooth = !running
0075                 }
0076                 NumberAnimation {
0077                     property: "extraBorder"
0078                     duration: Kirigami.Units.longDuration
0079                     easing.type: Easing.InOutQuad
0080                 }
0081             }
0082         }
0083 
0084         ColumnLayout {
0085             Layout.fillWidth: true
0086             Layout.fillHeight: true
0087             Layout.topMargin: -delegate.baseRadius
0088             Layout.alignment: Qt.AlignLeft | Qt.AlignTop
0089             spacing: Kirigami.Units.smallSpacing
0090 
0091             Kirigami.Heading {
0092                 id: videoLabel
0093                 Layout.fillWidth: true
0094                 Layout.alignment: Qt.AlignLeft | Qt.AlignTop
0095                 wrapMode: Text.Wrap
0096                 level: 3
0097                 maximumLineCount: 1
0098                 elide: Text.ElideRight
0099                 color: PlasmaCore.ColorScope.textColor
0100                 Component.onCompleted: {
0101                     text = modelData.title
0102                 }
0103             }
0104         }
0105     }
0106 
0107     onClicked: {
0108         triggerGuiEvent("aiix.soundcloud-audio-player.playtitle", {playtitle: modelData.title})
0109     }
0110 }