widlockunlock: disable tap-to-lock if back button is present

pull/3233/head
Rob Pilling 2024-03-03 22:40:31 +00:00
parent 04057c4018
commit fa11b76da2
3 changed files with 4 additions and 1 deletions

View File

@ -1,2 +1,3 @@
0.01: First commit 0.01: First commit
0.02: Add tap-to-lock functionality 0.02: Add tap-to-lock functionality
0.03: Disable tap-to-lock if back button is present

View File

@ -1,7 +1,7 @@
{ {
"id": "widlockunlock", "id": "widlockunlock",
"name": "Lock/Unlock Widget", "name": "Lock/Unlock Widget",
"version": "0.02", "version": "0.03",
"description": "On devices with always-on display (Bangle.js 2) this displays lock icon whenever the display is locked, or an unlock icon otherwise. Tap to lock the lcd", "description": "On devices with always-on display (Bangle.js 2) this displays lock icon whenever the display is locked, or an unlock icon otherwise. Tap to lock the lcd",
"icon": "widget.png", "icon": "widget.png",
"type": "widget", "type": "widget",

View File

@ -1,6 +1,8 @@
Bangle.on("lock", () => Bangle.drawWidgets()); Bangle.on("lock", () => Bangle.drawWidgets());
Bangle.on('touch', (_btn, xy) => { Bangle.on('touch', (_btn, xy) => {
if (WIDGETS["back"]) return;
const oversize = 5; const oversize = 5;
const w = WIDGETS.lockunlock; const w = WIDGETS.lockunlock;