@@ -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 */
647648Bangle . on ( 'lock' , locked => {
648649 if ( ! locked )
649650 require ( "messages" ) . stopBuzz ( ) ;
650- } ) ;
651+ } ) ;
0 commit comments