From 5c86142a94e7fbd27f5d529c2812f0f060724443 Mon Sep 17 00:00:00 2001 From: Skylar Ittner Date: Fri, 3 Apr 2020 11:49:36 -0600 Subject: [PATCH] Add "Display" settings page and move some settings to it (close #42) --- www/routes.js | 71 ++++++++++++++++++++++++++++++++++----------------- 1 file changed, 47 insertions(+), 24 deletions(-) diff --git a/www/routes.js b/www/routes.js index 4fdb5e8..5c3edfc 100644 --- a/www/routes.js +++ b/www/routes.js @@ -395,6 +395,13 @@ var routes = [ text: "Change map settings and units.", onclick: "router.navigate('/settings/maps')", link: true + }, + { + setting: "display", + title: "Display and Appearance", + text: "Change the app theme, show/hide help bubbles, etc.", + onclick: "router.navigate('/settings/display')", + link: true } ); if (platform_type == "cordova" && cordova.platformId != "browser") { @@ -409,30 +416,6 @@ var routes = [ } settings.push( - { - setting: "darktheme", - title: "Use dark theme", - text: "Saves power on phones with OLED screens.", - toggle: true, - checked: getStorage("darktheme") == "true", - onclick: "" - }, - { - setting: "showhelp", - title: "Show help", - text: "Show the help icons", - toggle: true, - checked: getStorage("show_help") != "false", - onclick: "" - }, - { - setting: "oldhomeui", - title: "Show home screen as list", - text: "Use a vertical list instead of tiles.", - toggle: true, - checked: getStorage("oldhomeui") == "true", - onclick: "" - }, { setting: "versions", title: "PackageHelper app v" + app_version, @@ -619,6 +602,46 @@ var routes = [ } }); } + }, + { + path: '/display', + name: 'settings', + async: function (routeTo, routeFrom, resolve, reject) { + var settings = [ + { + setting: "darktheme", + title: "Use dark theme", + text: "Saves power on phones with OLED screens.", + toggle: true, + checked: getStorage("darktheme") == "true", + onclick: "" + }, + { + setting: "showhelp", + title: "Show help", + text: "Show the help icons", + toggle: true, + checked: getStorage("show_help") != "false", + onclick: "" + }, + { + setting: "oldhomeui", + title: "Show home screen as list", + text: "Use a vertical list instead of tiles.", + toggle: true, + checked: getStorage("oldhomeui") == "true", + onclick: "" + } + ]; + resolve({ + templateUrl: './pages/settings.html' + }, { + context: { + page_title: "Display Settings", + settings: settings + } + }); + } } ] }