summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChoe Hwanjin <choe.hwanjin@gmail.com>2014-07-30 00:28:54 +0900
committerChoe Hwanjin <choe.hwanjin@gmail.com>2014-07-30 00:28:54 +0900
commitb68ce4f30e7a566bd3b7d53c306ffe740ee2a790 (patch)
treebf2caed1845245a55b8ce18d833409001605c599
parent11224b52477d93e773ffd302fed11996401804f7 (diff)
downloadibus-hangul-b68ce4f30e7a566bd3b7d53c306ffe740ee2a790.tar.gz
Rename "hangul_mode" property to "InputMode".
And Add symbol to InputMode property. This will show InputMode status on gnome-shell.
-rw-r--r--src/engine.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/engine.c b/src/engine.c
index 161f041..9012c22 100644
--- a/src/engine.c
+++ b/src/engine.c
@@ -349,6 +349,7 @@ ibus_hangul_engine_init (IBusHangulEngine *hangul)
IBusProperty* prop;
IBusText* label;
IBusText* tooltip;
+ IBusText* symbol;
hangul->context = hangul_ic_new (hangul_keyboard->str);
hangul_ic_connect_callback (hangul->context, "transition",
@@ -365,12 +366,14 @@ ibus_hangul_engine_init (IBusHangulEngine *hangul)
label = ibus_text_new_from_string (_("Hangul mode"));
tooltip = ibus_text_new_from_string (_("Enable/Disable Hangul mode"));
- prop = ibus_property_new ("hangul_mode",
+ symbol = ibus_text_new_from_string ("한");
+ prop = ibus_property_new ("InputMode",
PROP_TYPE_TOGGLE,
label,
NULL,
tooltip,
TRUE, TRUE, PROP_STATE_UNCHECKED, NULL);
+ ibus_property_set_symbol(prop, symbol);
g_object_ref_sink (prop);
ibus_prop_list_append (hangul->prop_list, prop);
hangul->prop_hangul_mode = prop;
@@ -978,9 +981,15 @@ ibus_hangul_engine_process_key_event (IBusEngine *engine,
hangul->hangul_mode = !hangul->hangul_mode;
if (hangul->hangul_mode) {
+ IBusText* symbol;
+ symbol = ibus_text_new_from_string ("한");
+ ibus_property_set_symbol(hangul->prop_hangul_mode, symbol);
ibus_property_set_state (hangul->prop_hangul_mode,
PROP_STATE_CHECKED);
} else {
+ IBusText* symbol;
+ symbol = ibus_text_new_from_string ("A");
+ ibus_property_set_symbol(hangul->prop_hangul_mode, symbol);
ibus_property_set_state (hangul->prop_hangul_mode,
PROP_STATE_UNCHECKED);
}