Bluetooth devices icons
This commit is contained in:
parent
a38f49cb35
commit
7adc7f43cc
2 changed files with 21 additions and 12 deletions
|
|
@ -29,7 +29,7 @@ Singleton {
|
|||
"download-speed": "download",
|
||||
"upload-speed": "upload",
|
||||
"storage": "device-floppy",
|
||||
"bluetooth": "bluetooth",
|
||||
|
||||
"ethernet": "network",
|
||||
"keyboard": "keyboard",
|
||||
"power": "power",
|
||||
|
|
@ -89,8 +89,17 @@ Singleton {
|
|||
"settings-wallpaper-selector": "library-photo",
|
||||
"settings-screen-recorder": "video",
|
||||
"settings-hooks": "link",
|
||||
"settings-about": "info-square-rounded"
|
||||
// TODO BT DEVICES
|
||||
"settings-about": "info-square-rounded",
|
||||
|
||||
"bluetooth": "bluetooth",
|
||||
"bt-device-generic": "bluetooth",
|
||||
"bt-device-headphones": "headphones-filled",
|
||||
"bt-device-mouse": "mouse-2",
|
||||
"bt-device-keyboard": "bluetooth",
|
||||
"bt-device-phone": "device-mobile-filled",
|
||||
"bt-device-watch": "device-watch",
|
||||
"bt-device-speaker": "device-speaker",
|
||||
"bt-device-tv": "device-tv",
|
||||
}
|
||||
|
||||
readonly property var icons: {
|
||||
|
|
|
|||
|
|
@ -51,36 +51,36 @@ Singleton {
|
|||
|
||||
function getDeviceIcon(device) {
|
||||
if (!device) {
|
||||
return "bluetooth"
|
||||
return "bt-device-generic"
|
||||
}
|
||||
|
||||
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 "headset"
|
||||
return "bt-device-headphones"
|
||||
}
|
||||
|
||||
if (icon.includes("mouse") || name.includes("mouse")) {
|
||||
return "mouse-2"
|
||||
return "bt-device-mouse"
|
||||
}
|
||||
if (icon.includes("keyboard") || name.includes("keyboard")) {
|
||||
return "keyboard"
|
||||
return "bt-device-keyboard"
|
||||
}
|
||||
if (icon.includes("phone") || name.includes("phone") || name.includes("iphone") || name.includes("android")
|
||||
|| name.includes("samsung")) {
|
||||
return "phone"
|
||||
return "bt-device-phone"
|
||||
}
|
||||
if (icon.includes("watch") || name.includes("watch")) {
|
||||
return "smartwatch"
|
||||
return "bt-device-watch"
|
||||
}
|
||||
if (icon.includes("speaker") || name.includes("speaker")) {
|
||||
return "speaker"
|
||||
return "bt-device-speaker"
|
||||
}
|
||||
if (icon.includes("display") || name.includes("tv")) {
|
||||
return "tv"
|
||||
return "bt-device-tv"
|
||||
}
|
||||
return "bluetooth"
|
||||
return "bt-device-generic"
|
||||
}
|
||||
|
||||
function canConnect(device) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue