summaryrefslogtreecommitdiffstats
path: root/src/settingsui/network/WifiSignalMonitor.qml
diff options
context:
space:
mode:
authorKimmo Ollila <kimmo.ollila@theqtcompany.com>2016-02-23 09:13:21 +0200
committerKimmo Ollila <kimmo.ollila@theqtcompany.com>2016-03-02 12:51:24 +0000
commitc6b5855b446c73f8a60cc3d4427fc445e0ba400d (patch)
treeb57f45df2a297335392f56953410a4c3ab599a8d /src/settingsui/network/WifiSignalMonitor.qml
parentf1d884b6dad5a93d7a3077b6b05d3ec7fcd9a6ea (diff)
Migrate settings UI to use Qt Quick Controls 2
Task-number: QTEE-1057 Change-Id: I389d784241d4b68384765dfde4b572e7652eb76c Reviewed-by: Teemu Holappa <teemu.holappa@theqtcompany.com>
Diffstat (limited to 'src/settingsui/network/WifiSignalMonitor.qml')
-rw-r--r--src/settingsui/network/WifiSignalMonitor.qml38
1 files changed, 23 insertions, 15 deletions
diff --git a/src/settingsui/network/WifiSignalMonitor.qml b/src/settingsui/network/WifiSignalMonitor.qml
index 35d9e53..40a0837 100644
--- a/src/settingsui/network/WifiSignalMonitor.qml
+++ b/src/settingsui/network/WifiSignalMonitor.qml
@@ -33,11 +33,10 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-import QtQuick 2.5
+import QtQuick 2.6
Item {
id: root
-
property bool scanning: false
property int signalStrength: 100
property bool connected: false
@@ -63,21 +62,30 @@ Item {
}
Image {
+ id: sprite
+ property int currentFrame: 0
anchors.fill: parent
source: "Wifi_lightgray_2x.png"
- }
+ clip: true
- AnimatedSprite {
- id: sprite
- anchors.fill: parent
- source: connected ? "WifiAnim_qt_2x.png" : "WifiAnim_black_2x.png"
- frameDuration: 500
- frameCount: 4
- currentFrame: 3
- frameSync: false
- frameWidth: 32
- frameHeight: 32
- loops: 40
- running: scanning
+ Timer {
+ id: scanningTimer
+ running: scanning
+ interval: 250
+ repeat: true
+ onTriggered: {
+ if (sprite.currentFrame < 4)
+ sprite.currentFrame++
+ else
+ sprite.currentFrame = 0
+ }
+ }
+
+ Image {
+ height: parent.height
+ width: parent.width * 4
+ source: "WifiAnim_black_2x.png"
+ x: -parent.currentFrame * width / 4
+ }
}
}