Skip to content

Commit e95668d

Browse files
committed
messages 0.88: Adjust padding calculation so messages are spaced out properly even when using international fonts
1 parent ef5ae34 commit e95668d

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

apps/messagegui/ChangeLog

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,3 +117,4 @@
117117
Remove workaround for 2v10 (>3 years ago) - assume everyone is on never firmware now
118118
0.86: Default to showing message scroller (with title, bigger icon)
119119
0.87: Make choosing of font size more repeatable
120+
0.88: Adjust padding calculation so messages are spaced out properly even when using international fonts

apps/messagegui/app.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -391,8 +391,6 @@ function showMessage(msgid, persist) {
391391
}
392392
}
393393
lines = g.setFont(bodyFont).wrapString(body, w);
394-
if (lines.length<3)
395-
lines.unshift(""); // if less lines, pad them out a bit at the top!
396394
}
397395
let negHandler,posHandler,rowLeftDraw,rowRightDraw;
398396
if (msg.negative) {
@@ -432,12 +430,14 @@ function showMessage(msgid, persist) {
432430
}
433431
let fontHeight = g.setFont(bodyFont).getFontHeight();
434432
let lineHeight = (fontHeight>25)?fontHeight:25;
435-
if (title.includes("\n")) lineHeight=25; // ensure enough room for 2 lines of title in header
433+
if (title.includes("\n") && lineHeight<25) lineHeight=25; // ensure enough room for 2 lines of title in header
436434
let linesPerRow = 2;
437435
if (fontHeight<17) {
438436
lineHeight = 16;
439437
linesPerRow = 3;
440438
}
439+
if ((lines.length+4.5)*lineHeight < Bangle.appRect.h)
440+
lines.unshift(""); // if less lines, pad them out a bit at the top!
441441
let rowHeight = lineHeight*linesPerRow;
442442
let textLineOffset = -(linesPerRow + ((rowLeftDraw||rowRightDraw)?1:0));
443443
let msgIcon = require("messageicons").getImage(msg);

apps/messagegui/metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"id": "messagegui",
33
"name": "Message UI",
44
"shortName": "Messages",
5-
"version": "0.87",
5+
"version": "0.88",
66
"description": "Default app to display notifications from iOS and Gadgetbridge/Android",
77
"icon": "app.png",
88
"type": "app",

0 commit comments

Comments
 (0)