Skip to content

Commit 6f309a8

Browse files
authored
Merge pull request #3926 from RKBoss6/patch-1
[A Battery Widget] Background color matches Bangle’s theme
2 parents aad30da + e432ebb commit 6f309a8

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

apps/wid_a_battery_widget/ChangeLog

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
0.02: Internal id update to wid_* as per Gordon's request (2021/11/21)
33
0.03: Support dark themes
44
0.04: Increase screen update rate when charging
5+
0.05: Add support for all foreground and background colors (2025/7/5)

apps/wid_a_battery_widget/metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"name": "A Battery Widget (with percentage)",
44
"shortName":"A Battery Widget",
55
"icon": "widget.png",
6-
"version":"0.04",
6+
"version":"0.05",
77
"type": "widget",
88
"supports": ["BANGLEJS", "BANGLEJS2"],
99
"readme": "README.md",

apps/wid_a_battery_widget/widget.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
const intervalHigh = 2000; // update time when charging
44

55
let COLORS = {
6-
'white': g.theme.dark ? "#000" : "#fff",
7-
'black': g.theme.dark ? "#fff" : "#000",
6+
'bg': g.theme.bg,
7+
'fg': g.theme.fg,
88
'charging': "#08f",
99
'high': g.theme.dark ? "#fff" : "#000",
1010
'low': "#f00",
@@ -24,7 +24,7 @@
2424

2525
let xl = x+4+l*(s-12)/100;
2626

27-
g.setColor(COLORS.white);
27+
g.setColor(COLORS.bg);
2828
g.fillRect(x+2,y+5,x+s-6,y+18);
2929

3030
g.setColor(levelColor(l));
@@ -35,7 +35,7 @@
3535
g.fillRect(x+s-3,y+8,x+s-2,y+16); // tip of the battery
3636
g.fillRect(x+4,y+15,xl,y+16); // charging bar
3737

38-
g.setColor(COLORS.black);
38+
g.setColor(COLORS.fg);
3939
g.setFontAlign(0,0);
4040
g.setFont('6x8');
4141
g.drawString(l, x + 14, y + 10);

0 commit comments

Comments
 (0)