Home screen translation changes
[staging/HomeScreen.git] / HomeScreen / qml / ShortcutIcon.qml
1 /*
2  * Copyright (C) 2016 The Qt Company Ltd.
3  * Copyright (C) 2016 Mentor Graphics Development (Deutschland) GmbH
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  *      http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17
18 import QtQuick 2.2
19 import QtQuick.Controls 1.0
20
21 MouseArea {
22     id: root
23     width: 195
24     height: 216.8
25     property string name: 'Home'
26     property bool active: false
27     Image {
28         id: icon
29         anchors.fill: parent
30         source: './images/Shortcut/HMI_Shortcut_%1-01.png'.arg(root.name)
31     }
32     Image {
33         anchors.fill: parent
34         source: './images/Shortcut/HMI_Shortcut_%1_Active-01.png'.arg(root.name)
35         opacity: 1.0 - icon.opacity
36     }
37     Label {
38         id: labelName
39         anchors.horizontalCenter: parent.horizontalCenter
40         horizontalAlignment: Text.AlignHCenter
41         y: 155
42         font.pixelSize: 20
43         font.family: "Roboto"
44         color: "white"
45         text: '%1'.arg(model.label)
46     }
47     states: [
48         State {
49             when: root.active
50             PropertyChanges {
51                 target: icon
52                 opacity: 0.0
53             }
54         }
55     ]
56
57     transitions: [
58         Transition {
59             NumberAnimation {
60                 properties: 'opacity'
61                 easing.type: Easing.OutExpo
62             }
63         }
64     ]
65 }