From 9306de32eb1afb1f8c989d9615477529b9c422d1 Mon Sep 17 00:00:00 2001 From: michele Date: Fri, 1 Nov 2024 17:51:37 +0100 Subject: [PATCH] tinyhead: fix the touch handler --- apps/tinyheads/app.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/tinyheads/app.js b/apps/tinyheads/app.js index 492929f10..c38ac2421 100644 --- a/apps/tinyheads/app.js +++ b/apps/tinyheads/app.js @@ -22,7 +22,8 @@ let helpShown = false; let tapCount = 0; let centerX, centerY, minuteHandLength, hourHandLength, handOutline; - + let originalTheme = Object.assign({}, g.theme); + // Open the eyes and schedule the next blink let blinkOpen = function blinkOpen() { if (blinkTimeout) clearTimeout(blinkTimeout); @@ -229,13 +230,14 @@ activeEyesNum = disconnectedEyes; } - Bangle.setUI("clock", { + Bangle.setUI({ mode:"custom", clock: true, touch: (button, xy) => { // Go direct to feature select in settings on long screen press if (xy.type == 2) { eval(require("Storage").read("tinyheads.settings.js"))(()=> { + g.setTheme(originalTheme); E.showMenu(); init(); }, true, helpShown); @@ -253,6 +255,7 @@ } }, remove: function() { + g.setTheme(originalTheme); // Clear timeouts and listeners for fast loading if (drawTimeout) clearTimeout(drawTimeout); if (blinkTimeout) clearTimeout(blinkTimeout);