forked from FOSS/BangleApps
give some breathing space to icons on the left
parent
9ad0ccd1bf
commit
14d1b23bd4
|
@ -4682,7 +4682,7 @@
|
|||
"icon": "widget.png",
|
||||
"version":"0.1.0",
|
||||
"type": "widget",
|
||||
"description": "A simple widget that shows a yellow lightning icon to indicate whenever the watch is charging. This way one can see if the watch is charging at a glance, no matter which battery widget is being used.",
|
||||
"description": "A simple widget that shows a yellow lightning icon to indicate whenever the watch is charging. This way one can see the charging status at a glance, no matter which battery widget is being used.",
|
||||
"tags": "widget",
|
||||
"supports": ["BANGLEJS","BANGLEJS2"],
|
||||
"storage": [
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
(() => {
|
||||
const icon = require("heatshrink").decompress(atob("ikggMAiEAgYIBmEAg4EB+EAh0AgPggEeCAIEBnwQBAgP+gEP//x///j//8f//k///H//4BYOP/4lBv4bDvwEB4EAvAEBwEAuA7DCAI7BgAQBhEAA"));
|
||||
const iconWidth = 18;
|
||||
|
||||
function draw() {
|
||||
g.reset();
|
||||
if (Bangle.isCharging()) {
|
||||
g.setColor("#FD0");
|
||||
g.drawImage(icon, this.x, this.y + 1, {
|
||||
g.drawImage(icon, this.x + 1, this.y + 1, {
|
||||
scale: 0.6875
|
||||
});
|
||||
}
|
||||
|
@ -13,14 +14,14 @@
|
|||
|
||||
WIDGETS.chargingStatus = {
|
||||
area: 'tr',
|
||||
width: Bangle.isCharging() ? 20 : 0,
|
||||
width: Bangle.isCharging() ? iconWidth : 0,
|
||||
draw: draw,
|
||||
};
|
||||
|
||||
Bangle.on('charging', (charging) => {
|
||||
if (charging) {
|
||||
Bangle.buzz();
|
||||
WIDGETS.chargingStatus.width = 20;
|
||||
WIDGETS.chargingStatus.width = iconWidth;
|
||||
} else {
|
||||
WIDGETS.chargingStatus.width = 0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue