X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=homescreen%2Fqml%2FShortcutIcon.qml;fp=homescreen%2Fqml%2FShortcutIcon.qml;h=e891c991256ba1d08c1519dc5f8a25b6284b3083;hb=7d29d877baafe52cc0e0bbdf7d86deff61073651;hp=1100a7cd234ee30da303f13c14bd974017c18b5e;hpb=33c89065c315edd838873116bec8723326f43488;p=apps%2Fhomescreen.git diff --git a/homescreen/qml/ShortcutIcon.qml b/homescreen/qml/ShortcutIcon.qml index 1100a7c..e891c99 100644 --- a/homescreen/qml/ShortcutIcon.qml +++ b/homescreen/qml/ShortcutIcon.qml @@ -24,7 +24,10 @@ MouseArea { width: 195 height: 216.8 property string name: 'Home' + property string icon:'./images/Shortcut/' property bool active: false + property bool isBlank: false + Item { id: icon property real desaturation: 0 @@ -32,14 +35,42 @@ MouseArea { Image { id: inactiveIcon anchors.fill: parent - source: './images/Shortcut/%1.svg'.arg(root.name.toLowerCase()) + source: './images/Shortcut/blank.svg' +// source: isBlank ? './images/Shortcut/blank.svg' : root.icon + property string initial: root.name.substring(0,1).toUpperCase() + Label { + style: Text.Outline + styleColor: '#00FFFF' + color: 'transparent' + font.pixelSize: 75 + anchors.centerIn: parent + text: inactiveIcon.initial + visible: root.isBlank + } } Image { id: activeIcon anchors.fill: parent - source: './images/Shortcut/%1_active.svg'.arg(root.name.toLowerCase()) + source: './images/Shortcut/blank_active.svg' +// source: isBlank ? './images/Shortcut/blank_active.svg' : root.icon + property string initial: root.name.substring(0,1).toUpperCase() + Label { + style: Text.Outline + styleColor: '#00FFFF' + color: 'transparent' + font.pixelSize: 75 + anchors.centerIn: parent + text: activeIcon.initial + visible: root.isBlank + } opacity: 0.0 } + Image { + id: sourceIcon + anchors.fill: parent + source: isBlank ? null : root.icon + } + layer.enabled: true layer.effect: Desaturate { id: desaturate @@ -47,6 +78,7 @@ MouseArea { cached: true } } + Label { id: name y: 160 @@ -57,20 +89,10 @@ MouseArea { anchors.horizontalCenter: parent.horizontalCenter horizontalAlignment: Text.AlignHCenter color: "white" - text: qsTr(model.name.toUpperCase()) + text: qsTr((root.name === "launcher" ? "home" : root.name).toUpperCase()) } + states: [ - State { - when: launcher.launching - PropertyChanges { - target: root - enabled: false - } - PropertyChanges { - target: icon - desaturation: 1.0 - } - }, State { when: root.active PropertyChanges { @@ -83,18 +105,4 @@ MouseArea { } } ] - - transitions: [ - Transition { - NumberAnimation { - properties: 'opacity' - duration: 500 - easing.type: Easing.OutExpo - } - NumberAnimation { - properties: 'desaturation' - duration: 250 - } - } - ] }