diff --git a/apps/gipy/ChangeLog b/apps/gipy/ChangeLog index 6bd5f5898..41c817f69 100644 --- a/apps/gipy/ChangeLog +++ b/apps/gipy/ChangeLog @@ -130,4 +130,5 @@ * Switching screen will clear the screen immediately so you can know your screen touch has been received 0.24: - * Fix for loading very large files (> 65kb) \ No newline at end of file + * Fix for loading very large files (> 65kb) + * new menu on file selection : reverse path without waiting for file to load \ No newline at end of file diff --git a/apps/gipy/app.js b/apps/gipy/app.js index d5cbbc198..a211ed75b 100644 --- a/apps/gipy/app.js +++ b/apps/gipy/app.js @@ -1370,14 +1370,47 @@ function drawMenu() { menu["Exit"] = function () { load(); }; + Bangle.setLCDBrightness(settings.brightness); + Bangle.setLocked(false); E.showMenu(menu); } + +function ask_options(fn) { + g.clear(); + let height = g.getHeight(); + let width = g.getWidth(); + g.drawRect(10, 10, width - 10, height / 2 - 10); + g.drawRect(10, height/2 + 10, width - 10, height - 10); + g.setFont("Vector:30").setFontAlign(0,0).drawString("Forward", width/2, height/4); + g.drawString("Backward", width/2, 3*height/4); + g.flip(); + + function options_select(b, xy) { + end = false; + if (xy.y < height / 2 - 10) { + g.setColor(0, 0, 0).fillRect(10, 10, width - 10, height / 2 - 10); + g.setColor(1, 1, 1).setFont("Vector:30").setFontAlign(0,0).drawString("Forward", width/2, height/4); + end = true; + } else if (xy.y > height/2 + 10) { + g.setColor(0, 0, 0).fillRect(10, height/2 + 10, width - 10, height - 10); + g.setColor(1, 1, 1).setFont("Vector:30").setFontAlign(0,0).drawString("Backward", width/2, 3*height/4); + go_backwards = true; + end = true; + } + if (end) { + g.flip(); + Bangle.removeListener("touch", options_select); + console.log("loading", fn); + load_gps(fn); + } + } + Bangle.on("touch", options_select); +} + function start(fn) { E.showMenu(); - console.log("loading", fn); - - load_gps(fn); + ask_options(fn); } function start_gipy(path, maps, interests, heights) {