From 1b32f197f61ed2ca0bdc04833895174d56a0ac5c Mon Sep 17 00:00:00 2001 From: thyttan <6uuxstm66@mozmail.comā©> Date: Tue, 2 Jul 2024 23:00:41 +0200 Subject: [PATCH] setuichange: Change default btn edge to rising To make the ui feel snappier. First discussed around here: https://github.com/espruino/BangleApps/issues/3435#issuecomment-2157804935 --- apps/setuichange/boot.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/apps/setuichange/boot.js b/apps/setuichange/boot.js index 07bdac3fb5..5f1e1488c6 100644 --- a/apps/setuichange/boot.js +++ b/apps/setuichange/boot.js @@ -52,7 +52,7 @@ Bangle.on('drag',Bangle.dragHandler); Bangle.touchHandler = d => {b();cb();}; Bangle.btnWatches = [ - setWatch(function() { b();cb(); }, BTN1, {repeat:1, edge:"falling"}), + setWatch(function() { b();cb(); }, BTN1, {repeat:1, edge:"rising"}), ]; } else if (mode=="leftright") { var dx = 0; @@ -68,12 +68,12 @@ Bangle.on('drag',Bangle.dragHandler); Bangle.touchHandler = d => {b();cb();}; Bangle.btnWatches = [ - setWatch(function() { b();cb(); }, BTN1, {repeat:1, edge:"falling"}), + setWatch(function() { b();cb(); }, BTN1, {repeat:1, edge:"rising"}), ]; } else if (mode=="clock") { Bangle.CLOCK=1; Bangle.btnWatches = [ - setWatch(Bangle.showLauncher, BTN1, {repeat:1,edge:"falling"}) + setWatch(Bangle.showLauncher, BTN1, {repeat:1,edge:"rising"}) ]; } else if (mode=="clockupdown") { Bangle.CLOCK=1; @@ -82,7 +82,7 @@ b();cb((e.y > 88) ? 1 : -1); }; Bangle.btnWatches = [ - setWatch(Bangle.showLauncher, BTN1, {repeat:1,edge:"falling"}) + setWatch(Bangle.showLauncher, BTN1, {repeat:1,edge:"rising"}) ]; } else if (mode=="custom") { } else @@ -100,11 +100,11 @@ } if (options.btn) { Bangle.btnWatches = [ - setWatch(function() { options.btn(1); }, BTN1, {repeat:1,edge:"falling"}) + setWatch(function() { options.btn(1); }, BTN1, {repeat:1,edge:"rising"}) ]; } else if (options.clock) { Bangle.btnWatches = [ - setWatch(Bangle.showLauncher, BTN1, {repeat:1,edge:"falling"}) + setWatch(Bangle.showLauncher, BTN1, {repeat:1,edge:"rising"}) ]; } if (options.remove) // handler for removing the UI (intervals/etc) @@ -133,7 +133,7 @@ btnWatch = setWatch(function() { btnWatch = undefined; options.back(); - }, BTN1, {edge:"falling"}); + }, BTN1, {edge:"rising"}); WIDGETS = Object.assign({back:{ area:"tl", width:24, draw:e=>g.reset().setColor("#f00").drawImage(atob("GBiBAAAYAAH/gAf/4A//8B//+D///D///H/P/n+H/n8P/n4f/vwAP/wAP34f/n8P/n+H/n/P/j///D///B//+A//8Af/4AH/gAAYAA=="),e.x,e.y),