diff --git a/apps/clock_info/ChangeLog b/apps/clock_info/ChangeLog index a4c25f995..15f6a660d 100644 --- a/apps/clock_info/ChangeLog +++ b/apps/clock_info/ChangeLog @@ -8,3 +8,4 @@ 0.07: Developer tweak: clkinfo load errors are emitted 0.08: Pass options to show(), hide() and run(), and add focus() and blur() item methods 0.09: Save clkinfo settings on kill and remove +0.10: Fix focus bug when changing focus between two clock infos diff --git a/apps/clock_info/lib.js b/apps/clock_info/lib.js index 7b4e49b5c..628f032ad 100644 --- a/apps/clock_info/lib.js +++ b/apps/clock_info/lib.js @@ -289,7 +289,7 @@ exports.addInteractive = function(menu, options) { Bangle.on("swipe",swipeHandler); const blur = () => { options.focus=false; - delete Bangle.CLKINFO_FOCUS; + Bangle.CLKINFO_FOCUS--; const itm = menu[options.menuA].items[options.menuB]; let redraw = true; if (itm.blur && itm.blur(options) === false) @@ -298,7 +298,7 @@ exports.addInteractive = function(menu, options) { }; const focus = () => { let redraw = true; - Bangle.CLKINFO_FOCUS=true; + Bangle.CLKINFO_FOCUS = (Bangle.CLKINFO_FOCUS || 0) + 1; if (!options.focus) { options.focus=true; const itm = menu[options.menuA].items[options.menuB]; @@ -341,7 +341,7 @@ exports.addInteractive = function(menu, options) { Bangle.removeListener("swipe",swipeHandler); if (touchHandler) Bangle.removeListener("touch",touchHandler); if (lockHandler) Bangle.removeListener("lock", lockHandler); - delete Bangle.CLKINFO_FOCUS; + Bangle.CLKINFO_FOCUS--; menuHideItem(menu[options.menuA].items[options.menuB]); exports.loadCount--; delete exports.clockInfos[options.index]; diff --git a/apps/clock_info/metadata.json b/apps/clock_info/metadata.json index d2a5540e1..7d6c042f9 100644 --- a/apps/clock_info/metadata.json +++ b/apps/clock_info/metadata.json @@ -1,7 +1,7 @@ { "id": "clock_info", "name": "Clock Info Module", "shortName": "Clock Info", - "version":"0.09", + "version":"0.10", "description": "A library used by clocks to provide extra information on the clock face (Altitude, BPM, etc)", "icon": "app.png", "type": "module", diff --git a/typescript/types/clock_info.d.ts b/typescript/types/clock_info.d.ts index 7f48cbf0a..9afaa6b79 100644 --- a/typescript/types/clock_info.d.ts +++ b/typescript/types/clock_info.d.ts @@ -61,5 +61,5 @@ declare module ClockInfo { } interface BangleExt { - CLKINFO_FOCUS?: true; + CLKINFO_FOCUS?: number; }