Skip to content

Commit f1505b2

Browse files
authored
Merge pull request espruino#3630 from bobrippling/feat/settings-menu-return
settings: restore previous menu's scroll position
2 parents 58a6fee + 308956b commit f1505b2

File tree

4 files changed

+138
-91
lines changed

4 files changed

+138
-91
lines changed

apps/setting/ChangeLog

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,4 +82,5 @@ of 'Select Clock'
8282
0.71: Minor code improvements
8383
0.72: Add setting for configuring BLE privacy
8484
0.73: Fix `const` bug / work with fastload
85-
0.74: Add extra layer of checks before allowing a factory reset (fix #3476)
85+
0.74: Add extra layer of checks before allowing a factory reset (fix #3476)
86+
0.75: Restore previous menu's scroll positions

apps/setting/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,13 @@ The exact effects depend on the app. In general the watch will not wake up by i
6767
* **Reset Settings** Reset the settings (as set in this app) to defaults. Does not reset settings for other apps.
6868
* **Factory Reset** (not available on Bangle.js 1) - wipe **everything** and return to a factory state
6969
* **Turn Off** Turn Bangle.js off
70+
71+
# Development
72+
73+
The settings code uses `push/pop/restoreMenu` to navigate different levels of menus. These functions are used as follows:
74+
75+
- `pushMenu`: enter a new level of menu, one deeper than the current (e.g. a submenu)
76+
- `popMenu`: return to the previous menu level, one more shallow than the current (e.g. returning from a submenu)
77+
- `restoreMenu`: redraw the current menu (e.g. after an alert)
78+
79+
These functions will keep track of outer menu's scroll positions, to avoid the user being returned to the very first entry as they navigate.

apps/setting/metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"id": "setting",
33
"name": "Settings",
4-
"version": "0.74",
4+
"version": "0.75",
55
"description": "A menu for setting up Bangle.js",
66
"icon": "settings.png",
77
"tags": "tool,system",

0 commit comments

Comments
 (0)