2 * Copyright (C) 2018 The Qt Company Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 import QtQuick.Layouts 1.1
19 import QtQuick.Controls 2.0
23 property alias model: listView.model
25 property int nPullHeight: 300
29 anchors.horizontalCenter: parent.horizontalCenter
38 anchors.margins: root.width * 0.075
48 Layout.preferredWidth: 100
49 Layout.preferredHeight: 100
52 source: 'file://' + model.icon
57 Layout.fillWidth: true
58 text: model.name.toUpperCase()
62 text: 'Version: ' + model.version
67 text: 'Description: ' + model.description
70 elide: Text.ElideRight
71 Layout.preferredWidth: 400
72 Layout.preferredHeight: 40
77 Layout.alignment: Qt.AlignRight | Qt.AlignVCenter
83 if (listView.model.launch(model.id) > 1) {
84 homescreenHandler.tapShortcut(model.name)
86 console.warn('app cannot be launched')
94 visible: model.name.toUpperCase() != "HOMESCREEN" && model.name.toUpperCase() != "LAUNCHER"
97 listView.model.uninstall(model.index)
105 source: 'qrc:/images/DividingLine.svg'
106 anchors.horizontalCenter: parent.horizontalCenter
107 anchors.top: parent.top
108 visible: model.index > 0
115 name: "refreshState"; when: listView.contentY < -nPullHeight
117 name: "refreshScript"
118 script: refreshModel()
124 function refreshModel() {
125 listView.y = nPullHeight;
127 busyIndicator.running = true
128 refreshTimer.start();
137 listView.model.refresh()
138 refreshAnimation.start();
150 busyIndicator.running = false