From 02022c17212357afb5cec727edd8f095aa40d98d Mon Sep 17 00:00:00 2001 From: Daiki Ueno Date: Thu, 29 Sep 2011 10:17:28 +0900 Subject: [PATCH 2/4] Hide status from the panel if status == title. --- src/engine.c | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/src/engine.c b/src/engine.c index 4c7411c..efbce66 100644 --- a/src/engine.c +++ b/src/engine.c @@ -35,6 +35,7 @@ struct _IBusM17NEngineClass { gint preedit_underline; gint lookup_table_orientation; + gchar *title; MInputMethod *im; }; @@ -244,6 +245,10 @@ ibus_m17n_engine_class_init (IBusM17NEngineClass *klass) } engine_name = g_strdup_printf ("m17n:%s:%s", lang, name); klass->config_section = g_strdup_printf ("engine/M17N/%s/%s", lang, name); + MPlist *l = minput_get_title_icon (msymbol (lang), msymbol (name)); + if (l && mplist_key (l) == Mtext) { + klass->title = ibus_m17n_mtext_to_utf8 (mplist_value (l)); + } g_free (lang); g_free (name); @@ -895,8 +900,9 @@ ibus_m17n_engine_callback (MInputContext *context, else if (command == Minput_status_draw) { gchar *status; status = ibus_m17n_mtext_to_utf8 (m17n->context->status); + IBusM17NEngineClass *klass = (IBusM17NEngineClass *) G_OBJECT_GET_CLASS (m17n); - if (status && strlen (status)) { + if (status && strlen (status) && g_strcmp0 (status, klass->title)) { IBusText *text; text = ibus_text_new_from_string (status); ibus_property_set_label (m17n->status_prop, text); -- 1.7.7.6