diff --git a/apps/gallifr/app.js b/apps/gallifr/app.js index ebac920f6..348be4d79 100644 --- a/apps/gallifr/app.js +++ b/apps/gallifr/app.js @@ -1,3 +1,8 @@ +// +// Time Travellers Watch +// Written May 2020 by Richard Hopkins +// based on a skeleton app by Gordon Williams +// const locale = require('locale'); const widgetHeight=24; let timer = null; @@ -8,6 +13,8 @@ const radius = Math.round(Math.min(g.getWidth()/2,(g.getHeight()-widgetHeight) / const cirRad = 2*Math.PI; const proportion = 0.3; // relative size of hour hand const thickness = 4; // thickness of decorative lines +const settings = require("Storage").readJSON("app.json", 1); +const decoration = settings['decoration'] const drawSegment = (params) => { angle1 = params.start/360*cirRad; @@ -71,7 +78,7 @@ const drawThickLine = (params) => { const drawHands = () => { drawMinuteHand(); drawHourHand(); - drawDecoration(); + if (decoration) {drawDecoration()}; }; const drawDecoration = () => { diff --git a/apps/gallifr/settings.js b/apps/gallifr/settings.js index 78e7e516d..ac54c90ae 100644 --- a/apps/gallifr/settings.js +++ b/apps/gallifr/settings.js @@ -23,7 +23,7 @@ onchange: m => {save('widgets', m)} }, 'Decoration': { - value: 0|settings['decoration'], + value: 1|settings['decoration'], min:0,max:1, format: m => onoff[m], onchange: m => {save('decoration', m)}