summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan-Simon Moeller <jsmoeller@linuxfoundation.org>2016-12-22 13:44:36 +0000
committerGerrit Code Review <gerrit@automotivelinux.org>2016-12-22 13:44:36 +0000
commit119266035058058fb897e8e21185435867086a94 (patch)
treeb5f75d295d5528d49c140506227e554c381dfc52
parentf190d1ecfe4d3d25e20becc212f270207212b249 (diff)
parent3f93e29104ce0a175bb3d7a5641693c08c7a75e7 (diff)
Merge "Wifi: improve some property bindings"
-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 ad640da..1a5812a 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