diff --git a/apps/messages/ChangeLog b/apps/messages/ChangeLog index 74f8b0212..ac2ace30d 100644 --- a/apps/messages/ChangeLog +++ b/apps/messages/ChangeLog @@ -64,4 +64,5 @@ 0.48: When getting new message from the clock, only buzz once the messages app is loaded 0.49: Change messages icon (to fit within 24px) and ensure widget renders icons centrally 0.50: Add `getMessages` and `status` functions to library - Option to disable auto-open of messages \ No newline at end of file + Option to disable auto-open of messages + Option to make message icons monochrome (not colored) diff --git a/apps/messages/lib.js b/apps/messages/lib.js index 631099936..d8599c93d 100644 --- a/apps/messages/lib.js +++ b/apps/messages/lib.js @@ -144,7 +144,6 @@ exports.getMessageImage = function(msg) { if (s=="gmx") return atob("GBgBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHEJmfmd8Zuc85v847/88Z9s8fttmHIHiAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"); if (s=="google") return atob("GBiBAAAAAAD/AAP/wAf/4A/D4B8AwDwAADwAAHgAAHgAAHAAAHAH/nAH/nAH/ngH/ngAHjwAPDwAfB8A+A/D8Af/4AP/wAD/AAAAAA=="); if (s=="google home") return atob("GBiCAAAAAAAAAAAAAAAAAAAAAoAAAAAACqAAAAAAKqwAAAAAqroAAAACquqAAAAKq+qgAAAqr/qoAACqv/6qAAKq//+qgA6r///qsAqr///6sAqv///6sAqv///6sAqv///6sA6v///6sA6v///qsA6qqqqqsA6qqqqqsA6qqqqqsAP7///vwAAAAAAAAAAAAAAAAA=="); // 2 bit unpaletted - if (s=="hangouts") return atob("FBaBAAH4AH/gD/8B//g//8P//H5n58Y+fGPnxj5+d+fmfj//4//8H//B//gH/4A/8AA+AAHAABgAAAA="); if (s=="home assistant") return atob("FhaBAAAAAADAAAeAAD8AAf4AD/3AfP8D7fwft/D/P8ec572zbzbNsOEhw+AfD8D8P4fw/z/D/P8P8/w/z/AAAAA="); if (s=="instagram") return atob("GBiBAAAAAAAAAAAAAAAAAAP/wAYAYAwAMAgAkAh+EAjDEAiBEAiBEAiBEAiBEAjDEAh+EAgAEAwAMAYAYAP/wAAAAAAAAAAAAAAAAA=="); if (s=="kalender") return atob("GBgBBgBgBQCgff++RQCiRgBiQAACf//+QAACQAACR//iRJkiRIEiR//iRNsiRIEiRJkiR//iRIEiRIEiR//iQAACQAACf//+AAAA"); @@ -178,11 +177,14 @@ exports.getMessageImage = function(msg) { }; exports.getMessageImageCol = function(msg,def) { + let iconColorMode = (require('Storage').readJSON("messages.settings.json", 1) || {}).iconColorMode; + if (iconColorMode == 'mono') + return g.theme.fg; const s = (("string"=== typeof msg) ? msg : (msg.src || "")).toLowerCase(); return { // generic colors, using B2-safe colors + // DO NOT USE BLACK OR WHITE HERE, just leave the declaration out and then the theme's fg color will be used "airbnb": "#f00", - "alarm": "#fff", "mail": "#ff0", "music": "#f0f", "phone": "#0f0", @@ -198,8 +200,7 @@ exports.getMessageImageCol = function(msg,def) { "gmx": "#1c449b", "google": "#4285F4", "google home": "#fbbc05", - "hangouts": "#1ba261", - "home assistant": "#fff", // ha-blue is #41bdf5, but that's the background +// "home assistant": "#41bdf5", // ha-blue is #41bdf5, but that's the background "instagram": "#dd2a7b", "lieferando": "#ee5c00", "messenger": "#0078ff", @@ -220,7 +221,6 @@ exports.getMessageImageCol = function(msg,def) { "teams": "#464eb8", "telegram": "#0088cc", "telegram foss": "#0088cc", - "threema": "#000", "to do": "#3999e5", "twitch": "#6441A4", "twitter": "#1da1f2", diff --git a/apps/messages/settings.js b/apps/messages/settings.js index 7d90f6aea..0edb17797 100644 --- a/apps/messages/settings.js +++ b/apps/messages/settings.js @@ -1,4 +1,6 @@ (function(back) { + const iconColorModes = ['color', 'mono']; + function settings() { let settings = require('Storage').readJSON("messages.settings.json", true) || {}; if (settings.vibrate===undefined) settings.vibrate=":"; @@ -7,6 +9,7 @@ if (settings.vibrateTimeout===undefined) settings.vibrateTimeout=60; if (settings.unreadTimeout===undefined) settings.unreadTimeout=60; if (settings.maxMessages===undefined) settings.maxMessages=3; + if (settings.iconColorMode === undefined) settings.iconColorMode = iconColorModes[0]; settings.unlockWatch=!!settings.unlockWatch; settings.openMusic=!!settings.openMusic; settings.maxUnreadTimeout=240; @@ -72,6 +75,12 @@ value:0|settings().maxMessages, min: 1, max: 5, onchange: v => updateSetting("maxMessages", v) + }, + /*LANG*/'Icon color mode': { + value: Math.max(0,iconColorModes.indexOf(settings().iconColorMode)), + min: 0, max: iconColorModes.length - 1, + format: v => iconColorModes[v], + onchange: v => updateSetting("iconColorMode", iconColorModes[v]) } }; E.showMenu(mainmenu);