From 7386f49f1cd345338de6827b437ecb8312f63931 Mon Sep 17 00:00:00 2001 From: Gordon Williams Date: Thu, 7 Nov 2024 10:11:00 +0000 Subject: [PATCH] Bangle.js: .setUI now only clears back widget if it hasn't been hidden by widget_utils --- ChangeLog | 1 + libs/js/banglejs/Bangle_setUI_F18.js | 4 +++- libs/js/banglejs/Bangle_setUI_F18.min.js | Bin 2722 -> 2735 bytes libs/js/banglejs/Bangle_setUI_Q3.js | 4 +++- libs/js/banglejs/Bangle_setUI_Q3.min.js | Bin 3037 -> 3050 bytes 5 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0d5d7c9d9..0e13548a6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -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) diff --git a/libs/js/banglejs/Bangle_setUI_F18.js b/libs/js/banglejs/Bangle_setUI_F18.js index 4a5894425..6678a39dc 100644 --- a/libs/js/banglejs/Bangle_setUI_F18.js +++ b/libs/js/banglejs/Bangle_setUI_F18.js @@ -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(); } diff --git a/libs/js/banglejs/Bangle_setUI_F18.min.js b/libs/js/banglejs/Bangle_setUI_F18.min.js index 4ed75b868a45e71ba40261bcb77e6da24853dfab..2396162d81f6d16c487bac4e85302234d441a829 100644 GIT binary patch delta 316 zcmZ1^x?WUAW0gj-PKsvrnnc^`TIvy7ni}(@3;U)=9Qa)XU9JN!3wI zo~Wb6m@zS2Q7Xe$(NHJc)5YC2Bv>ygF*#eWC^a{~EL9_U<0Lmm#-zzN8I=^0G&F0| zffB{3B^sJQlan>8LB^LBq~w?9btP*~PGpstY|b>73C`@DT+b}Zmb9okMI&kQEM_~9 zLCltn$&*`IbSB%gxPn<1fn+#qEo1WLtE?B9II?Yl>J7V+Ca>d=Wz3#@hNBgzD~Pky zEJ?3ICrPhTQwQQSE1mspgVI8P(VR?$Gydh#t!J(g@u>!is% gToUYQKr(k44{$pTG{=h9@#m^V3rOPo;?0B-7Nm;e9( delta 303 zcmZ24x=2(vy7ni{(@3;U(n+#S)XU9JN!3wI zny912m^Lw7Q7X+=(NHJc)5YC2Bv>ygF*#eWC^a{~EL9_E<0Lmm#^lL28I=^0H8g9} zffB{3B^sJQlan;7LB^LBq~w?9btP#|PGpstY|b>73C`@DT+b}Zmb|DsMI(9gEM_~9 zLCltnNt0VybSB%gxPn<1fn+#qEo0K=tE?B9I5KR3>J7V+C$Hm>Wz3j-hNBgzD~PjH zI9abkCt0sjQwQQSE1wG7GBmA|C+l-b$fCHvLZ{LSSzxjsmn_hr94<|!w0Vg.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(); } diff --git a/libs/js/banglejs/Bangle_setUI_Q3.min.js b/libs/js/banglejs/Bangle_setUI_Q3.min.js index b02ee2e5840cbf2f20f3b918d2208ed2fd720d6d..522ea8fa5c6bb42cc23f8acaeafeba1ac8921d0c 100644 GIT binary patch delta 297 zcmcaB{z{xpW0gjVPU=K9Goh4u8i}?kIw`h^db#;2sXB@&6a7*dQ#Nk7%*dajS-n`} zB3o%eN`84>SIXpRO#Qs68ityhRvKy3jE!_sC%3VLGp0_y$D+ZKs-amsS&>a)@-=1w z#+1p=nJ2-NX5dt+#mWOzYR*~+Bv-PkizjO?sx~w-uuImfSfG)up{bLqVPRpDJo!0m zI#7i_TP=Fh^Bp8i}^aI?1+)db#;2sXB_u6a7*dlQ(X;%*datS-n`} zB3o%eN`84>SMua(O#Qqm8ityhRvKy3jE!_sCbzMKGp0a)@-=1w z#^lM*nJ2-NX5dt+#mWOzYR*~+Bv-Pki>GQXsx~w-uuIjeSfG)up{bLiVPRpDI{7(k zI#7i_TP=FY>r0QiP=B4DMrYtDXNYY8w tthJtekXwE88BQL?$-lY0WWzmO++9P0^^y{kv-K);Dy@(OCi`&D0{{=uU0?tJ