bwclk: Wrap one-line clockinfo text.

Previously, one line of text would use a large font if the text
fits in the clock info space, and a smaller text if the one line
is too long to fit when large.  This commit also adds string
wrapping to those long lines, so more of the line can be shown.
Note wrapping is only applied when the text starts as one line; any
text with more than one line is left unwrapped, meaning some text
may extend outside of the clockinfo area.
master
Randy Heydon 2025-05-13 21:11:26 -04:00
parent 83bedcdb57
commit 04f3475dff
1 changed files with 1 additions and 0 deletions

View File

@ -171,6 +171,7 @@ let clockInfoMenu = clock_info.addInteractive(clockInfoItems, {
strWidth = g.stringWidth(text); strWidth = g.stringWidth(text);
if (strWidth+imgWidthClear > options.w) { if (strWidth+imgWidthClear > options.w) {
g.setMiniFont(); g.setMiniFont();
text = g.wrapString(text, options.w-imgWidthClear).join("\n");
strWidth = g.stringWidth(text); strWidth = g.stringWidth(text);
} }
} }