particle/string: use HORIZONTAL ELLIPSIS as truncation character

First, apply max-len to the converted wide character string, instead
of the UTF-8 string. This is better, and more correct, since UTF-8 is
multibyte, and applying max-len to that results in strings _shorter_
than max-len.

Second, use HORIZONTAL ELLIPSIS (…) instead of three regular
periods (...) as truncation character. This “saves” 2 characters.

To be able to do this, the conversion to a wide character, and glyph
rasterization is now done when the exposable is instantiated, instead
of in begin_expose().

Closes #73
This commit is contained in:
Daniel Eklöf 2021-07-19 12:27:20 +02:00
parent 71ecdb6789
commit 8187d60193
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
2 changed files with 137 additions and 132 deletions

View file

@ -30,6 +30,9 @@
* battery: differentiate "Not Charging" and "Discharging" in state
tag of battery module.
(https://codeberg.org/dnkl/yambar/issues/57).
* string: use HORIZONTAL ELLIPSIS instead of three regular periods
when truncating a string
(https://codeberg.org/dnkl/yambar/issues/73).
### Deprecated