From d05d7037a6b907a72e3dde98196cb0158d8c3fce Mon Sep 17 00:00:00 2001 From: Tasuku Suzuki Date: Thu, 22 Dec 2016 19:12:28 +0900 Subject: Wifi: Improve signal icon handling Change-Id: I72fd21ef0800bc35617d5bb38ceee7de2dca2350 Signed-off-by: Tasuku Suzuki --- app/wifi/Wifi.qml | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/app/wifi/Wifi.qml b/app/wifi/Wifi.qml index 43e32b7..afcc019 100644 --- a/app/wifi/Wifi.qml +++ b/app/wifi/Wifi.qml @@ -84,24 +84,19 @@ SettingPage { //height: 50 id: icon source: { + var svg + if (strength < 30) + svg = "1Bar" + else if (strength < 50) + svg = "2Bars" + else if (strength < 70) + svg = "3Bars" + else + svg = "Full" if (securityType(security) === "unsecured") { - if (strength < 30) - return "images/HMI_Settings_Wifi_1Bar.svg" - else if (strength < 50) - return "images/HMI_Settings_Wifi_2Bars.svg" - else if (strength < 70) - return "images/HMI_Settings_Wifi_3Bars.svg" - else - return "images/HMI_Settings_Wifi_Full.svg" + return 'images/HMI_Settings_Wifi_%1.svg'.arg(svg) } else { - if (strength < 30) - return "images/HMI_Settings_Wifi_Locked_1Bar.svg" - else if (strength < 50) - return "images/HMI_Settings_Wifi_Locked_2Bars.svg" - else if (strength < 70) - return "images/HMI_Settings_Wifi_Locked_3Bars.svg" - else - return "images/HMI_Settings_Wifi_Locked_Full.svg" + return 'images/HMI_Settings_Wifi_Locked_%1.svg'.arg(svg) } } } -- cgit 1.2.3-korg