|
|
ac3a84 |
From 008cc31066925ca8ef69ad6a03d20bb4ed299a41 Mon Sep 17 00:00:00 2001
|
|
|
ac3a84 |
From: Lennart Poettering <lennart@poettering.net>
|
|
|
ac3a84 |
Date: Fri, 2 Dec 2022 23:50:48 +0100
|
|
|
ac3a84 |
Subject: [PATCH] glyph-util: add warning sign special glyph
|
|
|
ac3a84 |
|
|
|
ac3a84 |
(cherry picked from commit 03c16b9784151275e71db3f9a25dc42206f1b5d3)
|
|
|
ac3a84 |
|
|
|
ac3a84 |
Related: #2138081
|
|
|
ac3a84 |
---
|
|
|
ac3a84 |
src/basic/glyph-util.c | 4 +++-
|
|
|
ac3a84 |
src/basic/glyph-util.h | 1 +
|
|
|
ac3a84 |
src/test/test-locale-util.c | 3 ++-
|
|
|
ac3a84 |
3 files changed, 6 insertions(+), 2 deletions(-)
|
|
|
ac3a84 |
|
|
|
ac3a84 |
diff --git a/src/basic/glyph-util.c b/src/basic/glyph-util.c
|
|
|
ac3a84 |
index 67f2270daf..de1224f04f 100644
|
|
|
ac3a84 |
--- a/src/basic/glyph-util.c
|
|
|
ac3a84 |
+++ b/src/basic/glyph-util.c
|
|
|
ac3a84 |
@@ -71,6 +71,7 @@ const char *special_glyph(SpecialGlyph code) {
|
|
|
ac3a84 |
[SPECIAL_GLYPH_RECYCLING] = "~",
|
|
|
ac3a84 |
[SPECIAL_GLYPH_DOWNLOAD] = "\\",
|
|
|
ac3a84 |
[SPECIAL_GLYPH_SPARKLES] = "*",
|
|
|
ac3a84 |
+ [SPECIAL_GLYPH_WARNING_SIGN] = "!",
|
|
|
ac3a84 |
},
|
|
|
ac3a84 |
|
|
|
ac3a84 |
/* UTF-8 */
|
|
|
ac3a84 |
@@ -124,10 +125,11 @@ const char *special_glyph(SpecialGlyph code) {
|
|
|
ac3a84 |
/* This emoji is a single character cell glyph in Unicode, and two in ASCII */
|
|
|
ac3a84 |
[SPECIAL_GLYPH_TOUCH] = u8"👆", /* actually called: BACKHAND INDEX POINTING UP */
|
|
|
ac3a84 |
|
|
|
ac3a84 |
- /* These three emojis are single character cell glyphs in Unicode and also in ASCII. */
|
|
|
ac3a84 |
+ /* These four emojis are single character cell glyphs in Unicode and also in ASCII. */
|
|
|
ac3a84 |
[SPECIAL_GLYPH_RECYCLING] = u8"♻️", /* actually called: UNIVERSAL RECYCLNG SYMBOL */
|
|
|
ac3a84 |
[SPECIAL_GLYPH_DOWNLOAD] = u8"⤵️", /* actually called: RIGHT ARROW CURVING DOWN */
|
|
|
ac3a84 |
[SPECIAL_GLYPH_SPARKLES] = u8"✨",
|
|
|
ac3a84 |
+ [SPECIAL_GLYPH_WARNING_SIGN] = u8"⚠️",
|
|
|
ac3a84 |
},
|
|
|
ac3a84 |
};
|
|
|
ac3a84 |
|
|
|
ac3a84 |
diff --git a/src/basic/glyph-util.h b/src/basic/glyph-util.h
|
|
|
ac3a84 |
index 621d7a85b7..b64639622e 100644
|
|
|
ac3a84 |
--- a/src/basic/glyph-util.h
|
|
|
ac3a84 |
+++ b/src/basic/glyph-util.h
|
|
|
ac3a84 |
@@ -44,6 +44,7 @@ typedef enum SpecialGlyph {
|
|
|
ac3a84 |
SPECIAL_GLYPH_RECYCLING,
|
|
|
ac3a84 |
SPECIAL_GLYPH_DOWNLOAD,
|
|
|
ac3a84 |
SPECIAL_GLYPH_SPARKLES,
|
|
|
ac3a84 |
+ SPECIAL_GLYPH_WARNING_SIGN,
|
|
|
ac3a84 |
_SPECIAL_GLYPH_MAX,
|
|
|
ac3a84 |
_SPECIAL_GLYPH_INVALID = -EINVAL,
|
|
|
ac3a84 |
} SpecialGlyph;
|
|
|
ac3a84 |
diff --git a/src/test/test-locale-util.c b/src/test/test-locale-util.c
|
|
|
ac3a84 |
index 9f50c6227f..f38100401c 100644
|
|
|
ac3a84 |
--- a/src/test/test-locale-util.c
|
|
|
ac3a84 |
+++ b/src/test/test-locale-util.c
|
|
|
ac3a84 |
@@ -83,7 +83,7 @@ TEST(keymaps) {
|
|
|
ac3a84 |
|
|
|
ac3a84 |
#define dump_glyph(x) log_info(STRINGIFY(x) ": %s", special_glyph(x))
|
|
|
ac3a84 |
TEST(dump_special_glyphs) {
|
|
|
ac3a84 |
- assert_cc(SPECIAL_GLYPH_SPARKLES + 1 == _SPECIAL_GLYPH_MAX);
|
|
|
ac3a84 |
+ assert_cc(SPECIAL_GLYPH_WARNING_SIGN + 1 == _SPECIAL_GLYPH_MAX);
|
|
|
ac3a84 |
|
|
|
ac3a84 |
log_info("is_locale_utf8: %s", yes_no(is_locale_utf8()));
|
|
|
ac3a84 |
|
|
|
ac3a84 |
@@ -120,6 +120,7 @@ TEST(dump_special_glyphs) {
|
|
|
ac3a84 |
dump_glyph(SPECIAL_GLYPH_RECYCLING);
|
|
|
ac3a84 |
dump_glyph(SPECIAL_GLYPH_DOWNLOAD);
|
|
|
ac3a84 |
dump_glyph(SPECIAL_GLYPH_SPARKLES);
|
|
|
ac3a84 |
+ dump_glyph(SPECIAL_GLYPH_WARNING_SIGN);
|
|
|
ac3a84 |
}
|
|
|
ac3a84 |
|
|
|
ac3a84 |
DEFINE_TEST_MAIN(LOG_INFO);
|