Move LCD Brightness menu into more general LCD menu & unify writings

pull/272/head
Marco Heiming 2020-04-10 17:42:14 +02:00
parent 7e836e5406
commit d9a9bae5ee
3 changed files with 22 additions and 21 deletions

View File

@ -119,7 +119,7 @@
{ "id": "setting",
"name": "Settings",
"icon": "settings.png",
"version":"0.12",
"version":"0.13",
"description": "A menu for setting up Bangle.js",
"tags": "tool,system",
"storage": [

View File

@ -12,3 +12,4 @@
0.12: Fix memory leak (#206)
Bring App settings nearer the top
Move LCD Timeout to wakeup menu
0.13: Move LCD Brightness menu into more general LCD menu

View File

@ -89,17 +89,6 @@ function showMainMenu() {
updateSettings();
}
},
'LCD Brightness': {
value: settings.brightness,
min: 0.1,
max: 1,
step: 0.1,
onchange: v => {
settings.brightness = v || 1;
updateSettings();
Bangle.setLCDBrightness(settings.brightness);
}
},
'Beep': {
value: 0 | beepV.indexOf(settings.beep),
min: 0, max: 2,
@ -134,7 +123,7 @@ function showMainMenu() {
}
},
'Set Time': ()=>showSetTimeMenu(),
'LCD Wake-Up': ()=>showWakeUpMenu(),
'LCD': ()=>showLCDMenu(),
'Reset Settings': ()=>showResetMenu(),
'Turn Off': ()=>Bangle.off(),
'< Back': ()=>load()
@ -142,10 +131,21 @@ function showMainMenu() {
return E.showMenu(mainmenu);
}
function showWakeUpMenu() {
const wakeUpMenu = {
'': { 'title': 'LCD Wake-Up' },
function showLCDMenu() {
const lcdMenu = {
'': { 'title': 'LCD' },
'< Back': ()=>showMainMenu(),
'LCD Brightness': {
value: settings.brightness,
min: 0.1,
max: 1,
step: 0.1,
onchange: v => {
settings.brightness = v || 1;
updateSettings();
Bangle.setLCDBrightness(settings.brightness);
}
},
'LCD Timeout': {
value: settings.timeout,
min: 0,
@ -157,7 +157,7 @@ function showWakeUpMenu() {
Bangle.setLCDTimeout(settings.timeout);
}
},
'Wake On BTN1': {
'Wake on BTN1': {
value: settings.options.wakeOnBTN1,
format: boolFormat,
onchange: () => {
@ -165,7 +165,7 @@ function showWakeUpMenu() {
updateOptions();
}
},
'Wake On BTN2': {
'Wake on BTN2': {
value: settings.options.wakeOnBTN2,
format: boolFormat,
onchange: () => {
@ -173,7 +173,7 @@ function showWakeUpMenu() {
updateOptions();
}
},
'Wake On BTN3': {
'Wake on BTN3': {
value: settings.options.wakeOnBTN3,
format: boolFormat,
onchange: () => {
@ -197,7 +197,7 @@ function showWakeUpMenu() {
updateOptions();
}
},
'Wake On Twist': {
'Wake on Twist': {
value: settings.options.wakeOnTwist,
format: boolFormat,
onchange: () => {
@ -236,7 +236,7 @@ function showWakeUpMenu() {
}
}
}
return E.showMenu(wakeUpMenu)
return E.showMenu(lcdMenu)
}
function showLocaleMenu() {