Add layout.rerender - so you set modified:true on any item that has changed, and it then automatically updates the layout for those and redraws anything that changed.
I guess that sounds ideal, but what if changing some text means the item changes size, so adjacent (non-modified) elements would have to move?
Make it so you specify the layout with the maximum amount of text you expect in any particular field
That might be a bit tricky with Vector fonts, as it depends on the actual characters.
I'd really like to see fitWidth/fitHeight being pulled across, maybe even implicit:
{type:"txt", font:"10%", label:"Vector:10%, automatic width" },
{type:"txt", width:"120", label:"Vector, fitted to be 120px width" },
{type:"txt", font:"10%", width:"120", label:"Vector:10%, cropped/padded to 120px" },
maybe .render should automatically clear the area regardless of bgCol
Or maybe make bgCol default to g.theme.bg when omitted, and you can set it explicitly to null/false to prevent clearing?
Another wishlist item: specify width and height in percentages (of whole screen).
{type:"txt", width:"50%", label:"Vector, fitted to 120px on Bangle.js 1" },
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
I guess that sounds ideal, but what if changing some text means the item changes size, so adjacent (non-modified) elements would have to move?
That might be a bit tricky with Vector fonts, as it depends on the actual characters.
I'd really like to see
fitWidth
/fitHeight
being pulled across, maybe even implicit:Or maybe make
bgCol
default tog.theme.bg
when omitted, and you can set it explicitly tonull
/false
to prevent clearing?Another wishlist item: specify
width
andheight
in percentages (of whole screen).