Add message icon for 'clock', and ensure messages with no body just use the title

master
Gordon Williams 2023-01-11 13:50:21 +00:00
parent 5c0de891f2
commit 16daa3d294
7 changed files with 14 additions and 6 deletions

View File

@ -86,3 +86,4 @@
0.61: Fix regression where loading into messages app stops back from working (#2398) 0.61: Fix regression where loading into messages app stops back from working (#2398)
0.62: Remove '.show' field, tidyup and fix .open if fast load not enabled 0.62: Remove '.show' field, tidyup and fix .open if fast load not enabled
0.63: Fix messages app loading on clock without fast load 0.63: Fix messages app loading on clock without fast load
0.64: Ensure we don't get 'undefined' as the message body

View File

@ -263,6 +263,12 @@ function showMessage(msgid) {
active = "message"; active = "message";
// Normal text message display // Normal text message display
var title=msg.title, titleFont = fontLarge, lines; var title=msg.title, titleFont = fontLarge, lines;
var body=msg.body, bodyFont = fontLarge;
// If no body, use the title text instead...
if (body===undefined) {
body = title;
title = undefined;
}
if (title) { if (title) {
var w = g.getWidth()-48; var w = g.getWidth()-48;
if (g.setFont(titleFont).stringWidth(title) > w) { if (g.setFont(titleFont).stringWidth(title) > w) {
@ -276,7 +282,7 @@ function showMessage(msgid) {
} }
} }
// If body of message is only two lines long w/ large font, use large font. // If body of message is only two lines long w/ large font, use large font.
var body=msg.body, bodyFont = fontLarge;
if (body) { if (body) {
var w = g.getWidth()-10; var w = g.getWidth()-10;
if (g.setFont(bodyFont).stringWidth(body) > w * 2) { if (g.setFont(bodyFont).stringWidth(body) > w * 2) {

View File

@ -2,7 +2,7 @@
"id": "messagegui", "id": "messagegui",
"name": "Message UI", "name": "Message UI",
"shortName": "Messages", "shortName": "Messages",
"version": "0.63", "version": "0.64",
"description": "Default app to display notifications from iOS and Gadgetbridge/Android", "description": "Default app to display notifications from iOS and Gadgetbridge/Android",
"icon": "app.png", "icon": "app.png",
"type": "app", "type": "app",

View File

@ -2,4 +2,4 @@
0.02: Added several new icons and colors 0.02: Added several new icons and colors
0.03: Fix icons broken in 0v02 (#2386) 0.03: Fix icons broken in 0v02 (#2386)
Store all icons in a separate binary file (much faster lookup) Store all icons in a separate binary file (much faster lookup)
0.04: Add message icon for 'clock'

View File

@ -14,6 +14,7 @@
{ "app":"etar", "icon":"etar.png" }, { "app":"etar", "icon":"etar.png" },
{ "app":"chat", "icon":"google chat.png" }, { "app":"chat", "icon":"google chat.png" },
{ "app":"chrome", "icon":"chrome.png" }, { "app":"chrome", "icon":"chrome.png" },
{ "app":"clock", "icon":"alarm.png" },
{ "app":"corona-warn", "icon":"coronavirus.png" }, { "app":"corona-warn", "icon":"coronavirus.png" },
{ "app":"bmo", "icon":"bank.png" }, { "app":"bmo", "icon":"bank.png" },
{ "app":"desjardins", "icon":"bank.png" }, { "app":"desjardins", "icon":"bank.png" },

View File

@ -2,7 +2,7 @@ exports.getImage = function(msg) {
if (msg.img) return atob(msg.img); if (msg.img) return atob(msg.img);
let s = (("string"=== typeof msg) ? msg : (msg.src || "")).toLowerCase(); let s = (("string"=== typeof msg) ? msg : (msg.src || "")).toLowerCase();
if (msg.id=="music") s="music"; if (msg.id=="music") s="music";
let match = ",default|0,airbnb|1,alarm|2,alarmclockreceiver|2,amazon shopping|3,bibel|4,bitwarden|5,1password|5,lastpass|5,dashlane|5,bring|6,calendar|7,etar|7,chat|8,chrome|9,corona-warn|10,bmo|11,desjardins|11,rbc mobile|11,nbc|11,rabobank|11,scotiabank|11,td (canada)|11,discord|12,drive|13,element|14,facebook|15,messenger|16,firefox|17,firefox beta|17,firefox nightly|17,f-droid|5,neo store|5,aurora droid|5,github|18,gitlab|19,gmx|20,google|21,google home|22,google play store|23,home assistant|24,instagram|25,kalender|26,keep notes|27,lieferando|28,linkedin|29,maps|30,organic maps|30,osmand|30,mastodon|31,fedilab|31,tooot|31,tusky|31,mattermost|32,n26|33,netflix|34,news|35,cbc news|35,rc info|35,reuters|35,ap news|35,la presse|35,nbc news|35,nextbike|36,nina|37,outlook mail|38,paypal|39,phone|40,plex|41,pocket|42,post & dhl|43,proton mail|44,reddit|45,sync pro|45,sync dev|45,boost|45,infinity|45,slide|45,signal|46,skype|47,slack|48,snapchat|49,starbucks|50,steam|51,teams|52,telegram|53,telegram foss|53,threema|54,tiktok|55,to do|56,opentasks|56,tasks|56,transit|57,twitch|58,twitter|59,uber|60,lyft|60,vlc|61,warnapp|62,whatsapp|63,wordfeud|64,youtube|65,newpipe|65,zoom|66,meet|66,music|67,sms message|0,mail|0,gmail|0,".match(new RegExp(`,${s}\\|(\\d+)`)) let match = ",default|0,airbnb|1,alarm|2,alarmclockreceiver|2,amazon shopping|3,bibel|4,bitwarden|5,1password|5,lastpass|5,dashlane|5,bring|6,calendar|7,etar|7,chat|8,chrome|9,clock|2,corona-warn|10,bmo|11,desjardins|11,rbc mobile|11,nbc|11,rabobank|11,scotiabank|11,td (canada)|11,discord|12,drive|13,element|14,facebook|15,messenger|16,firefox|17,firefox beta|17,firefox nightly|17,f-droid|5,neo store|5,aurora droid|5,github|18,gitlab|19,gmx|20,google|21,google home|22,google play store|23,home assistant|24,instagram|25,kalender|26,keep notes|27,lieferando|28,linkedin|29,maps|30,organic maps|30,osmand|30,mastodon|31,fedilab|31,tooot|31,tusky|31,mattermost|32,n26|33,netflix|34,news|35,cbc news|35,rc info|35,reuters|35,ap news|35,la presse|35,nbc news|35,nextbike|36,nina|37,outlook mail|38,paypal|39,phone|40,plex|41,pocket|42,post & dhl|43,proton mail|44,reddit|45,sync pro|45,sync dev|45,boost|45,infinity|45,slide|45,signal|46,skype|47,slack|48,snapchat|49,starbucks|50,steam|51,teams|52,telegram|53,telegram foss|53,threema|54,tiktok|55,to do|56,opentasks|56,tasks|56,transit|57,twitch|58,twitter|59,uber|60,lyft|60,vlc|61,warnapp|62,whatsapp|63,wordfeud|64,youtube|65,newpipe|65,zoom|66,meet|66,music|67,sms message|0,mail|0,gmail|0,".match(new RegExp(`,${s}\\|(\\d+)`))
return require("Storage").read("messageicons.img", (match===null)?0:match[1]*76, 76); return require("Storage").read("messageicons.img", (match===null)?0:match[1]*76, 76);
}; };

View File

@ -1,7 +1,7 @@
{ {
"id": "messageicons", "id": "messageicons",
"name": "Message Icons", "name": "Message Icons",
"version": "0.03", "version": "0.04",
"description": "Library containing a list of icons and colors for apps", "description": "Library containing a list of icons and colors for apps",
"icon": "app.png", "icon": "app.png",
"type": "module", "type": "module",