summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBeniamino Galvani <bgalvani@redhat.com>2023-10-02 15:58:31 +0000
committerBeniamino Galvani <bgalvani@redhat.com>2023-10-02 15:58:31 +0000
commite85b76b736243161874bc2dbcf22f897623e26c9 (patch)
tree2dc376a3fdb7c17a7a02dfa15527a90aa9322606
parent9820e791d1ddf64b5b495cda7c12c81fd77ff5dd (diff)
parentd9b06a95c91a46aea531ae14d039e33ceb83c282 (diff)
merge: branch 'wip/sadiq/qr-border'
libnmc-base/utils: Improve qr code bottom border https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1736
-rw-r--r--src/libnmc-base/nm-client-utils.c3
1 files changed, 3 insertions, 0 deletions
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");
}