settings: special-case theme menu (push & pop)
parent
9503c0fc6b
commit
75ed3daf52
|
|
@ -111,7 +111,7 @@ function systemMenu() {
|
||||||
const mainmenu = {
|
const mainmenu = {
|
||||||
'': { 'title': /*LANG*/'System' },
|
'': { 'title': /*LANG*/'System' },
|
||||||
'< Back': ()=>popMenu(mainMenu()),
|
'< Back': ()=>popMenu(mainMenu()),
|
||||||
/*LANG*/'Theme': ()=>pushMenu(themeMenu()),
|
/*LANG*/'Theme': ()=>showThemeMenu(),
|
||||||
/*LANG*/'LCD': ()=>pushMenu(LCDMenu()),
|
/*LANG*/'LCD': ()=>pushMenu(LCDMenu()),
|
||||||
/*LANG*/'Locale': ()=>pushMenu(localeMenu()),
|
/*LANG*/'Locale': ()=>pushMenu(localeMenu()),
|
||||||
/*LANG*/'Clock': ()=>pushMenu(clockMenu()),
|
/*LANG*/'Clock': ()=>pushMenu(clockMenu()),
|
||||||
|
|
@ -259,7 +259,7 @@ function BLEMenu() {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
function themeMenu() {
|
function showThemeMenu(pop) {
|
||||||
function cl(x) { return g.setColor(x).getColor(); }
|
function cl(x) { return g.setColor(x).getColor(); }
|
||||||
function upd(th) {
|
function upd(th) {
|
||||||
g.theme = th;
|
g.theme = th;
|
||||||
|
|
@ -309,11 +309,11 @@ function themeMenu() {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
themesMenu[/*LANG*/'Customize'] = () => pushMenu(customThemeMenu());
|
themesMenu[/*LANG*/'Customize'] = () => showCustomThemeMenu();
|
||||||
|
|
||||||
var m = pushMenu(themesMenu);
|
var m = (pop ? popMenu : pushMenu)(themesMenu);
|
||||||
|
|
||||||
function customThemeMenu() {
|
function showCustomThemeMenu() {
|
||||||
function setT(t, v) {
|
function setT(t, v) {
|
||||||
let th = g.theme;
|
let th = g.theme;
|
||||||
th[t] = v;
|
th[t] = v;
|
||||||
|
|
@ -344,7 +344,7 @@ function themeMenu() {
|
||||||
}
|
}
|
||||||
let menu = {
|
let menu = {
|
||||||
'':{title:/*LANG*/'Custom Theme'},
|
'':{title:/*LANG*/'Custom Theme'},
|
||||||
"< Back": () => popMenu(themeMenu())
|
"< Back": () => showThemeMenu(1)
|
||||||
};
|
};
|
||||||
const labels = {
|
const labels = {
|
||||||
fg: /*LANG*/'Foreground', bg: /*LANG*/'Background',
|
fg: /*LANG*/'Foreground', bg: /*LANG*/'Background',
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue