Tweaks for issues redrawing after variable size widget addition (partial #121)

pull/129/head
Gordon Williams 2020-03-09 14:30:56 +00:00
parent 0ebc1c3a50
commit 0da0acefd2
11 changed files with 17 additions and 12 deletions

View File

@ -286,7 +286,7 @@
{ "id": "widbat", { "id": "widbat",
"name": "Battery Level Widget", "name": "Battery Level Widget",
"icon": "widget.png", "icon": "widget.png",
"version":"0.03", "version":"0.04",
"description": "Show the current battery level and charging status in the top right of the clock", "description": "Show the current battery level and charging status in the top right of the clock",
"tags": "widget,battery", "tags": "widget,battery",
"type":"widget", "type":"widget",
@ -297,7 +297,7 @@
{ "id": "widbt", { "id": "widbt",
"name": "Bluetooth Widget", "name": "Bluetooth Widget",
"icon": "widget.png", "icon": "widget.png",
"version":"0.02", "version":"0.03",
"description": "Show the current Bluetooth connection status in the top right of the clock", "description": "Show the current Bluetooth connection status in the top right of the clock",
"tags": "widget,bluetooth", "tags": "widget,bluetooth",
"type":"widget", "type":"widget",
@ -319,7 +319,7 @@
{ "id": "widhrm", { "id": "widhrm",
"name": "Simple Heart Rate widget", "name": "Simple Heart Rate widget",
"icon": "widget.png", "icon": "widget.png",
"version":"0.02", "version":"0.03",
"description": "When the screen is on, the widget turns on the heart rate monitor and displays the current heart rate (or last known in grey). For this to work well you'll need at least a 15 second LCD Timeout.", "description": "When the screen is on, the widget turns on the heart rate monitor and displays the current heart rate (or last known in grey). For this to work well you'll need at least a 15 second LCD Timeout.",
"tags": "health,widget", "tags": "health,widget",
"type": "widget", "type": "widget",
@ -702,7 +702,7 @@
{ "id": "widclk", { "id": "widclk",
"name": "Digital clock widget", "name": "Digital clock widget",
"icon": "widget.png", "icon": "widget.png",
"version":"0.02", "version":"0.03",
"description": "A simple digital clock widget", "description": "A simple digital clock widget",
"tags": "widget,clock", "tags": "widget,clock",
"type":"widget", "type":"widget",
@ -713,7 +713,7 @@
{ "id": "widpedom", { "id": "widpedom",
"name": "Pedometer widget", "name": "Pedometer widget",
"icon": "widget.png", "icon": "widget.png",
"version":"0.07", "version":"0.08",
"description": "Daily pedometer widget", "description": "Daily pedometer widget",
"tags": "widget", "tags": "widget",
"type":"widget", "type":"widget",

View File

@ -1,2 +1,3 @@
0.02: Now refresh battery monitor every minute if LCD on 0.02: Now refresh battery monitor every minute if LCD on
0.03: Tweaks for variable size widget system 0.03: Tweaks for variable size widget system
0.04: Ensure redrawing works with variable size widget system

View File

@ -27,7 +27,7 @@ Bangle.on('charging',function(charging) {
var batteryInterval; var batteryInterval;
Bangle.on('lcdPower', function(on) { Bangle.on('lcdPower', function(on) {
if (on) { if (on) {
draw(); WIDGETS["bat"].draw();
// refresh once a minute if LCD on // refresh once a minute if LCD on
if (!batteryInterval) if (!batteryInterval)
batteryInterval = setInterval(draw, 60000); batteryInterval = setInterval(draw, 60000);

View File

@ -1 +1,2 @@
0.02: Tweaks for variable size widget system 0.02: Tweaks for variable size widget system
0.03: Ensure redrawing works with variable size widget system

View File

@ -10,7 +10,7 @@ function draw() {
g.drawImage(img_bt,10+this.x,2+this.y); g.drawImage(img_bt,10+this.x,2+this.y);
} }
function changed() { function changed() {
draw(); WIDGETS["bluetooth"].draw();
g.flip();// turns screen on g.flip();// turns screen on
} }
NRF.on('connected',changed); NRF.on('connected',changed);

View File

@ -1 +1,2 @@
0.02: Now refresh battery monitor every minute if LCD on 0.02: Now refresh battery monitor every minute if LCD on
0.03: Ensure redrawing works with variable size widget system

View File

@ -15,7 +15,7 @@
} }
function startTimers(){ function startTimers(){
intervalRef = setInterval(draw, 60*1000); intervalRef = setInterval(draw, 60*1000);
draw(); WIDGETS["wdclk"].draw();
} }
Bangle.on('lcdPower', (on) => { Bangle.on('lcdPower', (on) => {
clearTimers(); clearTimers();

View File

@ -1,2 +1,3 @@
0.01: New Widget! 0.01: New Widget!
0.02: Tweaks for variable size widget system 0.02: Tweaks for variable size widget system
0.03: Ensure redrawing works with variable size widget system

View File

@ -29,7 +29,7 @@
Bangle.setHRMPower(1); Bangle.setHRMPower(1);
firstBPM = true; firstBPM = true;
currentBPM = undefined; currentBPM = undefined;
draw(); WIDGETS["hrm"].draw();
} else { } else {
Bangle.setHRMPower(0); Bangle.setHRMPower(0);
} }
@ -42,7 +42,7 @@
currentBPM = d.bpm; currentBPM = d.bpm;
lastBPM = currentBPM; lastBPM = currentBPM;
} }
draw(); WIDGETS["hrm"].draw();
}); });
Bangle.setHRMPower(Bangle.isLCDOn()); Bangle.setHRMPower(Bangle.isLCDOn());

View File

@ -4,3 +4,4 @@
0.05: Add foot icon, use tidier font, and move to the left of the screen 0.05: Add foot icon, use tidier font, and move to the left of the screen
0.06: Fix widget position increment 0.06: Fix widget position increment
0.07: Tweaks for variable size widget system 0.07: Tweaks for variable size widget system
0.08: Ensure redrawing works with variable size widget system

View File

@ -33,11 +33,11 @@
} }
lastUpdate = date; lastUpdate = date;
//console.log("up: " + up + " stp: " + stp_today + " " + date.toString()); //console.log("up: " + up + " stp: " + stp_today + " " + date.toString());
if (Bangle.isLCDOn()) draw(); if (Bangle.isLCDOn()) WIDGETS["wpedom"].draw();
}); });
// redraw when the LCD turns on // redraw when the LCD turns on
Bangle.on('lcdPower', function(on) { Bangle.on('lcdPower', function(on) {
if (on) draw(); if (on) WIDGETS["wpedom"].draw();
}); });
// When unloading, save state // When unloading, save state
E.on('kill', () => { E.on('kill', () => {