summaryrefslogtreecommitdiffstats
path: root/app/wifi/Wifi.qml
diff options
context:
space:
mode:
authorTasuku Suzuki <tasuku.suzuki@qt.io>2016-12-22 17:48:21 +0900
committerTasuku Suzuki <tasuku.suzuki@qt.io>2016-12-22 17:48:21 +0900
commit3f93e29104ce0a175bb3d7a5641693c08c7a75e7 (patch)
tree4e32e66c896a4012cfa4a685198ed60d0cc2c93a /app/wifi/Wifi.qml
parent8403ee428e81f7d43b84b8214ac1f5de6ff98cad (diff)
Wifi: improve some property bindings
Change-Id: I051b364b33a922f3264459e2ffb5d4cb09bd2983 Signed-off-by: Tasuku Suzuki <tasuku.suzuki@qt.io>
Diffstat (limited to 'app/wifi/Wifi.qml')
-rw-r--r--app/wifi/Wifi.qml51
1 files changed, 17 insertions, 34 deletions
diff --git a/app/wifi/Wifi.qml b/app/wifi/Wifi.qml
index 8880453..56dd0df 100644
--- a/app/wifi/Wifi.qml
+++ b/app/wifi/Wifi.qml
@@ -88,22 +88,22 @@ SettingPage {
source: {
if (securityType(security) === "unsecured") {
if (strength < 30)
- source = "images/HMI_Settings_Wifi_1Bar.svg"
- else if (strength >= 30 && strength < 50)
- source = "images/HMI_Settings_Wifi_2Bars.svg"
- else if (strength >= 50 && strength < 70)
- source = "images/HMI_Settings_Wifi_3Bars.svg"
+ 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
- source = "images/HMI_Settings_Wifi_Full.svg"
+ return "images/HMI_Settings_Wifi_Full.svg"
} else {
if (strength < 30)
- source = "images/HMI_Settings_Wifi_Locked_1Bar.svg"
- else if (strength >= 30 && strength < 50)
- source = "images/HMI_Settings_Wifi_Locked_2Bars.svg"
- else if (strength >= 50 && strength < 70)
- source = "images/HMI_Settings_Wifi_Locked_3Bars.svg"
+ 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
- source = "images/HMI_Settings_Wifi_Locked_Full.svg"
+ return "images/HMI_Settings_Wifi_Locked_Full.svg"
}
}
}
@@ -115,17 +115,10 @@ SettingPage {
text: name
color: '#66FF99'
font.pixelSize: 48
- font.bold: {
- if ((serviceState === "ready")
- || serviceState === "online")
- font.bold = true
- else
- font.bold = false
- }
+ font.bold: serviceState === "ready" || serviceState === "online"
}
Text {
- visible: ((serviceState === "ready")
- || serviceState === "online") ? true : false
+ visible: serviceState === "ready" || serviceState === "online"
text: "connected, " + address
font.pointSize: 18
color: "white"
@@ -152,13 +145,7 @@ SettingPage {
color: "black"
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter
- text: {
- if ((serviceState === "ready")
- || serviceState === "online")
- text = "Forget"
- else
- text = "Connect"
- }
+ text: (serviceState === "ready" || serviceState === "online") ? 'Forget' : 'Connect'
}
onClicked: {
@@ -199,9 +186,7 @@ SettingPage {
width: 40
visible: (securityType(security) === "unsecured") ? false : true
- text: {
- "Key"
- }
+ text: "Key"
MouseArea {
anchors.fill: parent
@@ -235,9 +220,7 @@ SettingPage {
//anchors.rightMargin: connectButton.width + 5
//buttonText: "Connect"
- text: {
- "ok" //or some icon?
- }
+ text: "ok" //or some icon?
MouseArea {
anchors.fill: parent