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

View File

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