From: Lennart Poettering Date: Thu, 1 Feb 2024 10:14:24 +0000 (+0100) Subject: glyph-util: add colored circle glyphs X-Git-Tag: v256-rc1~893^2~4 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c80139f078f2915200c05bc626b4b14848beb99d;p=thirdparty%2Fsystemd.git glyph-util: add colored circle glyphs --- diff --git a/src/basic/glyph-util.c b/src/basic/glyph-util.c index 803bdd90e24..2cec3d82cf0 100644 --- a/src/basic/glyph-util.c +++ b/src/basic/glyph-util.c @@ -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"🔵", }, }; diff --git a/src/basic/glyph-util.h b/src/basic/glyph-util.h index a7709976e1d..e476fefe943 100644 --- a/src/basic/glyph-util.h +++ b/src/basic/glyph-util.h @@ -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; diff --git a/src/test/test-locale-util.c b/src/test/test-locale-util.c index 39f71c67d36..dd9a8134bf2 100644 --- a/src/test/test-locale-util.c +++ b/src/test/test-locale-util.c @@ -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);