From 85392e71f90a0322fdc08359ef1d829cdcf67381 Mon Sep 17 00:00:00 2001 From: zheng_wenlong Date: Tue, 10 Jul 2018 18:11:51 +0900 Subject: Copy source code from homescreen-2017 We decide to use homescreen instead of homescreen-2017. Copy the source code from homescreen-2017 and delete word "-2017". Revision: b4db06287bc997ded71deab50ff0ff5889b09e1f Bug-AGL: SPEC-1549 Change-Id: Id77226b7ce35bbc29c868281c37b76ea3f930ad5 Signed-off-by: zheng_wenlong --- homescreen/qml/ShortcutIcon.qml | 60 ++++++++++++++++++++++++++++++++++++----- 1 file changed, 53 insertions(+), 7 deletions(-) (limited to 'homescreen/qml/ShortcutIcon.qml') diff --git a/homescreen/qml/ShortcutIcon.qml b/homescreen/qml/ShortcutIcon.qml index 6f8e05e..1100a7c 100644 --- a/homescreen/qml/ShortcutIcon.qml +++ b/homescreen/qml/ShortcutIcon.qml @@ -16,6 +16,8 @@ */ import QtQuick 2.2 +import QtQuick.Controls 2.0 +import QtGraphicalEffects 1.0 MouseArea { id: root @@ -23,23 +25,62 @@ MouseArea { height: 216.8 property string name: 'Home' property bool active: false - Image { + Item { id: icon + property real desaturation: 0 anchors.fill: parent - source: './images/Shortcut/HMI_Shortcut_%1-01.png'.arg(root.name) + Image { + id: inactiveIcon + anchors.fill: parent + source: './images/Shortcut/%1.svg'.arg(root.name.toLowerCase()) + } + Image { + id: activeIcon + anchors.fill: parent + source: './images/Shortcut/%1_active.svg'.arg(root.name.toLowerCase()) + opacity: 0.0 + } + layer.enabled: true + layer.effect: Desaturate { + id: desaturate + desaturation: icon.desaturation + cached: true + } } - Image { - anchors.fill: parent - source: './images/Shortcut/HMI_Shortcut_%1_Active-01.png'.arg(root.name) - opacity: 1.0 - icon.opacity + Label { + id: name + y: 160 + width: root.width - 10 + font.pixelSize: 15 + font.letterSpacing: 5 + // wrapMode: Text.WordWrap + anchors.horizontalCenter: parent.horizontalCenter + horizontalAlignment: Text.AlignHCenter + color: "white" + text: qsTr(model.name.toUpperCase()) } states: [ State { - when: root.active + when: launcher.launching + PropertyChanges { + target: root + enabled: false + } PropertyChanges { target: icon + desaturation: 1.0 + } + }, + State { + when: root.active + PropertyChanges { + target: inactiveIcon opacity: 0.0 } + PropertyChanges { + target: activeIcon + opacity: 1.0 + } } ] @@ -47,8 +88,13 @@ MouseArea { Transition { NumberAnimation { properties: 'opacity' + duration: 500 easing.type: Easing.OutExpo } + NumberAnimation { + properties: 'desaturation' + duration: 250 + } } ] } -- cgit 1.2.3-korg