From 54be1fe46eac36e5a3eda8823f5c18af9d75eaee Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Tue, 5 Jul 2022 22:04:08 +0200 Subject: src/service.c: Use 'input-keyboard' (symbolic) icon as indicator icon on Lomiri. --- src/service.c | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/service.c b/src/service.c index 73f61065..498b0996 100644 --- a/src/service.c +++ b/src/service.c @@ -23,6 +23,8 @@ #define BUS_NAME "org.ayatana.indicator.keyboard" #define BUS_PATH "/org/ayatana/indicator/keyboard" +#define ICON_DEFAULT "input-keyboard" + static guint m_nSignal = 0; static void *m_pLibHandle = NULL; static Keyboard* (*m_fnKeyboardNew)(); @@ -87,14 +89,22 @@ static GVariant* createHeaderState(IndicatorKeyboardService *self) g_variant_builder_add(&cBuilder, "{sv}", "title", g_variant_new_string(_("Keyboard"))); g_variant_builder_add(&cBuilder, "{sv}", "visible", g_variant_new_boolean(TRUE)); - gchar *sLanguage; - m_fnKeyboardGetLayout(self->pPrivate->pKeyboard, -1, &sLanguage, NULL); + GIcon *pIcon = NULL; + if (ayatana_common_utils_is_lomiri()) { + pIcon = g_themed_icon_new_with_default_fallbacks(ICON_DEFAULT); + } + else + { + gchar *sLanguage; + m_fnKeyboardGetLayout(self->pPrivate->pKeyboard, -1, &sLanguage, NULL); + + gchar *sIcon = g_strconcat("ayatana-indicator-keyboard-", sLanguage, NULL); + g_free(sLanguage); - gchar *sIcon = g_strconcat("ayatana-indicator-keyboard-", sLanguage, NULL); - g_free(sLanguage); + pIcon = g_themed_icon_new_with_default_fallbacks(sIcon); + g_free(sIcon); + } - GIcon *pIcon = g_themed_icon_new_with_default_fallbacks(sIcon); - g_free(sIcon); g_variant_builder_add(&cBuilder, "{sv}", "accessible-desc", g_variant_new_string(_("Current keyboard layout"))); if (pIcon) -- cgit v1.2.3