Warning, /plasma-mobile/mycroft-plasmoid-mobile/plasmoid/contents/ui/VideoFileDelegate.qml is written in an unsupported language. File is not indexed.
0001 /* Copyright 2016 Aditya Mehra <aix.m@outlook.com> 0002 0003 This library is free software; you can redistribute it and/or 0004 modify it under the terms of the GNU Lesser General Public 0005 License as published by the Free Software Foundation; either 0006 version 2.1 of the License, or (at your option) version 3, or any 0007 later version accepted by the membership of KDE e.V. (or its 0008 successor approved by the membership of KDE e.V.), which shall 0009 act as a proxy defined in Section 6 of version 3 of the license. 0010 0011 This library is distributed in the hope that it will be useful, 0012 but WITHOUT ANY WARRANTY; without even the implied warranty of 0013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 0014 Lesser General Public License for more details. 0015 0016 You should have received a copy of the GNU Lesser General Public 0017 License along with this library. If not, see <http://www.gnu.org/licenses/>. 0018 */ 0019 0020 import QtQuick 2.9 0021 import QtQml.Models 2.2 0022 import QtMultimedia 5.8 0023 import QtQuick.Controls 2.2 0024 import QtQuick.Layouts 1.3 0025 import org.kde.plasma.core 2.0 as PlasmaCore 0026 import org.kde.plasma.plasmoid 2.0 0027 import org.kde.plasma.components 2.0 as PlasmaComponents 0028 0029 Rectangle { 0030 id: videoFileDelegateItm 0031 implicitHeight: videoFileDelegateInner.height 0032 color: Qt.darker(theme.backgroundColor, 1.2) 0033 width: cbwidth 0034 0035 Item { 0036 id: videoFileDelegateInner 0037 implicitHeight: Math.max(videoInnerInfoColumn.height, playVideoBtn.height + units.gridUnit * 1) 0038 width: parent.width 0039 0040 PlasmaCore.IconItem { 0041 id: videoImgType 0042 source: "videoclip-amarok" 0043 anchors.left: parent.left 0044 width: units.gridUnit * 1 0045 height: units.gridUnit * 1 0046 anchors.verticalCenter: parent.verticalCenter 0047 } 0048 0049 Item { 0050 id: videoInnerInfoColumn 0051 implicitHeight: videoFileName.implicitHeight + sprTrinnerVideo.height + videoFileLoc.implicitHeight + units.gridUnit * 0.50 0052 anchors.left: videoImgType.right 0053 anchors.leftMargin: units.gridUnit * 0.30 0054 anchors.right: playVideoBtn.left 0055 anchors.rightMargin: units.gridUnit * 0.30 0056 0057 PlasmaComponents.Label { 0058 id: videoFileName 0059 color: theme.textColor 0060 anchors.left: parent.left 0061 anchors.right: parent.right 0062 anchors.top: parent.top 0063 anchors.topMargin: units.gridUnit * 0.25 0064 wrapMode: Text.Wrap 0065 0066 Component.onCompleted: { 0067 var filterName = InputQuery.toString(); 0068 videoFileName.text = filterName.match(/\/([^\/]+)\/?$/)[1] 0069 } 0070 } 0071 0072 Rectangle { 0073 id: sprTrinnerVideo 0074 anchors.left: parent.left 0075 anchors.right: parent.right 0076 anchors.rightMargin: units.gridUnit * 1 0077 anchors.top: videoFileName.bottom 0078 anchors.topMargin: units.gridUnit * 0.15 0079 color: theme.linkColor 0080 height: units.gridUnit * 0.1 0081 } 0082 0083 PlasmaComponents.Label { 0084 id: videoFileLoc 0085 color: theme.linkColor 0086 font.pixelSize: 12 0087 anchors.left: parent.left 0088 anchors.right: parent.right 0089 anchors.top: sprTrinnerVideo.bottom 0090 0091 wrapMode: Text.Wrap 0092 Component.onCompleted: { 0093 videoFileLoc.text = i18n("<i>Location: %1</i>", InputQuery) 0094 } 0095 } 0096 } 0097 0098 PlasmaComponents.Button { 0099 id: playVideoBtn 0100 anchors.right: parent.right 0101 anchors.rightMargin: units.gridUnit * 0.75 0102 anchors.verticalCenter: parent.verticalCenter 0103 width: units.gridUnit * 3.5 0104 height: units.gridUnit * 3 0105 text: i18n("Play") 0106 0107 onClicked: { 0108 var vidFile = Qt.resolvedUrl(InputQuery) 0109 Qt.openUrlExternally(vidFile) 0110 } 0111 } 0112 } 0113 }