mirror of https://github.com/espruino/BangleApps
messages 0.16: Fix text wrapping so it fits the screen even if title is big (fix #1147)
parent
c06afa1132
commit
128f2d4e66
|
@ -77,7 +77,7 @@
|
|||
{
|
||||
"id": "messages",
|
||||
"name": "Messages",
|
||||
"version": "0.15",
|
||||
"version": "0.16",
|
||||
"description": "App to display notifications from iOS and Gadgetbridge",
|
||||
"icon": "app.png",
|
||||
"type": "app",
|
||||
|
|
|
@ -22,3 +22,4 @@
|
|||
Now update correctly when 'require("messages").clearAll()' is called
|
||||
0.14: Hide widget when all unread notifications are dismissed from phone
|
||||
0.15: Don't buzz when Quiet Mode is active
|
||||
0.16: Fix text wrapping so it fits the screen even if title is big (fix #1147)
|
||||
|
|
|
@ -243,7 +243,8 @@ function showMessage(msgid) {
|
|||
checkMessages({clockIfNoMsg:1,clockIfAllRead:1,showMsgIfUnread:1});
|
||||
}});
|
||||
}
|
||||
lines = g.wrapString(msg.body, g.getWidth()-10);
|
||||
var bodyFont = fontMedium;
|
||||
lines = g.setFont(bodyFont).wrapString(msg.body, g.getWidth()-10);
|
||||
var body = (lines.length>4) ? lines.slice(0,4).join("\n")+"..." : lines.join("\n");
|
||||
layout = new Layout({ type:"v", c: [
|
||||
{type:"h", fillx:1, bgCol:colBg, c: [
|
||||
|
@ -256,7 +257,7 @@ function showMessage(msgid) {
|
|||
title?{type:"txt", font:titleFont, label:title, bgCol:colBg, fillx:1, pad:2 }:{},
|
||||
]},
|
||||
]},
|
||||
{type:"txt", font:fontMedium, label:body, fillx:1, filly:1, pad:2 },
|
||||
{type:"txt", font:bodyFont, label:body, fillx:1, filly:1, pad:2 },
|
||||
{type:"h",fillx:1, c: buttons}
|
||||
]});
|
||||
g.clearRect(Bangle.appRect);
|
||||
|
|
Loading…
Reference in New Issue