merge: branch 'wip/sadiq/qr-border'

libnmc-base/utils: Improve qr code bottom border

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1736
This commit is contained in:
Beniamino Galvani 2023-10-02 15:58:31 +00:00
commit e85b76b736

View file

@ -712,6 +712,9 @@ nmc_print_qrcode(const char *str)
bool bottom = qrcodegen_getModule(qrcode, x, y + 1);
if (top) {
g_print(bottom ? " " : "\u2584");
} else if (y > size) {
/* Print the last line (the bottom QR border) in light gray, no bg color */
g_print("\033[0;37m\u2580");
} else {
g_print(bottom ? "\u2580" : "\u2588");
}