hwid-batt: drop high mark altogether

pull/2811/head
Rob Pilling 2023-06-11 21:57:41 +01:00
parent ff9b3448f6
commit 786b8db814
3 changed files with 2 additions and 33 deletions

View File

@ -11,8 +11,6 @@
"tags": "widget,battery",
"provides_widgets" : ["battery"],
"storage": [
{"name":"hwid_a_battery_widget.wid.js","url":"widget.js"},
{"name":"hwid_battwid.setting.js","url":"settings.js"}
],
"data": [{"name":"hwid_battwid.settings.json"}]
{"name":"hwid_a_battery_widget.wid.js","url":"widget.js"}
]
}

View File

@ -1,22 +0,0 @@
(back => {
const S = require('Storage');
const SETTINGS_FILE = "hwid_battwid.settings.json";
const settings = S.readJSON(SETTINGS_FILE, 1) || {
showHighMark: true,
};
const save = () => S.write(SETTINGS_FILE, settings);
E.showMenu({
'': { 'title': 'Battery Widget (hank mod)' },
'< Back': back,
'Show high mark': {
value: settings.showHighMark,
onchange: v => {
settings.showHighMark = v;
save();
},
},
});
})

View File

@ -1,9 +1,4 @@
(function(){
const showHighMark = (
require("Storage").readJSON("hwid_battwid.settings.json",1) || {
showHighMark: true,
}).showHighMark;
const intervalLow = 60000; // update time when not charging
const intervalHigh = 2000; // update time when charging
var old_l;
@ -53,8 +48,6 @@
g.setColor(levelColor(l));
g.fillRect(x+4,y+14+3,xl,y+16+3); // charging bar
if (showHighMark)
g.fillRect((x+4+100*(s-12)/100)-1,y+14+3,x+4+100*(s-12)/100,y+16+3); // charging bar "full mark"
// Show percentage
g.setColor(COLORS.black);
g.setFontAlign(0,0);