messages 0.88: Adjust padding calculation so messages are spaced out properly even when using international fonts
parent
ef5ae344d8
commit
e95668da52
|
|
@ -117,3 +117,4 @@
|
||||||
Remove workaround for 2v10 (>3 years ago) - assume everyone is on never firmware now
|
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.86: Default to showing message scroller (with title, bigger icon)
|
||||||
0.87: Make choosing of font size more repeatable
|
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
|
||||||
|
|
@ -391,8 +391,6 @@ function showMessage(msgid, persist) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
lines = g.setFont(bodyFont).wrapString(body, w);
|
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;
|
let negHandler,posHandler,rowLeftDraw,rowRightDraw;
|
||||||
if (msg.negative) {
|
if (msg.negative) {
|
||||||
|
|
@ -432,12 +430,14 @@ function showMessage(msgid, persist) {
|
||||||
}
|
}
|
||||||
let fontHeight = g.setFont(bodyFont).getFontHeight();
|
let fontHeight = g.setFont(bodyFont).getFontHeight();
|
||||||
let lineHeight = (fontHeight>25)?fontHeight:25;
|
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;
|
let linesPerRow = 2;
|
||||||
if (fontHeight<17) {
|
if (fontHeight<17) {
|
||||||
lineHeight = 16;
|
lineHeight = 16;
|
||||||
linesPerRow = 3;
|
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 rowHeight = lineHeight*linesPerRow;
|
||||||
let textLineOffset = -(linesPerRow + ((rowLeftDraw||rowRightDraw)?1:0));
|
let textLineOffset = -(linesPerRow + ((rowLeftDraw||rowRightDraw)?1:0));
|
||||||
let msgIcon = require("messageicons").getImage(msg);
|
let msgIcon = require("messageicons").getImage(msg);
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
"id": "messagegui",
|
"id": "messagegui",
|
||||||
"name": "Message UI",
|
"name": "Message UI",
|
||||||
"shortName": "Messages",
|
"shortName": "Messages",
|
||||||
"version": "0.87",
|
"version": "0.88",
|
||||||
"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",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue