widpedom 0.22: Fix 'stps' regression for 0.21 (fix #1233)

pull/1242/head
Gordon Williams 2022-01-07 08:53:32 +00:00
parent 3146b354be
commit 341080e09b
3 changed files with 3 additions and 2 deletions

View File

@ -1590,7 +1590,7 @@
{ {
"id": "widpedom", "id": "widpedom",
"name": "Pedometer widget", "name": "Pedometer widget",
"version": "0.21", "version": "0.22",
"description": "Daily pedometer widget", "description": "Daily pedometer widget",
"icon": "widget.png", "icon": "widget.png",
"type": "widget", "type": "widget",

View File

@ -21,3 +21,4 @@
Memory usage enhancements Memory usage enhancements
0.20: Fix issue where step count would randomly reset 0.20: Fix issue where step count would randomly reset
0.21: Memory usage improvements, fix widget initial width (fix #1170) 0.21: Memory usage improvements, fix widget initial width (fix #1170)
0.22: Fix 'stps' regression for 0.21 (fix #1233)

View File

@ -55,6 +55,7 @@
// add your widget // add your widget
WIDGETS["wpedom"]={area:"tl",width:0, WIDGETS["wpedom"]={area:"tl",width:0,
getWidth:function() { getWidth:function() {
let stps = stp_today.toString();
let newWidth = 24; let newWidth = 24;
if (settings.hide) if (settings.hide)
newWidth = 0; newWidth = 0;
@ -68,7 +69,6 @@
return newWidth; return newWidth;
}, },
redraw:function() { // work out the width, and queue a full redraw if needed redraw:function() { // work out the width, and queue a full redraw if needed
let stps = stp_today.toString();
let newWidth = this.getWidth(); let newWidth = this.getWidth();
if (newWidth!=this.width) { if (newWidth!=this.width) {
// width has changed, re-layout all widgets // width has changed, re-layout all widgets