forked from FOSS/BangleApps
allow a forced draw on settime
parent
ac05df0964
commit
c459820105
|
@ -67,10 +67,10 @@ class TimeCalClock{
|
|||
/*
|
||||
* Run forest run
|
||||
**/
|
||||
draw(){
|
||||
draw(force){
|
||||
this.drawTime();
|
||||
|
||||
if (this.TZOffset===undefined || this.TZOffset!==d.getTimezoneOffset())
|
||||
if (force || this.TZOffset===undefined || this.TZOffset!==d.getTimezoneOffset())
|
||||
this.drawDateAndCal();
|
||||
}
|
||||
|
||||
|
@ -83,8 +83,6 @@ class TimeCalClock{
|
|||
d=this.date ? this.date : new Date();
|
||||
const Y=Bangle.appRect.y+this.DATE_FONT_SIZE()+10;
|
||||
|
||||
d=d?d :new Date();
|
||||
|
||||
g.setFontAlign(0, -1).setFont("Vector", this.TIME_FONT_SIZE()).setColor(g.theme.fg)
|
||||
.clearRect(Bangle.appRect.x, Y, Bangle.appRect.x2, Y+this.TIME_FONT_SIZE()-7)
|
||||
.drawString(("0" + require("locale").time(d, 1)).slice(-5), this.centerX, Y, true);
|
||||
|
@ -265,3 +263,10 @@ class TimeCalClock{
|
|||
}
|
||||
|
||||
timeCalClock = new TimeCalClock(); timeCalClock.draw();
|
||||
|
||||
//hook on settime to redraw immediatly
|
||||
var _setTime = setTime;
|
||||
var setTime = function(t) {
|
||||
_setTime(t);
|
||||
timeCalClock.draw(true);
|
||||
};
|
Loading…
Reference in New Issue