smpltmr: reset clkinfo to "main" timer on blur

pull/3234/head
Rob Pilling 2024-03-03 23:04:36 +00:00
parent 33088c6257
commit 54907714a2
3 changed files with 10 additions and 3 deletions

View File

@ -5,4 +5,5 @@
0.05: Updated clkinfo icon.
0.06: Ensure Timer supplies an image for clkinfo items
0.07: Update clock_info to avoid a redraw
0.08: Timer ClockInfo now updates once a minute
0.08: Timer ClockInfo now updates once a minute
0.09: Timer ClockInfo resets to timer menu when blurred

View File

@ -71,13 +71,19 @@
]
};
const restoreMainItem = function(clkinfo) {
clkinfo.menuB = 0;
// clock info redraws after this
};
var offsets = [+5,-5];
offsets.forEach((o, i) => {
smpltmrItems.items = smpltmrItems.items.concat({
name: null,
get: () => ({ text: (o > 0 ? "+" : "") + o + " min.", img: smpltmrItems.img }),
show: function() { },
hide: function () { },
hide: function() { },
blur: restoreMainItem,
run: function() {
if(o > 0) increaseAlarm(o);
else decreaseAlarm(Math.abs(o));

View File

@ -2,7 +2,7 @@
"id": "smpltmr",
"name": "Simple Timer",
"shortName": "Simple Timer",
"version": "0.08",
"version": "0.09",
"description": "A very simple app to start a timer.",
"icon": "app.png",
"tags": "tool,alarm,timer,clkinfo",