Commit Graph

17 Commits (2bbef9f740b3f38385d02ad3459bf75b6dcbc5d4)

Author SHA1 Message Date
Rob Pilling 2bbef9f740 clkinfo: make `CLKINFO_FOCUS` a counter
This avoids issues when we have multiple clkinfos visible. The first clkinfo may want to focus itself, but a second clkinfo may then unfocus, deleting the first's effects (i.e. setting `CLKINFO_FOCUS`).

In detail:

`CLKINFO_FOCUS` will be set (to `true`) by the first handler (left hand clkinfo) and then unset (/ `delete`d) by the second handler (right hand clkinfo).

This is done in [the `touchHandler`](c2ea454a3b/apps/clock_info/lib.js (L313-L324)).

This commit makes `CLKINFO_FOCUS` a count.

- When we have a tap on a previous clkinfo (previous as in, earlier in the event handler list), it'll focus itself, `CLKINFO_FOCUS++`
- The later handler comes along, unfocuses itself, `CLKINFO_FOCUS--`
- `CLKINFO_FOCUS` is now `1`, so clkinfo is registered as being focussed still, meaning quicklaunch will work because of:

> c2ea454a3b/apps/quicklaunch/boot.js (L36-L36)

Fixes #3355
2024-04-18 18:12:58 +01:00
Rob Pilling f2c04fab5d clock_info: remove save() kill handler on remove of clkinfo 2024-03-20 22:26:02 +00:00
Rob Pilling 45a3f7e5d2 clock_info: save only on `kill` and `remove` 2024-03-20 08:07:21 +00:00
Rob Pilling 5be18f4261 clock_info: expose a save (settings) method 2024-03-16 08:47:32 +00:00
Rob Pilling 0943d20231 clock_info: remove redundant focus call 2024-03-12 07:39:00 +00:00
Rob Pilling 1d6457ed19 clock_info: set CLKINFO_FOCUS on start 2024-03-12 07:38:17 +00:00
Rob Pilling 736b9f0433 clock_info: permit focus/blur to cancel a redraw 2024-03-11 21:47:54 +00:00
Rob Pilling 33088c6257 clock_info: call focus() after redraw 2024-03-11 08:57:51 +00:00
Rob Pilling 2c92c94574 clock_info: s/unfocus/blur/ 2024-03-11 08:53:51 +00:00
Rob Pilling 8f86d9297b clock_info: add focus and unfocus to item 2024-03-11 08:53:42 +00:00
Rob Pilling 30d1bc7c4c clock_info: pass options through to show(), hide() & run() 2024-03-11 08:53:23 +00:00
Rob Pilling a667fc8061 clock_info: factor out focus/defocus 2024-03-11 08:40:00 +00:00
Rob Pilling 8a2a5851be clock_info: display clkinfo load error 2023-07-27 18:12:05 +01:00
Gordon Williams a59957be1e When >1 clockinfo, swiping one back tries to ensure they don't display the same thing 2023-06-30 13:30:23 +01:00
Gordon Williams b5167d7068 +0.04: On 2v18+ firmware, we can now stop swipe events from being handled by other apps
+      eg. when a clockinfo is selected, swipes won't affect swipe-down widgets
+0.05: Reported image for battery is now transparent (2v18+)
Fix https://github.com/espruino/BangleApps/issues/2749
2023-05-15 09:49:17 +01:00
Gordon Williams cde3818815 clockinfo 0.03: Reported image for battery now reflects charge level 2023-05-11 12:38:27 +01:00
Gordon Williams de40f314c7 Moved clock_info to a module 2023-01-27 13:33:46 +00:00