diff options
author | Robert Tari <robert@tari.in> | 2022-07-06 14:05:55 +0200 |
---|---|---|
committer | Robert Tari <robert@tari.in> | 2022-07-06 14:05:55 +0200 |
commit | 9873f1f72180e71066e3fe1f5669b6cee67a18e9 (patch) | |
tree | bd69768e72fca8c0e6be32951922925169447d7f | |
parent | 97fb737a51edcb3282d743073109aa0e721aa350 (diff) | |
parent | 1221d55f3c1dca07b5cdae48c80790567d1d3047 (diff) | |
download | ayatana-indicator-keyboard-9873f1f72180e71066e3fe1f5669b6cee67a18e9.tar.gz ayatana-indicator-keyboard-9873f1f72180e71066e3fe1f5669b6cee67a18e9.tar.bz2 ayatana-indicator-keyboard-9873f1f72180e71066e3fe1f5669b6cee67a18e9.zip |
Merge branch 'sunweaver-pr/input-keyboard-icon'
Attributes GH PR #37: https://github.com/AyatanaIndicators/ayatana-indicator-keyboard/pull/37
-rw-r--r-- | src/service.c | 22 |
1 files changed, 16 insertions, 6 deletions
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) |