2 * Copyright (C) 2016 The Qt Company Ltd.
3 * Copyright (C) 2016, 2017 Mentor Graphics Development (Deutschland) GmbH
4 * Copyright (c) 2018,2019 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
21 import QtQuick.Window 2.13
22 import QtGraphicalEffects 1.0
28 //width: container.width
29 //height: container.height
30 flags: Qt.FramelessWindowHint
35 anchors.centerIn: parent
40 anchors.centerIn: parent
41 source: './images/AGL_HMI_Blue_Background_Car-01.png'
47 topMargin: 60; bottomMargin: 60
48 leftMargin: 60; rightMargin: 60
52 // change this HorizontalFlick or see Flickable documentation
53 // for other possible combinations
54 flickableDirection: Flickable.VerticalFlick
55 snapMode: GridView.SnapOneRow
59 interactive: apps_len > 12 ? true : false
61 // the follow makes it display from left to right to allow
62 // horizontal scrolling to work
63 //verticalLayoutDirection: Grid.TopToBottom
64 //layoutDirection: Qt.LeftToRight
65 //flow: Grid.TopToBottom
67 // uncomment this out if you want to highlight the currently selected item
68 //highlight: Rectangle { width: 80; height: 80; color: "steelblue"; opacity: 0.3 }
70 model: ApplicationModel
73 height: grid.cellHeight
77 anchors.top: myIcon.bottom
78 anchors.left: parent.left
79 anchors.right: parent.right
83 wrapMode: Text.WordWrap
84 horizontalAlignment: Text.AlignHCenter
85 text: qsTr(model.name.toUpperCase())
90 anchors.top: parent.top
92 anchors.horizontalCenter: parent.horizontalCenter
93 // make the image/icons smaller than the grid cell size as
94 // the text below/above current cell not be on top of the
100 property string initial: model.name.substring(0,1).toUpperCase()
106 anchors.centerIn: parent
109 styleColor: '#00ADDC'
112 anchors.centerIn: parent
113 anchors.horizontalCenterOffset: model.index / 3 - 1
114 anchors.verticalCenterOffset: model.index % 3 - 1
115 text: model.icon === 'blank' ? myIcon.initial : ''
119 layer.effect: LinearGradient {
121 GradientStop { position: -0.5; color: "#6BFBFF" }
122 GradientStop { position: +1.5; color: "#00ADDC" }
131 property string currentApp: ''
133 parent.GridView.view.currentIndex = index
134 currentApp = ApplicationModel.appid(parent.GridView.view.currentIndex)
135 console.debug("Launcher: Starting app " + currentApp)
136 applauncher.startApplication(currentApp)
137 console.debug("Launcher: Started app " + currentApp)