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
parent
83bedcdb57
commit
04f3475dff
|
|
@ -171,6 +171,7 @@ let clockInfoMenu = clock_info.addInteractive(clockInfoItems, {
|
|||
strWidth = g.stringWidth(text);
|
||||
if (strWidth+imgWidthClear > options.w) {
|
||||
g.setMiniFont();
|
||||
text = g.wrapString(text, options.w-imgWidthClear).join("\n");
|
||||
strWidth = g.stringWidth(text);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue