messages 0.88: Adjust padding calculation so messages are spaced out properly even when using international fonts

master
Gordon Williams 2025-07-11 10:10:21 +01:00
parent ef5ae344d8
commit e95668da52
3 changed files with 5 additions and 4 deletions

View File

@ -117,3 +117,4 @@
Remove workaround for 2v10 (>3 years ago) - assume everyone is on never firmware now
0.86: Default to showing message scroller (with title, bigger icon)
0.87: Make choosing of font size more repeatable
0.88: Adjust padding calculation so messages are spaced out properly even when using international fonts

View File

@ -391,8 +391,6 @@ function showMessage(msgid, persist) {
}
}
lines = g.setFont(bodyFont).wrapString(body, w);
if (lines.length<3)
lines.unshift(""); // if less lines, pad them out a bit at the top!
}
let negHandler,posHandler,rowLeftDraw,rowRightDraw;
if (msg.negative) {
@ -432,12 +430,14 @@ function showMessage(msgid, persist) {
}
let fontHeight = g.setFont(bodyFont).getFontHeight();
let lineHeight = (fontHeight>25)?fontHeight:25;
if (title.includes("\n")) lineHeight=25; // ensure enough room for 2 lines of title in header
if (title.includes("\n") && lineHeight<25) lineHeight=25; // ensure enough room for 2 lines of title in header
let linesPerRow = 2;
if (fontHeight<17) {
lineHeight = 16;
linesPerRow = 3;
}
if ((lines.length+4.5)*lineHeight < Bangle.appRect.h)
lines.unshift(""); // if less lines, pad them out a bit at the top!
let rowHeight = lineHeight*linesPerRow;
let textLineOffset = -(linesPerRow + ((rowLeftDraw||rowRightDraw)?1:0));
let msgIcon = require("messageicons").getImage(msg);

View File

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