1
0
Fork 0

[alarm] Fix redrawing entry inside edit submenu

- Fix redrawing selected Alarm/Timer entry inside edit submenu through opening the menu after a short timeout.
- Removing the obsolete check-mark images.
- Removing format on boolean values to use new check-marks
master
storm64 2022-04-28 02:11:08 +02:00
parent a9ac37fe17
commit 89b4a6b02c
3 changed files with 4 additions and 9 deletions

View File

@ -24,3 +24,4 @@
0.23: Fix regression with Days of Week (#1735) 0.23: Fix regression with Days of Week (#1735)
0.24: Automatically save the alarm/timer when the user returns to the main menu using the back arrow 0.24: Automatically save the alarm/timer when the user returns to the main menu using the back arrow
Add "Enable All", "Disable All" and "Remove All" actions Add "Enable All", "Disable All" and "Remove All" actions
0.25: Fix redrawing selected Alarm/Timer entry inside edit submenu

View File

@ -45,10 +45,9 @@ function showMainMenu() {
} else txt = type+txt; } else txt = type+txt;
// add to menu // add to menu
menu[txt] = { menu[txt] = {
value : "\0"+atob(alarm.on?"EhKBAH//v/////////////5//x//j//H+eP+Mf/A//h//z//////////3//g":"EhKBAH//v//8AA8AA8AA8AA8AA8AA8AA8AA8AA8AA8AA8AA8AA8AA///3//g"), value : alarm.on,
onchange : function() { onchange : function() {
if (alarm.timer) editTimer(idx, alarm); setTimeout(alarm.timer ? editTimer : editAlarm, 10, idx, alarm);
else editAlarm(idx, alarm);
} }
}; };
}); });
@ -76,7 +75,6 @@ function editDOW(dow, onchange) {
let dayOfWeek = require("locale").dow({ getDay: () => i }); let dayOfWeek = require("locale").dow({ getDay: () => i });
menu[dayOfWeek] = { menu[dayOfWeek] = {
value: !!(dow&(1<<i)), value: !!(dow&(1<<i)),
format: v => v ? /*LANG*/"Yes" : /*LANG*/"No",
onchange: v => v ? dow |= 1<<i : dow &= ~(1<<i), onchange: v => v ? dow |= 1<<i : dow &= ~(1<<i),
}; };
})(i); })(i);
@ -106,12 +104,10 @@ function editAlarm(alarmIndex, alarm) {
}, },
/*LANG*/'Enabled': { /*LANG*/'Enabled': {
value: a.on, value: a.on,
format: v => v ? /*LANG*/"On" : /*LANG*/"Off",
onchange: v=>a.on=v onchange: v=>a.on=v
}, },
/*LANG*/'Repeat': { /*LANG*/'Repeat': {
value: a.rp, value: a.rp,
format: v => v ? /*LANG*/"Yes" : /*LANG*/"No",
onchange: v => a.rp = v onchange: v => a.rp = v
}, },
/*LANG*/'Days': { /*LANG*/'Days': {
@ -125,7 +121,6 @@ function editAlarm(alarmIndex, alarm) {
/*LANG*/'Vibrate': require("buzz_menu").pattern(a.vibrate, v => a.vibrate=v ), /*LANG*/'Vibrate': require("buzz_menu").pattern(a.vibrate, v => a.vibrate=v ),
/*LANG*/'Auto Snooze': { /*LANG*/'Auto Snooze': {
value: a.as, value: a.as,
format: v => v ? /*LANG*/"Yes" : /*LANG*/"No",
onchange: v => a.as = v onchange: v => a.as = v
} }
}; };
@ -179,7 +174,6 @@ function editTimer(alarmIndex, alarm) {
}, },
/*LANG*/'Enabled': { /*LANG*/'Enabled': {
value: a.on, value: a.on,
format: v => v ? /*LANG*/"On" : /*LANG*/"Off",
onchange: v => a.on = v onchange: v => a.on = v
}, },
/*LANG*/'Vibrate': require("buzz_menu").pattern(a.vibrate, v => a.vibrate=v ), /*LANG*/'Vibrate': require("buzz_menu").pattern(a.vibrate, v => a.vibrate=v ),

View File

@ -2,7 +2,7 @@
"id": "alarm", "id": "alarm",
"name": "Alarms & Timers", "name": "Alarms & Timers",
"shortName": "Alarms", "shortName": "Alarms",
"version": "0.24", "version": "0.25",
"description": "Set alarms and timers on your Bangle", "description": "Set alarms and timers on your Bangle",
"icon": "app.png", "icon": "app.png",
"tags": "tool,alarm,widget", "tags": "tool,alarm,widget",