2 * Copyright (c) 2017 TOYOTA MOTOR CORPORATION
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.Window 2.2
19 import QtQuick.Layouts 1.1
20 import QtQuick.Controls 2.0
21 import AGL.Demo.Controls 1.0
22 import OnScreenModel 1.0
26 flags: Qt.FramelessWindowHint
36 anchors.centerIn: parent
40 property string dsp_sts: "hide"
41 property string dsp_title: ""
42 property string dsp_icon: ""
43 property string dsp_contents: ""
44 property int btnNum: 0
45 property string btn1Name: ""
46 property string btn2Name: ""
47 property string btn3Name: ""
52 when: ons.dsp_sts == "show"
61 when: ons.dsp_sts == "hide"
69 transitions: Transition {
73 easing.type: Easing.Linear
96 console.log(qsTr('hide animation finished'));
97 eventHandler.deactivateWindow();
102 function showOnScreen() {
103 console.log(qsTr('show onscreenapp'));
104 ons.dsp_title = onscreenModel.getTitle()
105 ons.dsp_icon = "../images/" + onscreenModel.getType() + ".svg"
106 ons.dsp_contents = onscreenModel.getContents()
107 ons.btnNum = onscreenModel.buttonNum()
108 ons.btn1Name = onscreenModel.buttonName(0)
109 ons.btn2Name = onscreenModel.buttonName(1)
110 ons.btn3Name = onscreenModel.buttonName(2)
111 ons_timer.running = ons.btnNum > 0 ? false : true
115 function hideOnScreen() {
116 console.log(qsTr('hide onscreenapp'));
118 ons_timer.running = false
121 function setOnScreenModel(data) {
122 console.log(qsTr('onscreenapp >>> setModel status: ' + data));
123 onscreenModel.setModel(data)