Icons: battery + bt
This commit is contained in:
parent
a4107c87c0
commit
74cf71755b
2 changed files with 15 additions and 16 deletions
|
|
@ -10,20 +10,20 @@ Singleton {
|
||||||
// Choose icon based on charge and charging state
|
// Choose icon based on charge and charging state
|
||||||
function getIcon(percent, charging, isReady) {
|
function getIcon(percent, charging, isReady) {
|
||||||
if (!isReady) {
|
if (!isReady) {
|
||||||
return Bootstrap.icons["battery_empty"] // FIXME: find battery error ?
|
return Bootstrap.icons["battery"] // FIXME: find battery error ?
|
||||||
}
|
}
|
||||||
|
|
||||||
if (charging) {
|
if (charging) {
|
||||||
return Bootstrap.icons["battery_charging"]
|
return Bootstrap.icons["battery-charging"]
|
||||||
} else {
|
} else {
|
||||||
if (percent >= 85)
|
if (percent >= 85)
|
||||||
return Bootstrap.icons["battery_full"]
|
return Bootstrap.icons["battery-full"]
|
||||||
if (percent >= 45)
|
if (percent >= 45)
|
||||||
return Bootstrap.icons["battery_half"]
|
return Bootstrap.icons["battery-half"]
|
||||||
if (percent >= 25)
|
if (percent >= 25)
|
||||||
return Bootstrap.icons["battery_low"]
|
return Bootstrap.icons["battery-low"]
|
||||||
if (percent >= 0)
|
if (percent >= 0)
|
||||||
return Bootstrap.icons["battery_empty"]
|
return Bootstrap.icons["battery"]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -49,39 +49,38 @@ Singleton {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME
|
|
||||||
function getDeviceIcon(device) {
|
function getDeviceIcon(device) {
|
||||||
if (!device) {
|
if (!device) {
|
||||||
return "bluetooth"
|
return Bootstrap.icons["bluetooth"]
|
||||||
}
|
}
|
||||||
|
|
||||||
var name = (device.name || device.deviceName || "").toLowerCase()
|
var name = (device.name || device.deviceName || "").toLowerCase()
|
||||||
var icon = (device.icon || "").toLowerCase()
|
var icon = (device.icon || "").toLowerCase()
|
||||||
if (icon.includes("headset") || icon.includes("audio") || name.includes("headphone") || name.includes("airpod")
|
if (icon.includes("headset") || icon.includes("audio") || name.includes("headphone") || name.includes("airpod")
|
||||||
|| name.includes("headset") || name.includes("arctis")) {
|
|| name.includes("headset") || name.includes("arctis")) {
|
||||||
return "headset"
|
return Bootstrap.icons["headset"]
|
||||||
}
|
}
|
||||||
|
|
||||||
if (icon.includes("mouse") || name.includes("mouse")) {
|
if (icon.includes("mouse") || name.includes("mouse")) {
|
||||||
return "mouse"
|
return Bootstrap.icons["mouse-2"]
|
||||||
}
|
}
|
||||||
if (icon.includes("keyboard") || name.includes("keyboard")) {
|
if (icon.includes("keyboard") || name.includes("keyboard")) {
|
||||||
return "keyboard"
|
return Bootstrap.icons["keyboard"]
|
||||||
}
|
}
|
||||||
if (icon.includes("phone") || name.includes("phone") || name.includes("iphone") || name.includes("android")
|
if (icon.includes("phone") || name.includes("phone") || name.includes("iphone") || name.includes("android")
|
||||||
|| name.includes("samsung")) {
|
|| name.includes("samsung")) {
|
||||||
return "smartphone"
|
return Bootstrap.icons["phone"]
|
||||||
}
|
}
|
||||||
if (icon.includes("watch") || name.includes("watch")) {
|
if (icon.includes("watch") || name.includes("watch")) {
|
||||||
return "watch"
|
return Bootstrap.icons["smartwatch"]
|
||||||
}
|
}
|
||||||
if (icon.includes("speaker") || name.includes("speaker")) {
|
if (icon.includes("speaker") || name.includes("speaker")) {
|
||||||
return "speaker"
|
return Bootstrap.icons["speaker"]
|
||||||
}
|
}
|
||||||
if (icon.includes("display") || name.includes("tv")) {
|
if (icon.includes("display") || name.includes("tv")) {
|
||||||
return "tv"
|
return Bootstrap.icons["tv"]
|
||||||
}
|
}
|
||||||
return "bluetooth"
|
return Bootstrap.icons["bluetooth"]
|
||||||
}
|
}
|
||||||
|
|
||||||
function canConnect(device) {
|
function canConnect(device) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue