2 * Copyright (C) 2016 The Qt Company Ltd.
3 * Copyright (C) 2016, 2017 Mentor Graphics Development (Deutschland) GmbH
4 * Copyright (c) 2018 TOYOTA MOTOR CORPORATION
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
19 import QtQuick.Layouts 1.1
20 import QtQuick.Controls 2.0
25 // Layout.fillWidth: true
26 // Layout.fillHeight: true
28 // Layout.preferredHeight: 1487
33 anchors.centerIn: parent
34 source: './images/AGL_HMI_Blue_Background_Car-01.png'
44 anchors.horizontalCenter: parent.horizontalCenter
45 anchors.verticalCenter: parent.verticalCenter
47 flickableDirection: Flickable.AutoFlickDirection
48 snapMode: GridView.SnapOneRow
54 model: ApplicationModel { id: applicationModel }
57 height: grid.cellHeight
63 property string currentId: ''
64 property int newIndex: -1
65 property int index: grid.indexAt(loc.mouseX, loc.mouseY)
68 anchors.rightMargin: 0
69 anchors.bottomMargin: 0
72 onPressAndHold: currentId = applicationModel.id(newIndex = index)
74 if (currentId === '') {
75 pid = launcher.launch(applicationModel.id(loc.index))
79 console.warn("app cannot be launched!")
84 homescreenHandler.tapShortcut(applicationModel.name(loc.index))
87 if (loc.currentId === '') return
89 if (index === newIndex) return
90 applicationModel.move(newIndex, newIndex = index)