Warning, /plasma-mobile/mycroft-plasmoid-mobile/plasmoid/contents/ui/main.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 QtQuick.Layouts 1.3
0024 import Qt.WebSockets 1.0
0025 import QtWebKit 3.0
0026 import Qt.labs.settings 1.0
0027 import org.kde.plasma.core 2.0 as PlasmaCore
0028 import org.kde.plasma.plasmoid 2.0
0029 import org.kde.plasma.components 2.0 as PlasmaComponents
0030 import org.kde.plasma.extras 2.0 as PlasmaExtras
0031 import org.kde.private.mycroftplasmoidmobile 1.0 as PlasmaLa
0032 import org.kde.plasma.private.volume 0.1
0033 
0034 PlasmaComponents.ToolButton {
0035         id: rootIcon
0036         Plasmoid.preferredRepresentation: Plasmoid.fullRepresentation
0037         Plasmoid.toolTipMainText: i18n("Mycroft")
0038         Layout.preferredWidth: units.gridUnits * 2
0039         Layout.preferredHeight: units.gridUnits * 2
0040         iconSource: "audio-input-microphone"
0041         property variant getWidth
0042         property variant getHeight
0043         property variant getY
0044         property alias rDrawer: rootDrawer
0045         
0046             Timer {
0047                 id: timer
0048             }
0049         
0050         function delay(delayTime, cb) {
0051             timer.interval = delayTime;
0052             timer.repeat = false;
0053             timer.triggered.connect(cb);
0054             timer.start();
0055         }
0056         
0057         onClicked: {
0058             rootDrawer.open()
0059             } 
0060             
0061         Component.onCompleted: {
0062             delay(4000, function() {
0063             getHeight = plasmoid.availableScreenRect.height
0064             getWidth = plasmoid.availableScreenRect.width
0065             getY = plasmoid.availableScreenRect.y
0066             });
0067         }
0068         
0069 Drawer {
0070     id: rootDrawer
0071     width: getWidth
0072     height: getHeight
0073     y: getY
0074     //edge: Qt.LeftEdge
0075     dragMargin: 0
0076     z: 1000
0077     
0078     MainPage{
0079         id: mainPageComponent
0080         anchors.fill: parent
0081         z: 1000
0082         }
0083     }
0084 }