diff --git a/apps/wid_edit/ChangeLog b/apps/wid_edit/ChangeLog index d8e165029..279fa2438 100644 --- a/apps/wid_edit/ChangeLog +++ b/apps/wid_edit/ChangeLog @@ -2,3 +2,4 @@ 0.02: Wrap loadWidgets instead of replacing to keep original functionality intact Change back entry to menu option Allow changing widgets into all areas, including bottom widget bar +0.03: Fix editing widgets whose draw method takes the widget diff --git a/apps/wid_edit/metadata.json b/apps/wid_edit/metadata.json index d963a53d0..e80e45d45 100644 --- a/apps/wid_edit/metadata.json +++ b/apps/wid_edit/metadata.json @@ -1,6 +1,6 @@ { "id": "wid_edit", - "version": "0.02", + "version": "0.03", "name": "Widget Editor", "icon": "icon.png", "description": "Customize widget locations", diff --git a/apps/wid_edit/settings.js b/apps/wid_edit/settings.js index 1d34ae0ca..be09923f2 100644 --- a/apps/wid_edit/settings.js +++ b/apps/wid_edit/settings.js @@ -67,7 +67,7 @@ function highlight() { if (WIDGET.width > 0) { // draw widget, then draw a highlighted border on top - WIDGET.draw(); + WIDGET.draw(WIDGET); g.setColor(g.theme.fgH) .drawRect(WIDGET.x, WIDGET.y, WIDGET.x+WIDGET.width-1, WIDGET.y+23); } else { diff --git a/apps/widalarmeta/ChangeLog b/apps/widalarmeta/ChangeLog index f412fc45f..e014721f6 100644 --- a/apps/widalarmeta/ChangeLog +++ b/apps/widalarmeta/ChangeLog @@ -10,3 +10,4 @@ Redraw only every hour when no alarm in next 24h 0.07: Fix when no alarms are present 0.08: Selectable font. Allow to disable hour padding. +0.09: Match draw() API e.g. to allow wid_edit to alter this widget diff --git a/apps/widalarmeta/metadata.json b/apps/widalarmeta/metadata.json index 5bb7f7795..66882c16f 100644 --- a/apps/widalarmeta/metadata.json +++ b/apps/widalarmeta/metadata.json @@ -2,7 +2,7 @@ "id": "widalarmeta", "name": "Alarm & Timer ETA", "shortName": "Alarm ETA", - "version": "0.08", + "version": "0.09", "description": "A widget that displays the time to the next Alarm or Timer in hours and minutes, maximum 24h (configurable).", "icon": "widget.png", "type": "widget", diff --git a/apps/widalarmeta/widget.js b/apps/widalarmeta/widget.js index 77b7ebb88..d24b185d9 100644 --- a/apps/widalarmeta/widget.js +++ b/apps/widalarmeta/widget.js @@ -25,7 +25,7 @@ } } // getNextAlarm - function draw(fromInterval) { + function draw(_w, fromInterval) { if (this.nextAlarm === undefined) { let alarm = getNextAlarm(); if (alarm === undefined) { @@ -101,8 +101,9 @@ clearTimeout(this.timeoutId); } this.timeoutId = setTimeout(()=>{ - WIDGETS["widalarmeta"].timeoutId = undefined; - WIDGETS["widalarmeta"].draw(true); + var w = WIDGETS["widalarmeta"]; + w.timeoutId = undefined; + w.draw(w, true); }, timeout); } /* draw */ diff --git a/apps/widbatpc/ChangeLog b/apps/widbatpc/ChangeLog index 3592656a9..e9326fd2c 100644 --- a/apps/widbatpc/ChangeLog +++ b/apps/widbatpc/ChangeLog @@ -16,3 +16,4 @@ 0.17: Add option 'Remove Jitter'='Drop only' to prevent percentage from getting up again when not charging Add option to disable vibration when charger connects 0.18: Only redraw when values change +0.19: Match draw() API e.g. to allow wid_edit to alter this widget diff --git a/apps/widbatpc/metadata.json b/apps/widbatpc/metadata.json index d361da442..4c364a864 100644 --- a/apps/widbatpc/metadata.json +++ b/apps/widbatpc/metadata.json @@ -2,7 +2,7 @@ "id": "widbatpc", "name": "Battery Level Widget (with percentage)", "shortName": "Battery Widget", - "version": "0.18", + "version": "0.19", "description": "Show the current battery level and charging status in the top right of the clock, with charge percentage", "icon": "widget.png", "type": "widget", diff --git a/apps/widbatpc/widget.js b/apps/widbatpc/widget.js index b508cce8b..7ba060d6d 100644 --- a/apps/widbatpc/widget.js +++ b/apps/widbatpc/widget.js @@ -181,7 +181,7 @@ if (on) update(); }); - var id = setInterval(()=>WIDGETS["batpc"].draw(true), intervalLow); + var id = setInterval(()=>WIDGETS["batpc"].draw(WIDGETS["batpc"], true), intervalLow); WIDGETS["batpc"]={area:"tr",width:40,draw:draw,reload:reload}; setWidth(); diff --git a/apps/widmessages/ChangeLog b/apps/widmessages/ChangeLog index 348d49528..507d9c13b 100644 --- a/apps/widmessages/ChangeLog +++ b/apps/widmessages/ChangeLog @@ -3,3 +3,4 @@ Remove library stub 0.03: Fix messages not showing if UI auto-open is disabled 0.04: Now shows message icons again (#2416) +0.05: Match draw() API e.g. to allow wid_edit to alter this widget diff --git a/apps/widmessages/metadata.json b/apps/widmessages/metadata.json index 0e399f71f..f058beacc 100644 --- a/apps/widmessages/metadata.json +++ b/apps/widmessages/metadata.json @@ -1,7 +1,7 @@ { "id": "widmessages", "name": "Message Widget", - "version": "0.04", + "version": "0.05", "description": "Widget showing new messages", "icon": "app.png", "type": "widget", diff --git a/apps/widmessages/widget.js b/apps/widmessages/widget.js index 44f525ec8..357ca06e3 100644 --- a/apps/widmessages/widget.js +++ b/apps/widmessages/widget.js @@ -11,7 +11,7 @@ // the name still needs to be "messages": the library calls WIDGETS["messages'].hide()/show() // see e.g. widmsggrid WIDGETS["messages"] = { - area: "tl", width: 0, srcs: [], draw: function(recall) { + area: "tl", width: 0, srcs: [], draw: function(_w, recall) { // If we had a setTimeout queued from the last time we were called, remove it if (WIDGETS["messages"].i) { clearTimeout(WIDGETS["messages"].i); @@ -42,7 +42,7 @@ this.x+12+i*24, this.y+12, {rotate: 0/*force centering*/}); } } - WIDGETS["messages"].i = setTimeout(() => WIDGETS["messages"].draw(true), 1000); + WIDGETS["messages"].i = setTimeout(() => WIDGETS["messages"].draw(WIDGETS["messages"], true), 1000); if (process.env.HWVERSION>1) Bangle.on("touch", this.touch); }, onMsg: function(type, msg) { if (this.hidden) return;