mirror of https://github.com/espruino/BangleApps
only load widgets if fastload is installed
parent
f21a0c6a52
commit
95c5fd8bcf
|
@ -8,4 +8,5 @@
|
||||||
0.08: Force background of widget field to the torch colour
|
0.08: Force background of widget field to the torch colour
|
||||||
0.09: Change code taking FW tweaks into account
|
0.09: Change code taking FW tweaks into account
|
||||||
0.10: Introduce fast switching.
|
0.10: Introduce fast switching.
|
||||||
0.11: Make compatible with Fastload Utils by loading widgets.
|
0.11: Make compatible with Fastload Utils by loading widgets. No change if
|
||||||
|
Fastload Utils is not installed.
|
||||||
|
|
|
@ -1,14 +1,15 @@
|
||||||
{
|
{
|
||||||
const SETTINGS_FILE = "torch.json";
|
const SETTINGS_FILE = "torch.json";
|
||||||
let settings;
|
let settings;
|
||||||
|
let s = require("Storage");
|
||||||
|
|
||||||
let loadSettings = function() {
|
let loadSettings = function() {
|
||||||
settings = require("Storage").readJSON(SETTINGS_FILE,1)|| {'bg': '#FFFFFF', 'color': 'White'};
|
settings = s.readJSON(SETTINGS_FILE,1)|| {'bg': '#FFFFFF', 'color': 'White'};
|
||||||
};
|
};
|
||||||
|
|
||||||
loadSettings();
|
loadSettings();
|
||||||
|
|
||||||
let brightnessBackup = require("Storage").readJSON('setting.json').brightness;
|
let brightnessBackup = s.readJSON('setting.json').brightness;
|
||||||
let optionsBackup = Bangle.getOptions();
|
let optionsBackup = Bangle.getOptions();
|
||||||
Bangle.setLCDBrightness(1);
|
Bangle.setLCDBrightness(1);
|
||||||
Bangle.setLCDPower(1);
|
Bangle.setLCDPower(1);
|
||||||
|
@ -18,7 +19,8 @@
|
||||||
g.setTheme({bg:settings.bg,fg:"#000"});
|
g.setTheme({bg:settings.bg,fg:"#000"});
|
||||||
g.setColor(settings.bg);
|
g.setColor(settings.bg);
|
||||||
g.fillRect(0,0,g.getWidth(),g.getHeight());
|
g.fillRect(0,0,g.getWidth(),g.getHeight());
|
||||||
Bangle.loadWidgets();
|
// if Fastload Utils is installed, make Torch compatible with it.
|
||||||
|
if (s.readJSON('fastload.info') != undefined) Bangle.loadWidgets();
|
||||||
Bangle.setUI({
|
Bangle.setUI({
|
||||||
mode : 'custom',
|
mode : 'custom',
|
||||||
back : Bangle.showClock, // B2: SW back button to exit
|
back : Bangle.showClock, // B2: SW back button to exit
|
||||||
|
|
Loading…
Reference in New Issue