Skip to content

Commit

Permalink
Bangle.js: .setUI now only clears back widget if it hasn't been hidde…
Browse files Browse the repository at this point in the history
…n by widget_utils
  • Loading branch information
gfwilliams committed Nov 7, 2024
1 parent dd66304 commit 7386f49
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
Fix for regression after #2547 fix (left hand operand of maths with a valueOf method)
X.on now allocates a new array for each new handler added, stops new handlers being called for the event that's currently being handled (#2559)
RegExp: add optimisation for RegExp that is simply checking if a string ends with something
Bangle.js: .setUI now only clears back widget if it hasn't been hidden by widget_utils

2v24 : Bangle.js2: Add 'Bangle.touchRd()', 'Bangle.touchWr()'
Bangle.js2: After Bangle.showTestScreen, put Bangle.js into a hard off state (not soft off)
Expand Down
4 changes: 3 additions & 1 deletion libs/js/banglejs/Bangle_setUI_F18.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,11 @@
area:"tl", width:24,
draw:e=>g.reset().setColor("#f00").drawImage(atob("GBiBAAAYAAH/gAf/4A//8B//+D///D///H/P/n+H/n8P/n4f/vwAP/wAP34f/n8P/n+H/n/P/j///D///B//+A//8Af/4AH/gAAYAA=="),e.x,e.y),
remove:(noclear)=>{
var w = WIDGETS.back;
if (w.area!="tl") noclear=true; // area="" is set by widget_utils.hide, so avoid drawing
if (btnWatch) clearWatch(btnWatch);
Bangle.removeListener("touch", touchHandler);
if (!noclear) g.reset().clearRect({x:WIDGETS.back.x, y:WIDGETS.back.y, w:24,h:24});
if (!noclear) g.reset().clearRect({x:w.x, y:w.y, w:24,h:24});
delete WIDGETS.back;
if (!noclear) Bangle.drawWidgets();
}
Expand Down
Binary file modified libs/js/banglejs/Bangle_setUI_F18.min.js
Binary file not shown.
4 changes: 3 additions & 1 deletion libs/js/banglejs/Bangle_setUI_Q3.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,11 @@
area:"tl", width:24,
draw:e=>g.reset().setColor("#f00").drawImage(atob("GBiBAAAYAAH/gAf/4A//8B//+D///D///H/P/n+H/n8P/n4f/vwAP/wAP34f/n8P/n+H/n/P/j///D///B//+A//8Af/4AH/gAAYAA=="),e.x,e.y),
remove:(noclear)=>{
var w = WIDGETS.back;
if (w.area!="tl") noclear=true; // area="" is set by widget_utils.hide, so avoid drawing
if (btnWatch) clearWatch(btnWatch);
Bangle.removeListener("touch", touchHandler);
if (!noclear) g.reset().clearRect({x:WIDGETS.back.x, y:WIDGETS.back.y, w:24,h:24});
if (!noclear) g.reset().clearRect({x:w.x, y:w.y, w:24,h:24});
delete WIDGETS.back;
if (!noclear) Bangle.drawWidgets();
}
Expand Down
Binary file modified libs/js/banglejs/Bangle_setUI_Q3.min.js
Binary file not shown.

0 comments on commit 7386f49

Please sign in to comment.