From d9b06a95c91a46aea531ae14d039e33ceb83c282 Mon Sep 17 00:00:00 2001 From: Mohammed Sadiq Date: Thu, 21 Sep 2023 16:33:47 +0530 Subject: [PATCH] libnmc-base/utils: Improve qr code bottom border The bottom border of the generated QR code had a different thickness compared to other borders. Improve it by using Upper Half Block so that all borders have similar thickness. --- src/libnmc-base/nm-client-utils.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/libnmc-base/nm-client-utils.c b/src/libnmc-base/nm-client-utils.c index 4ce1ac6c88..b052a307fd 100644 --- a/src/libnmc-base/nm-client-utils.c +++ b/src/libnmc-base/nm-client-utils.c @@ -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"); }