Warning, /plasma-mobile/mycroft-plasmoid-mobile/plasmoid/contents/ui/LoaderType.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 QtQuick.Controls 2.2 0023 import org.kde.plasma.components 2.0 as PlasmaComponents 0024 import org.kde.plasma.extras 2.0 as PlasmaExtras 0025 import org.kde.private.mycroftplasmoidmobile 1.0 as PlasmaLa 0026 0027 Column { 0028 spacing: 6 0029 anchors.right: parent.right 0030 property string filename: "file:///" + model.InputQuery 0031 property int getHeight 0032 0033 Component.onCompleted: { 0034 var mObj = loaderComp.createObject(loaderView, {}) 0035 } 0036 0037 Row { 0038 id: messageRow 0039 spacing: 6 0040 0041 Rectangle { 0042 id: messageRect 0043 width: cbwidth 0044 radius: 2 0045 height: newikiFlick.height 0046 color: theme.backgroundColor 0047 0048 Flickable { 0049 id: newikiFlick 0050 width: messageRect.width 0051 height: getHeight 0052 0053 Item { 0054 id: loaderView 0055 anchors.fill: parent 0056 } 0057 0058 Component { 0059 id: loaderComp 0060 0061 Loader { 0062 id: loaderScreen 0063 anchors.left: parent.left 0064 anchors.right: parent.right 0065 height: Math.max(item ? item.implicitHeight : 0, units.gridUnit * 10) 0066 source: filename 0067 0068 function reload(){ 0069 source = filename + "?t=" + Date.now() 0070 } 0071 0072 Component.onCompleted: { 0073 loaderScreen.reload(); 0074 getHeight = height 0075 } 0076 } 0077 } 0078 } 0079 } 0080 } 0081 }