Skip to content

Commit e05b80d

Browse files
committed
messages 0.87: Make choosing of font size more repeatable
1 parent 15ddeaa commit e05b80d

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

apps/messagegui/ChangeLog

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,4 +115,5 @@
115115
0.84: Fix: Assign show message entry to the settings menu and not the message itself.
116116
0.85: Use new Rebble fonts if available
117117
Remove workaround for 2v10 (>3 years ago) - assume everyone is on never firmware now
118-
0.86: Default to showing message scroller (with title, bigger icon)
118+
0.86: Default to showing message scroller (with title, bigger icon)
119+
0.87: Make choosing of font size more repeatable

apps/messagegui/app.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,9 @@ function showMessage(msgid, persist) {
355355
cancelReloadTimeout(); // don't auto-reload to clock now
356356
return showMapMessage(msg);
357357
}
358+
// remove widgets here as we need to check the height when choosing a font
359+
Bangle.setUI(); // force last UI to be removed (will call require("widget_utils").show(); if last displaying a message)
360+
if (!settings.showWidgets) require("widget_utils").hide();
358361
active = "message";
359362
// Normal text message display
360363
let src=msg.src||/*LANG*/"Message", srcFont = fontSmall;
@@ -380,7 +383,7 @@ function showMessage(msgid, persist) {
380383
}
381384
}
382385
if (body) { // Try and find a font that fits...
383-
let w = g.getWidth()-2, h = Bangle.appRect.h-60;
386+
let w = g.getWidth()-2, h = Bangle.appRect.h-80;
384387
if (g.setFont(bodyFont).wrapString(body, w).length*g.getFontHeight() > h) {
385388
bodyFont = fontBig;
386389
if (settings.fontSize!=1 && g.setFont(bodyFont).wrapString(body, w).length*g.getFontHeight() > h) {
@@ -439,8 +442,6 @@ function showMessage(msgid, persist) {
439442
let textLineOffset = -(linesPerRow + ((rowLeftDraw||rowRightDraw)?1:0));
440443
let msgIcon = require("messageicons").getImage(msg);
441444
let msgCol = require("messageicons").getColor(msg, {settings, default:g.theme.fg2});
442-
Bangle.setUI(); // force last UI to be removed (will call require("widget_utils").show(); if last displaying a message)
443-
if (!settings.showWidgets) require("widget_utils").hide();
444445
let scroller = E.showScroller({
445446
h : rowHeight, // height of each menu item in pixels
446447
c : Math.ceil((lines.length-textLineOffset) / linesPerRow), // number of menu items
@@ -647,4 +648,4 @@ as a queue to stop repeated buzzing */
647648
Bangle.on('lock',locked => {
648649
if (!locked)
649650
require("messages").stopBuzz();
650-
});
651+
});

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.86",
5+
"version": "0.87",
66
"description": "Default app to display notifications from iOS and Gadgetbridge/Android",
77
"icon": "app.png",
88
"type": "app",

0 commit comments

Comments
 (0)