Commit e15e82b5 authored by Sergey Chupligin's avatar Sergey Chupligin

[Statusbar] Indicators update

parent d44f255d
......@@ -85,6 +85,16 @@ Item {
key: "Cellular.RegistrationStatus"
}
ContextProperty {
id: bluetoothEnabled
key: "Bluetooth.Enabled"
}
ContextProperty {
id: bluetoothConnected
key: "Bluetooth.Connected"
}
NetworkManager {
id: networkManager
function updateTechnologies() {
......@@ -181,15 +191,15 @@ Item {
if (networkManager.defaultRoute.type !== "wifi")
return "image://theme/icon_wifi_0"
if (networkManager.defaultRoute.strength >= 59) {
return "image://theme/icon_wifi_normal4"
return "image://theme/icon_wifi_focused4"
} else if (networkManager.defaultRoute.strength >= 55) {
return "image://theme/icon_wifi_normal3"
return "image://theme/icon_wifi_focused3"
} else if (networkManager.defaultRoute.strength >= 50) {
return "image://theme/icon_wifi_normal2"
return "image://theme/icon_wifi_focused2"
} else if (networkManager.defaultRoute.strength >= 40) {
return "image://theme/icon_wifi_normal1"
return "image://theme/icon_wifi_focused1"
} else {
return "image://theme/icon_wifi_0"
return "image://theme/icon_wifi_normal4"
}
} else {
return "image://theme/icon_wifi_0"
......@@ -198,8 +208,10 @@ Item {
panel: WifiPanel {}
}
StatusbarItem {
id: bluetootIndicator
iconSize: root.height/2
source: "image://theme/icon_bt_normal"
source: (bluetoothConnected.value) ? "image://theme/icon_bt_focused" : "image://theme/icon_bt_normal"
visible: bluetoothEnabled.value
}
StatusbarItem {
iconSize: root.height/2
......
......@@ -25,12 +25,6 @@ Item {
panel_loader.sourceComponent = panel
panel_loader.visible = !panel_loader.visible
}
if (icon.source.toString().match("normal")) {
icon.source = icon.source.toString().replace("normal","focused")
} else {
icon.source = icon.source.toString().replace("focused","normal")
}
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment