From a67ef83bd82149262410f28d6868b8900db6e800 Mon Sep 17 00:00:00 2001 From: "Minges, Alexander Ralph Michael (almin100)" Date: Fri, 17 Dec 2021 14:12:58 +0100 Subject: [PATCH] calendar: use hardware version to set color scheme --- apps/calendar/ChangeLog | 2 +- apps/calendar/calendar.js | 10 +++++++--- apps/calendar/settings.js | 6 +++++- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/apps/calendar/ChangeLog b/apps/calendar/ChangeLog index fc0fb287b..e164d6be9 100644 --- a/apps/calendar/ChangeLog +++ b/apps/calendar/ChangeLog @@ -1,4 +1,4 @@ 0.01: Basic calendar 0.02: Make Bangle 2 compatible 0.03: Add setting to start week on Sunday -0.04: Add setting to switch color schemes. Default color scheme will now use colors that are not dithered on Bangle 2. Use localized names for months and days of the week (Language app needed). +0.04: Add setting to switch color schemes. On Bangle 2 non-dithering colors will be used by default. Use localized names for months and days of the week (Language app needed). diff --git a/apps/calendar/calendar.js b/apps/calendar/calendar.js index 7da903923..01977570a 100644 --- a/apps/calendar/calendar.js +++ b/apps/calendar/calendar.js @@ -20,10 +20,14 @@ const yellow = "#ffff00"; let settings = require('Storage').readJSON("calendar.json", true) || {}; if (settings.startOnSun === undefined) settings.startOnSun = false; -if (settings.ndColor === undefined) - settings.ndColor = true; +if (settings.ndColors === undefined) + if (process.env.HWVERSION == 2) { + settings.ndColors = true; + } else { + settings.ndColors = false; + } -if (settings.ndColor === true) { +if (settings.ndColors === true) { let bgColor = white; let bgColorMonth = blue; let bgColorDow = black; diff --git a/apps/calendar/settings.js b/apps/calendar/settings.js index 76e2c7455..1c0a3fb51 100644 --- a/apps/calendar/settings.js +++ b/apps/calendar/settings.js @@ -4,7 +4,11 @@ if (settings.startOnSun === undefined) settings.startOnSun = false; if (settings.ndColors === undefined) - settings.ndColors = true; + if (process.env.HWVERSION == 2) { + settings.ndColors = true; + } else { + settings.ndColors = false; + } function writeSettings() { require('Storage').writeJSON(FILE, settings);