From ff3228c8f2fcbe64cc6c80df289c7fe13f5b1004 Mon Sep 17 00:00:00 2001 From: thyttan <6uuxstm66@mozmail.comā©> Date: Sat, 31 Aug 2024 22:23:05 +0200 Subject: [PATCH] pomoplus: refactor function names touchHandler -> onTouchSoftwareButtons switchGraphicsOnButton -> onButtonSwitchGraphics --- apps/pomoplus/app.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/apps/pomoplus/app.js b/apps/pomoplus/app.js index 0c4e5a79a0..c587a3b730 100644 --- a/apps/pomoplus/app.js +++ b/apps/pomoplus/app.js @@ -93,7 +93,7 @@ let hideButtons = ()=>{ } let graphicState = 0; // 0 - all is visible, 1 - widgets are hidden, 2 - widgets and buttons are hidden. -let switchGraphicsOnButton = (n)=>{ +let onButtonSwitchGraphics = (n)=>{ if (process.env.HWVERSION == 2) n=2; // Translate Bangle.js 2 button to Bangle.js 1 middle button. if (n == 2) { if (graphicState == 0) { @@ -106,12 +106,11 @@ let switchGraphicsOnButton = (n)=>{ wu.show(); drawButtons(); } - graphicState = (graphicState+1) % 3; } } -let touchHandler = (button, xy) => { +let onTouchSoftwareButtons = (button, xy) => { //If we support full touch and we're not touching the keys, ignore. //If we don't support full touch, we can't tell so just assume we are. let isOutsideButtonArea = xy !== undefined && xy.y <= g.getHeight() - BUTTON_HEIGHT; @@ -175,9 +174,8 @@ let touchHandler = (button, xy) => { Bangle.setUI({ mode: "custom", - touch: touchHandler, - btn: switchGraphicsOnButton - + touch: onTouchSoftwareButtons, + btn: onButtonSwitchGraphics }) let timerInterval;