Icons: WIP using a proper mapping table
This commit is contained in:
parent
8da2cdf430
commit
a4107c87c0
41 changed files with 2277 additions and 183 deletions
|
|
@ -10,20 +10,20 @@ Singleton {
|
|||
// Choose icon based on charge and charging state
|
||||
function getIcon(percent, charging, isReady) {
|
||||
if (!isReady) {
|
||||
return FontService.icons["battery_empty"] // FIXME: find battery error ?
|
||||
return Bootstrap.icons["battery_empty"] // FIXME: find battery error ?
|
||||
}
|
||||
|
||||
if (charging) {
|
||||
return FontService.icons["battery_charging"]
|
||||
return Bootstrap.icons["battery_charging"]
|
||||
} else {
|
||||
if (percent >= 85)
|
||||
return FontService.icons["battery_full"]
|
||||
return Bootstrap.icons["battery_full"]
|
||||
if (percent >= 45)
|
||||
return FontService.icons["battery_half"]
|
||||
return Bootstrap.icons["battery_half"]
|
||||
if (percent >= 25)
|
||||
return FontService.icons["battery_low"]
|
||||
return Bootstrap.icons["battery_low"]
|
||||
if (percent >= 0)
|
||||
return FontService.icons["battery_empty"]
|
||||
return Bootstrap.icons["battery_empty"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,85 +13,6 @@ Singleton {
|
|||
property ListModel displayFonts: ListModel {}
|
||||
property bool fontsLoaded: false
|
||||
|
||||
property var icons: {
|
||||
"sunny": "\uF1D2",
|
||||
"partly_cloudy": "\uF2BE",
|
||||
"cloud": "\uF2C3",
|
||||
"foggy": "\uF2A7",
|
||||
"rainy": "\uF29D",
|
||||
"snowy": "\uF2BC",
|
||||
"thunderstorm": "\uF2AC",
|
||||
"battery_empty": "\uF188",
|
||||
"battery_low": "\uF911",
|
||||
"battery_half": "\uF187",
|
||||
"battery_full": "\uF186",
|
||||
"battery_charging": "\uF185",
|
||||
"volume_muted": "\uF60D",
|
||||
"volume_off": "\uF60F",
|
||||
"volume_half": "\uF60B",
|
||||
"volume_full": "\uF611",
|
||||
"brightness_low": "\uF1D4",
|
||||
"brightness_high": "\uF1D2",
|
||||
"wifi_disable": "\uF61B",
|
||||
"wifi_low": "\uF619",
|
||||
"wifi_half": "\uF61A",
|
||||
"wifi_full": "\uF61C",
|
||||
"power": "\uF4FF",
|
||||
"gear": "\uF3E5",
|
||||
"close": "\uF659",
|
||||
"check": "\uF272",
|
||||
"panel": "\uF290",
|
||||
"memory": "\uF2D6",
|
||||
"trash": "\uF78B",
|
||||
"video_camera": "\uF21F",
|
||||
"ethernet": "\uF2EB",
|
||||
"speed": "\uF66B",
|
||||
"leaf": "\uF90C",
|
||||
"microphone": "\uF490",
|
||||
"microphone_muted": "\uF48F",
|
||||
"coffee": "\uF2E0",
|
||||
"refresh": "\uF130",
|
||||
"image": "\uF226",
|
||||
"contrast": "\uF288",
|
||||
"thermometer": "\uF5CD",
|
||||
"paint_drop": "\uF30C",
|
||||
"yin_yang": "\uF8E7",
|
||||
"record": "\uF518",
|
||||
"pause": "\uF4C1",
|
||||
"play": "\uF4F2",
|
||||
"stop": "\uF590",
|
||||
"prev": "\uF561",
|
||||
"next": "\uF55B",
|
||||
"arrow_drop_down": "\uF22C",
|
||||
"warning": "\uF334",
|
||||
"info": "\uF26A",
|
||||
"upload": "\uF296",
|
||||
"download": "\uF294",
|
||||
"album": "\uF2FF",
|
||||
"plus": "\uF64D",
|
||||
"minus": "\uF63B",
|
||||
"eyedropper": "\uF342",
|
||||
"bell": "\uF18A",
|
||||
"bell_striked": "\uF631",
|
||||
"drive": "\uF412",
|
||||
"bluetooth": "\uF682",
|
||||
"person": "\uF4DA",
|
||||
"bar": "\uF52B",
|
||||
"launcher": "\uF843",
|
||||
"palette": "\uF4B1",
|
||||
"sunrise": "\uF5A5",
|
||||
"moon_stars": "\uF496",
|
||||
"gauge": "\uF580",
|
||||
"lightning": "\uF46D",
|
||||
"keyboard": "\uF451",
|
||||
"paint_brush": "\uEE26",
|
||||
"link": "\uF470",
|
||||
"macaron": "\uF154",
|
||||
"box": "\uF1C8",
|
||||
"monitor": "\uF302",
|
||||
// another contrast \uF8F3 \uF8DA
|
||||
}
|
||||
|
||||
// -------------------------------------------
|
||||
function init() {
|
||||
Logger.log("Font", "Service started")
|
||||
|
|
|
|||
|
|
@ -231,24 +231,24 @@ Singleton {
|
|||
// --------------------------------
|
||||
function weatherSymbolFromCode(code) {
|
||||
if (code === 0)
|
||||
return FontService.icons["sunny"]
|
||||
return Bootstrap.icons["sun"]
|
||||
if (code === 1 || code === 2)
|
||||
return FontService.icons["partly_cloudy"]
|
||||
return Bootstrap.icons["cloud-sun"]
|
||||
if (code === 3)
|
||||
return FontService.icons["cloud"]
|
||||
return Bootstrap.icons["cloud"]
|
||||
if (code >= 45 && code <= 48)
|
||||
return FontService.icons["foggy"]
|
||||
return Bootstrap.icons["cloud-haze"]
|
||||
if (code >= 51 && code <= 67)
|
||||
return FontService.icons["rainy"]
|
||||
return Bootstrap.icons["cloud-rain"]
|
||||
if (code >= 71 && code <= 77)
|
||||
return FontService.icons["snowy"]
|
||||
return Bootstrap.icons["cloud-snow"]
|
||||
if (code >= 71 && code <= 77)
|
||||
return FontService.icons["snowy"]
|
||||
return Bootstrap.icons["cloud-snow"]
|
||||
if (code >= 85 && code <= 86)
|
||||
return FontService.icons["snowy"]
|
||||
return Bootstrap.icons["cloud-snow"]
|
||||
if (code >= 95 && code <= 99)
|
||||
return FontService.icons["thunderstorm"]
|
||||
return FontService.icons["cloud"]
|
||||
return Bootstrap.icons["cloud-lightning"]
|
||||
return Bootstrap.icons["cloud"]
|
||||
}
|
||||
|
||||
// --------------------------------
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue