Icons: huge cleanup
This commit is contained in:
parent
ccdb4e0664
commit
1f8c55d581
53 changed files with 155 additions and 174 deletions
|
|
@ -11,20 +11,20 @@ Singleton {
|
|||
// Choose icon based on charge and charging state
|
||||
function getIcon(percent, charging, isReady) {
|
||||
if (!isReady) {
|
||||
return Bootstrap.icons["exclamation-diamond"]
|
||||
return "exclamation-diamond"
|
||||
}
|
||||
|
||||
if (charging) {
|
||||
return Bootstrap.icons["battery-charging"]
|
||||
return "battery-charging"
|
||||
} else {
|
||||
if (percent >= 85)
|
||||
return Bootstrap.icons["battery-full"]
|
||||
return "battery-full"
|
||||
if (percent >= 45)
|
||||
return Bootstrap.icons["battery-half"]
|
||||
return "battery-half"
|
||||
if (percent >= 25)
|
||||
return Bootstrap.icons["battery-low"]
|
||||
return "battery-low"
|
||||
if (percent >= 0)
|
||||
return Bootstrap.icons["battery"]
|
||||
return "battery"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,36 +51,36 @@ Singleton {
|
|||
|
||||
function getDeviceIcon(device) {
|
||||
if (!device) {
|
||||
return Bootstrap.icons["bluetooth"]
|
||||
return "bluetooth"
|
||||
}
|
||||
|
||||
var name = (device.name || device.deviceName || "").toLowerCase()
|
||||
var icon = (device.icon || "").toLowerCase()
|
||||
if (icon.includes("headset") || icon.includes("audio") || name.includes("headphone") || name.includes("airpod")
|
||||
|| name.includes("headset") || name.includes("arctis")) {
|
||||
return Bootstrap.icons["headset"]
|
||||
return "headset"
|
||||
}
|
||||
|
||||
if (icon.includes("mouse") || name.includes("mouse")) {
|
||||
return Bootstrap.icons["mouse-2"]
|
||||
return "mouse-2"
|
||||
}
|
||||
if (icon.includes("keyboard") || name.includes("keyboard")) {
|
||||
return Bootstrap.icons["keyboard"]
|
||||
return "keyboard"
|
||||
}
|
||||
if (icon.includes("phone") || name.includes("phone") || name.includes("iphone") || name.includes("android")
|
||||
|| name.includes("samsung")) {
|
||||
return Bootstrap.icons["phone"]
|
||||
return "phone"
|
||||
}
|
||||
if (icon.includes("watch") || name.includes("watch")) {
|
||||
return Bootstrap.icons["smartwatch"]
|
||||
return "smartwatch"
|
||||
}
|
||||
if (icon.includes("speaker") || name.includes("speaker")) {
|
||||
return Bootstrap.icons["speaker"]
|
||||
return "speaker"
|
||||
}
|
||||
if (icon.includes("display") || name.includes("tv")) {
|
||||
return Bootstrap.icons["tv"]
|
||||
return "tv"
|
||||
}
|
||||
return Bootstrap.icons["bluetooth"]
|
||||
return "bluetooth"
|
||||
}
|
||||
|
||||
function canConnect(device) {
|
||||
|
|
|
|||
|
|
@ -231,24 +231,24 @@ Singleton {
|
|||
// --------------------------------
|
||||
function weatherSymbolFromCode(code) {
|
||||
if (code === 0)
|
||||
return Bootstrap.icons["sun"]
|
||||
return "sun"
|
||||
if (code === 1 || code === 2)
|
||||
return Bootstrap.icons["cloud-sun"]
|
||||
return "cloud-sun"
|
||||
if (code === 3)
|
||||
return Bootstrap.icons["cloud"]
|
||||
return "cloud"
|
||||
if (code >= 45 && code <= 48)
|
||||
return Bootstrap.icons["cloud-haze"]
|
||||
return "cloud-haze"
|
||||
if (code >= 51 && code <= 67)
|
||||
return Bootstrap.icons["cloud-rain"]
|
||||
return "cloud-rain"
|
||||
if (code >= 71 && code <= 77)
|
||||
return Bootstrap.icons["cloud-snow"]
|
||||
return "cloud-snow"
|
||||
if (code >= 71 && code <= 77)
|
||||
return Bootstrap.icons["cloud-snow"]
|
||||
return "cloud-snow"
|
||||
if (code >= 85 && code <= 86)
|
||||
return Bootstrap.icons["cloud-snow"]
|
||||
return "cloud-snow"
|
||||
if (code >= 95 && code <= 99)
|
||||
return Bootstrap.icons["cloud-lightning"]
|
||||
return Bootstrap.icons["cloud"]
|
||||
return "cloud-lightning"
|
||||
return "cloud"
|
||||
}
|
||||
|
||||
// --------------------------------
|
||||
|
|
|
|||
|
|
@ -202,14 +202,12 @@ Singleton {
|
|||
// Helper functions
|
||||
function signalIcon(signal) {
|
||||
if (signal >= 80)
|
||||
return "network_wifi"
|
||||
if (signal >= 60)
|
||||
return "network_wifi_3_bar"
|
||||
if (signal >= 40)
|
||||
return "network_wifi_2_bar"
|
||||
return "wifi"
|
||||
if (signal >= 50)
|
||||
return "wifi-2"
|
||||
if (signal >= 20)
|
||||
return "network_wifi_1_bar"
|
||||
return "signal_wifi_0_bar"
|
||||
return "wifi-1"
|
||||
return "dot"
|
||||
}
|
||||
|
||||
function isSecured(security) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue