Fixed up info width overwrite; settings default funciton added

master
David Volovskiy 2025-05-24 10:33:25 -04:00
parent a1927e95c3
commit f6629aa3fc
2 changed files with 35 additions and 35 deletions

View File

@ -24,8 +24,8 @@ var pals = Array(3).fill().map(() => (
let palbg;
const infoLineDefault = (3*h/4) - 6;
const infoWidthDefault = 56;
const infoHeightDefault = 11;
const infoWidthDefault = 64;
const infoHeightDefault = 8;
const ringEdge = 4;
const ringIterOffset = 10;
const ringThick = 6;
@ -359,13 +359,13 @@ function getInfoDims() {
var height = infoHeightDefault;
switch (innerMostRing) {
case 2:
width -= 8;
width -= 10;
height -= 2;
line -= 7;
break;
case 3:
width -= 9;
height -= 6;
width -= 17;
height -= 3;
line -= 10;
break;
}

View File

@ -1,43 +1,43 @@
(function(back) {
const SETTINGS_FILE = "daisy.json";
// default settings
let s = {
rings: [{}, {}, {}],
color: 'Outer',
fg: '#0f0',
check_idle: true,
batt_hours: false,
idxInfo: 0,
};
s.rings[0] = {
function getDefaultSettings() {
return {
rings: [
{
color: 'Green',
fg: '#0f0',
gy: '#020',
ring: 'Steps',
type: 'Full',
step_target: 10000,
};
s.rings[1] = {
},
{
color: 'Blk/Wht',
fg: null,
gy: null,
ring: 'Minutes',
type: 'None',
step_target: 10000,
};
s.rings[2] = {
},
{
color: 'Green',
fg: '#0f0',
gy: '#020',
ring: 'Hours',
type: 'None',
step_target: 10000,
}
],
color: 'Outer',
fg: '#0f0',
check_idle: true,
batt_hours: false,
idxInfo: 0,
};
}
let s = getDefaultSettings();
// ...and overwrite them with any saved values
// This way saved values are preserved if a new version adds more settings
const storage = require('Storage');