Widbatpc: - revert hide change

master
hughbarney 2021-10-21 20:22:46 +01:00
parent 9f6602c596
commit 5f91cf37cd
3 changed files with 3 additions and 12 deletions

View File

@ -10,4 +10,3 @@
0.11: Don't overwrite existing settings on app update
0.12: Fixed for Bangle 2
0.13: Fillbar setting added, see README
0.14: Added setting to completely hide the widget

View File

@ -12,8 +12,7 @@
'percentage': true,
'fillbar': false,
'charger': true,
'hideifmorethan': 100,
'hidewidget': false,
'hideifmorethan': 100
}
// ...and overwrite them with any saved values
// This way saved values are preserved if a new version adds more settings
@ -33,7 +32,6 @@
}
const onOffFormat = b => (b ? 'On' : 'Off')
const yesNoFormat = b => (b ? 'Yes' : 'No')
const menu = {
'': { 'title': 'Battery Widget' },
'< Back': back,
@ -69,12 +67,7 @@
step: 10,
format: x => x+"%",
onchange: save('hideifmorethan'),
},
'Hide Widget': {
value: s.hidewidget,
format: yesNoFormat,
onchange: save('hidewidget'),
},
}
}
E.showMenu(menu)
})

View File

@ -28,7 +28,7 @@
'color': 'By Level',
'percentage': true,
'charger': true,
'hideifmorethan': 100,
'hideifmorethan': 100
};
Object.keys(DEFAULTS).forEach(k=>{
if (settings[k]===undefined) settings[k]=DEFAULTS[k]
@ -76,7 +76,6 @@
function draw() {
// if hidden, don't draw
if (!WIDGETS["batpc"].width) return;
if (setting('hidewidget')) return;
// else...
var s = 39;
var x = this.x, y = this.y;