1
0
Fork 0

widbtstates: generate better js indexing

with a slight typescript hack - avoid generating a new string when
we can use a boolean
master
Rob Pilling 2024-12-03 12:19:31 +00:00
parent 22078e87cc
commit 7a431011df
4 changed files with 4 additions and 3 deletions

View File

@ -1 +1,2 @@
0.01: New App!
0.02: Improve generated JS

View File

@ -1,7 +1,7 @@
{
"id": "widbtstates",
"name": "Bluetooth States",
"version": "0.01",
"version": "0.02",
"description": "If active, shows a white bluetooth icon, if connected, a blue one (nothing if sleeping)",
"icon": "widget.png",
"type": "widget",

View File

@ -32,7 +32,7 @@
if (state == 0)
return;
g.reset();
g.setColor(colours[state]["".concat(g.theme.dark)]);
g.setColor(colours[state][g.theme.dark]);
g.drawImage(atob("CxQBBgDgFgJgR4jZMawfAcA4D4NYybEYIwTAsBwDAA=="), this.x + 2, this.y + 2);
},
width: width(),

View File

@ -48,7 +48,7 @@
g.reset();
g.setColor(colours[state][`${g.theme.dark}`]);
g.setColor(colours[state][g.theme.dark as unknown as `${boolean}`]);
g.drawImage(
atob("CxQBBgDgFgJgR4jZMawfAcA4D4NYybEYIwTAsBwDAA=="),