]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
glyph-util: add colored circle glyphs
authorLennart Poettering <lennart@poettering.net>
Thu, 1 Feb 2024 10:14:24 +0000 (11:14 +0100)
committerLennart Poettering <lennart@poettering.net>
Fri, 9 Feb 2024 17:27:01 +0000 (18:27 +0100)
src/basic/glyph-util.c
src/basic/glyph-util.h
src/test/test-locale-util.c

index 803bdd90e24e3250b7c4fc607b1ca1c36ace1720..2cec3d82cf0b140d06e164d043e7d58c3b54cd7d 100644 (file)
@@ -74,6 +74,9 @@ const char *special_glyph_full(SpecialGlyph code, bool force_utf) {
                         [SPECIAL_GLYPH_SPARKLES]                = "*",
                         [SPECIAL_GLYPH_LOW_BATTERY]             = "!",
                         [SPECIAL_GLYPH_WARNING_SIGN]            = "!",
+                        [SPECIAL_GLYPH_RED_CIRCLE]              = "o",
+                        [SPECIAL_GLYPH_YELLOW_CIRCLE]           = "o",
+                        [SPECIAL_GLYPH_BLUE_CIRCLE]             = "o",
                 },
 
                 /* UTF-8 */
@@ -136,6 +139,10 @@ const char *special_glyph_full(SpecialGlyph code, bool force_utf) {
                         [SPECIAL_GLYPH_WARNING_SIGN]            = u8"⚠️",
                         [SPECIAL_GLYPH_COMPUTER_DISK]           = u8"💽",
                         [SPECIAL_GLYPH_WORLD]                   = u8"🌍",
+
+                        [SPECIAL_GLYPH_RED_CIRCLE]              = u8"🔴",
+                        [SPECIAL_GLYPH_YELLOW_CIRCLE]           = u8"🟡",
+                        [SPECIAL_GLYPH_BLUE_CIRCLE]             = u8"🔵",
                 },
         };
 
index a7709976e1d422b4e01d8a902a0ed2d4aa804615..e476fefe943c5bbf1c575da25d6fa0b46785a209 100644 (file)
@@ -49,6 +49,9 @@ typedef enum SpecialGlyph {
         SPECIAL_GLYPH_WARNING_SIGN,
         SPECIAL_GLYPH_COMPUTER_DISK,
         SPECIAL_GLYPH_WORLD,
+        SPECIAL_GLYPH_RED_CIRCLE,
+        SPECIAL_GLYPH_YELLOW_CIRCLE,
+        SPECIAL_GLYPH_BLUE_CIRCLE,
         _SPECIAL_GLYPH_MAX,
         _SPECIAL_GLYPH_INVALID = -EINVAL,
 } SpecialGlyph;
index 39f71c67d369113b9bfea505c3014629d52ec248..dd9a8134bf2e5ca0730c14e6659acac0be83946c 100644 (file)
@@ -82,7 +82,7 @@ TEST(keymaps) {
 
 #define dump_glyph(x) log_info(STRINGIFY(x) ": %s", special_glyph(x))
 TEST(dump_special_glyphs) {
-        assert_cc(SPECIAL_GLYPH_WORLD + 1 == _SPECIAL_GLYPH_MAX);
+        assert_cc(SPECIAL_GLYPH_BLUE_CIRCLE + 1 == _SPECIAL_GLYPH_MAX);
 
         log_info("is_locale_utf8: %s", yes_no(is_locale_utf8()));
 
@@ -127,6 +127,9 @@ TEST(dump_special_glyphs) {
         dump_glyph(SPECIAL_GLYPH_WARNING_SIGN);
         dump_glyph(SPECIAL_GLYPH_COMPUTER_DISK);
         dump_glyph(SPECIAL_GLYPH_WORLD);
+        dump_glyph(SPECIAL_GLYPH_RED_CIRCLE);
+        dump_glyph(SPECIAL_GLYPH_YELLOW_CIRCLE);
+        dump_glyph(SPECIAL_GLYPH_BLUE_CIRCLE);
 }
 
 DEFINE_TEST_MAIN(LOG_INFO);