diff options
author | tiansen <tian_sen@dl.cn.nexty-ele.com> | 2018-11-02 10:08:22 +0800 |
---|---|---|
committer | tiansen <tian_sen@dl.cn.nexty-ele.com> | 2018-11-02 10:08:22 +0800 |
commit | c5aad6f23f523bf44bf58419bb2fc41262be2180 (patch) | |
tree | b7b3331bc10a8e327d54ac634545e836579d55a4 /homescreen/qml/ShortcutIcon.qml | |
parent | 33d31b5bac3c8c9105d43d6566174f39ef7a4ea4 (diff) |
horizontalsandbox/tiansen/horizontal
Diffstat (limited to 'homescreen/qml/ShortcutIcon.qml')
-rw-r--r-- | homescreen/qml/ShortcutIcon.qml | 54 |
1 files changed, 14 insertions, 40 deletions
diff --git a/homescreen/qml/ShortcutIcon.qml b/homescreen/qml/ShortcutIcon.qml index 1100a7c..026db32 100644 --- a/homescreen/qml/ShortcutIcon.qml +++ b/homescreen/qml/ShortcutIcon.qml @@ -21,8 +21,8 @@ import QtGraphicalEffects 1.0 MouseArea { id: root - width: 195 - height: 216.8 + width: 70 + height: 70 property string name: 'Home' property bool active: false Item { @@ -32,12 +32,12 @@ MouseArea { Image { id: inactiveIcon anchors.fill: parent - source: './images/Shortcut/%1.svg'.arg(root.name.toLowerCase()) + source: './images/Shortcut/%1.png'.arg(root.name.toLowerCase()) } Image { id: activeIcon anchors.fill: parent - source: './images/Shortcut/%1_active.svg'.arg(root.name.toLowerCase()) + source: './images/Shortcut/%1_active.png'.arg(root.name.toLowerCase()) opacity: 0.0 } layer.enabled: true @@ -47,42 +47,6 @@ MouseArea { cached: true } } - 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: 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 - } - } - ] transitions: [ Transition { @@ -97,4 +61,14 @@ MouseArea { } } ] + + onPressed: { + activeIcon.opacity = 1.0 + inactiveIcon.opacity = 0.0 + } + + onReleased: { + activeIcon.opacity = 0.0 + inactiveIcon.opacity = 1.0 + } } |