mirror of https://github.com/espruino/BangleApps
widclk 0.08: Ensure we clear the whole rect so we don't end up leaving old text when time changes (fix #3073)
parent
b6e601b9a4
commit
319d22fab6
|
@ -4,3 +4,4 @@
|
|||
0.05: Don't show clock widget if already showing clock app
|
||||
0.06: Use 7 segment font, update *on* the minute, use less memory
|
||||
0.07: allow turning on/off when quick-switching apps
|
||||
0.08: Ensure we clear the whole rect so we don't end up leaving old text when time changes (fix #3073)
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"id": "widclk",
|
||||
"name": "Digital clock widget",
|
||||
"version": "0.07",
|
||||
"version": "0.08",
|
||||
"description": "A simple digital clock widget that appears when not showing a fullscreen clock",
|
||||
"icon": "widget.png",
|
||||
"type": "widget",
|
||||
|
|
|
@ -7,9 +7,9 @@ WIDGETS["wdclk"]={area:"tl",width:Bangle.CLOCK?0:52/* g.stringWidth("00:00") */,
|
|||
return setTimeout(Bangle.drawWidgets,1); // widget changed size - redraw
|
||||
}
|
||||
if (!this.width) return; // if not visible, return
|
||||
g.reset().setFontCustom(atob("AAAAAAAAAAIAAAQCAQAAAd0BgMBdwAAAAAAAdwAB0RiMRcAAAERiMRdwAcAQCAQdwAcERiMRBwAd0RiMRBwAAEAgEAdwAd0RiMRdwAcERiMRdwAFAAd0QiEQdwAdwRCIRBwAd0BgMBAAABwRCIRdwAd0RiMRAAAd0QiEQAAAAAAAAAA="), 32, atob("BgAAAAAAAAAAAAAAAAYCAAYGBgYGBgYGBgYCAAAAAAAABgYGBgYG"), 512+9);
|
||||
g.reset().setFontCustom(atob("AAAAAAAAAAIAAAQCAQAAAd0BgMBdwAAAAAAAdwAB0RiMRcAAAERiMRdwAcAQCAQdwAcERiMRBwAd0RiMRBwAAEAgEAdwAd0RiMRdwAcERiMRdwAFAAd0QiEQdwAdwRCIRBwAd0BgMBAAABwRCIRdwAd0RiMRAAAd0QiEQAAAAAAAAAA="), 32, atob("BgAAAAAAAAAAAAAAAAYCAAYGBgYGBgYGBgYCAAAAAAAABgYGBgYG"), 512+9).setFontAlign(0,0);
|
||||
var time = require("locale").time(new Date(),1);
|
||||
g.drawString(time, this.x, this.y+3, true); // 5 * 6*2 = 60
|
||||
g.clearRect(this.x, this.y, this.x+this.width-1, this.y+23).drawString(time, this.x+this.width/2, this.y+12); // 5 * 6*2 = 60
|
||||
// queue draw in one minute
|
||||
if (this.drawTimeout) clearTimeout(this.drawTimeout);
|
||||
this.drawTimeout = setTimeout(()=>{
|
||||
|
|
|
@ -3,4 +3,4 @@
|
|||
0.03: based in widclk v0.05 compatible at same time, bottom area and color
|
||||
0.04: refactored to use less memory, and allow turning on/off when quick-switching apps
|
||||
0.05: Remove cyan color, use theme foreground instead
|
||||
|
||||
0.06: Ensure we clear the whole rect so we don't end up leaving old text when time changes
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
"id": "widclkbttm",
|
||||
"name": "Digital clock (Bottom) widget",
|
||||
"shortName": "Digital clock Bottom Widget",
|
||||
"version": "0.05",
|
||||
"version": "0.06",
|
||||
"description": "Displays time HH:mm in the bottom of the screen (may not be compatible with some apps)",
|
||||
"icon": "widclkbttm.png",
|
||||
"type": "widget",
|
||||
|
|
|
@ -4,7 +4,7 @@ WIDGETS["wdclkbttm"]={area:"br",width:Bangle.CLOCK?0:60,draw:function() {
|
|||
return setTimeout(Bangle.drawWidgets,1); // widget changed size - redraw
|
||||
}
|
||||
if (!this.width) return; // if not visible, return
|
||||
g.reset().setFont("6x8", 2).setFontAlign(-1, 0);
|
||||
g.reset().setFont("6x8", 2).setFontAlign(-1, 0).clearRect(this.x, this.y, this.x+this.width-1, this.y+23);
|
||||
var time = require("locale").time(new Date(),1);
|
||||
g.drawString(time, this.x, this.y+11, true); // 5 * 6*2 = 60
|
||||
// queue draw in one minute
|
||||
|
|
Loading…
Reference in New Issue