Update widstep.wid.js
parent
e04f574f92
commit
702cd09f79
|
|
@ -1,9 +1,9 @@
|
||||||
let settings;
|
let wsSettings;
|
||||||
|
|
||||||
function loadSettings() {
|
function loadSettings() {
|
||||||
settings = require('Storage').readJSON("health.json", 1) || {};
|
wsSettings = require('Storage').readJSON("health.json", 1) || {};
|
||||||
if( settings.stepGoal === undefined ) {
|
if( wsSettings.stepGoal === undefined ) {
|
||||||
settings.stepGoal = 10000;
|
wsSettings.stepGoal = 10000;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -20,7 +20,7 @@ WIDGETS["widstep"]={area:"tl", sortorder:-1, width:28,
|
||||||
g.setColor(g.theme.bg);
|
g.setColor(g.theme.bg);
|
||||||
g.fillRect(this.x, this.y, this.x + this.width, this.y + 23);
|
g.fillRect(this.x, this.y, this.x + this.width, this.y + 23);
|
||||||
g.setColor(g.theme.dark ? '#00f' : '#0ff');
|
g.setColor(g.theme.dark ? '#00f' : '#0ff');
|
||||||
var progress = this.width * Math.min(steps/settings.stepGoal, 1);
|
var progress = this.width * Math.min(steps/wsSettings.stepGoal, 1);
|
||||||
g.fillRect(this.x+1, this.y+1, this.x + progress -1, this.y + 23);
|
g.fillRect(this.x+1, this.y+1, this.x + progress -1, this.y + 23);
|
||||||
g.setColor(g.theme.fg);
|
g.setColor(g.theme.fg);
|
||||||
g.setFontAlign(0, -1);
|
g.setFontAlign(0, -1);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue