mirror of https://github.com/espruino/BangleApps
Merge pull request #1718 from alessandrococco/launcher-fullscreen
[Launcher] Fullscreen modepull/1723/head
commit
bbeea86eae
|
@ -12,3 +12,4 @@
|
|||
0.11: Merge Bangle.js 1 and 2 launchers, again
|
||||
0.12: Add an option to hide clocks from the app list (fix #1015)
|
||||
Add /*LANG*/ tags for internationalisation
|
||||
0.13: Add fullscreen mode
|
||||
|
|
|
@ -2,7 +2,10 @@ var s = require("Storage");
|
|||
var scaleval = 1;
|
||||
var vectorval = 20;
|
||||
var font = g.getFonts().includes("12x20") ? "12x20" : "6x8:2";
|
||||
let settings = Object.assign({ showClocks: true }, s.readJSON("launch.json", true) || {});
|
||||
let settings = Object.assign({
|
||||
showClocks: true,
|
||||
fullscreen: false
|
||||
}, s.readJSON("launch.json", true) || {});
|
||||
|
||||
if ("vectorsize" in settings) {
|
||||
vectorval = parseInt(settings.vectorsize);
|
||||
|
@ -44,8 +47,11 @@ function drawApp(i, r) {
|
|||
}
|
||||
|
||||
g.clear();
|
||||
Bangle.loadWidgets();
|
||||
Bangle.drawWidgets();
|
||||
|
||||
if (!settings.fullscreen) {
|
||||
Bangle.loadWidgets();
|
||||
Bangle.drawWidgets();
|
||||
}
|
||||
|
||||
E.showScroller({
|
||||
h : 64*scaleval, c : apps.length,
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
"id": "launch",
|
||||
"name": "Launcher",
|
||||
"shortName": "Launcher",
|
||||
"version": "0.12",
|
||||
"version": "0.13",
|
||||
"description": "This is needed to display a menu allowing you to choose your own applications. You can replace this with a customised launcher.",
|
||||
"icon": "app.png",
|
||||
"type": "launch",
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
// make sure to enclose the function in parentheses
|
||||
(function(back) {
|
||||
let settings = Object.assign({ showClocks: true }, require("Storage").readJSON("launch.json", true) || {});
|
||||
let settings = Object.assign({
|
||||
showClocks: true,
|
||||
fullscreen: false
|
||||
}, require("Storage").readJSON("launch.json", true) || {});
|
||||
|
||||
let fonts = g.getFonts();
|
||||
function save(key, value) {
|
||||
|
@ -8,7 +11,7 @@
|
|||
require("Storage").write("launch.json",settings);
|
||||
}
|
||||
const appMenu = {
|
||||
"": {"title": /*LANG*/"Launcher Settings"},
|
||||
"": { "title": /*LANG*/"Launcher" },
|
||||
/*LANG*/"< Back": back,
|
||||
/*LANG*/"Font": {
|
||||
value: fonts.includes(settings.font)? fonts.indexOf(settings.font) : fonts.indexOf("12x20"),
|
||||
|
@ -16,15 +19,20 @@
|
|||
onchange: (m) => {save("font", fonts[m])},
|
||||
format: v => fonts[v]
|
||||
},
|
||||
/*LANG*/"Vector font size": {
|
||||
/*LANG*/"Vector Font Size": {
|
||||
value: settings.vectorsize || 10,
|
||||
min:10, max: 20,step:1,wrap:true,
|
||||
onchange: (m) => {save("vectorsize", m)}
|
||||
},
|
||||
/*LANG*/"Show clocks": {
|
||||
/*LANG*/"Show Clocks": {
|
||||
value: settings.showClocks == true,
|
||||
format: v => v ? /*LANG*/"Yes" : /*LANG*/"No",
|
||||
onchange: (m) => {save("showClocks", m)}
|
||||
onchange: (m) => { save("showClocks", m) }
|
||||
},
|
||||
/*LANG*/"Fullscreen": {
|
||||
value: settings.fullscreen == true,
|
||||
format: v => v ? /*LANG*/"Yes" : /*LANG*/"No",
|
||||
onchange: (m) => { save("fullscreen", m) }
|
||||
}
|
||||
};
|
||||
E.showMenu(appMenu);
|
||||
|
|
Loading…
Reference in New Issue