diff options
author | wang_zhiqiang <wang_zhiqiang@dl.cn.nexty-ele.com> | 2019-05-28 14:00:55 +0800 |
---|---|---|
committer | wang_zhiqiang <wang_zhiqiang@dl.cn.nexty-ele.com> | 2019-05-28 14:00:55 +0800 |
commit | 7d29d877baafe52cc0e0bbdf7d86deff61073651 (patch) | |
tree | b3d106a241e5c3b5be6b7f1fbe596ac3024ae0ad /homescreen/qml/ShortcutIcon.qml | |
parent | 33c89065c315edd838873116bec8723326f43488 (diff) |
registerShortcut
Change-Id: I66dbf6f12a890e67908594ed238556f5456b7ed7
Diffstat (limited to 'homescreen/qml/ShortcutIcon.qml')
-rw-r--r-- | homescreen/qml/ShortcutIcon.qml | 64 |
1 files changed, 36 insertions, 28 deletions
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,21 +89,11 @@ 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 { target: inactiveIcon @@ -83,18 +105,4 @@ MouseArea { } } ] - - transitions: [ - Transition { - NumberAnimation { - properties: 'opacity' - duration: 500 - easing.type: Easing.OutExpo - } - NumberAnimation { - properties: 'desaturation' - duration: 250 - } - } - ] } |