X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=homescreen%2Fqml%2FIconItem.qml;h=a5c032e28ea003c63c17a27de5695f83b487c0eb;hb=85392e71f90a0322fdc08359ef1d829cdcf67381;hp=59131c023a378923219862e157e3d35b64d5df7b;hpb=69be38c5d975c96eee7adab238ffd608b99d8514;p=apps%2Fhomescreen.git diff --git a/homescreen/qml/IconItem.qml b/homescreen/qml/IconItem.qml index 59131c0..a5c032e 100644 --- a/homescreen/qml/IconItem.qml +++ b/homescreen/qml/IconItem.qml @@ -1,13 +1,74 @@ import QtQuick 2.0 +import QtQuick.Controls 2.0 +import QtGraphicalEffects 1.0 Item { id: main - Image { - id: item; parent: loc - x: main.x + 5; y: main.y + 5 - width: main.width - 10; height: main.height - 10; - source: './images/HMI_AppLauncher_%1_%2-01.png'.arg(model.icon).arg(loc.pressed && (loc.index === model.index || loc.currentId === model.id) ? 'Active' : 'Inactive') - antialiasing: item.state !== '' + width: 320 + height: 320 + property string icon: model.icon + + Item { + id: container + parent: loc + x: main.x + y: main.y + width: main.width + height: main.height + + Image { + id: item + anchors.top: parent.top + anchors.topMargin: 20 + anchors.horizontalCenter: parent.horizontalCenter + width: 220 + height: width + source: './images/%1_%2.svg'.arg(model.icon).arg(loc.pressed && (loc.index === model.index || loc.currentId === model.id) ? 'active' : 'inactive') + antialiasing: item.state !== '' + + property string initial: model.name.substring(0,1).toUpperCase() + + Item { + id: title + width: 125 + height: 125 + anchors.centerIn: parent + Repeater { + delegate: Label { + style: Text.Outline + styleColor: 'red' + color: 'transparent' + font.pixelSize: 125 + anchors.centerIn: parent + anchors.horizontalCenterOffset: model.index / 3 - 1 + anchors.verticalCenterOffset: model.index % 3 - 1 + text: item.initial + } + model: main.icon === 'blank' ? 9 : 0 + } + layer.enabled: true + layer.effect: LinearGradient { + gradient: Gradient { + GradientStop { position: -0.5; color: "#6BFBFF" } + GradientStop { position: +1.5; color: "#00ADDC" } + } + } + } + } + Label { + id: name + anchors.top: item.bottom + anchors.left: parent.left + anchors.right: parent.right + anchors.margins: 20 + font.pixelSize: 25 + font.letterSpacing: 5 + wrapMode: Text.WordWrap + horizontalAlignment: Text.AlignHCenter + color: "white" + text: qsTr(model.name.toUpperCase()) + } + Behavior on x { enabled: item.state !== 'active'; NumberAnimation { duration: 400; easing.type: Easing.OutCubic } } Behavior on y { enabled: item.state !== 'active'; NumberAnimation { duration: 400; easing.type: Easing.OutCubic } } SequentialAnimation on rotation { @@ -21,12 +82,18 @@ Item { State { name: 'active' when: loc.currentId == model.id - PropertyChanges { target: item; x: loc.mouseX - width/2; y: loc.mouseY - height/2; scale: 1.15; z: 10 } + PropertyChanges { + target: container + x: loc.mouseX - width/2 + y: loc.mouseY - height/2 + scale: 1.15 + z: 10 + } }, State { when: loc.currentId !== '' PropertyChanges { - target: item + target: container scale: 0.85 opacity: 0.75 }