clock_info: s/unfocus/blur/

pull/3234/head
Rob Pilling 2024-03-11 08:43:20 +00:00
parent 8f86d9297b
commit 2c92c94574
2 changed files with 5 additions and 5 deletions

View File

@ -284,12 +284,12 @@ exports.addInteractive = function(menu, options) {
E.stopEventPropagation&&E.stopEventPropagation();
}
Bangle.on("swipe",swipeHandler);
const unfocus = () => {
const blur = () => {
options.focus=false;
delete Bangle.CLKINFO_FOCUS;
options.redraw();
const itm = menu[options.menuA].items[options.menuB];
if (itm.unfocus) itm.unfocus(options);
if (itm.blur) itm.blur(options);
};
const focus = (redraw) => {
if (!options.focus) {
@ -306,7 +306,7 @@ exports.addInteractive = function(menu, options) {
if (e.x<options.x || e.y<options.y ||
e.x>(options.x+options.w) || e.y>(options.y+options.h)) {
if (options.focus)
unfocus();
blur();
return; // outside area
}
if (!options.focus) {
@ -322,7 +322,7 @@ exports.addInteractive = function(menu, options) {
if (settings.defocusOnLock) {
lockHandler = function() {
if(options.focus)
unfocus();
blur();
};
Bangle.on("lock", lockHandler);
}

View File

@ -16,7 +16,7 @@ declare module ClockInfo {
on(what: "redraw", cb: () => void): void, // extending from Object
run?(options: InteractiveOptions): void,
focus?(options: InteractiveOptions): void,
unfocus?(options: InteractiveOptions): void,
blur?(options: InteractiveOptions): void,
} & (
{
hasRange: true,