diff options
author | fujiwarat <takao.fujiwara1@gmail.com> | 2012-03-19 16:20:55 +0900 |
---|---|---|
committer | fujiwarat <takao.fujiwara1@gmail.com> | 2012-03-19 16:20:55 +0900 |
commit | 942718e3a3177c33be2b04cf526c20be4ed227f6 (patch) | |
tree | daa0946b89be9f2ab0c11eeb501c04c3b3676865 | |
parent | 69902696928e6acb953ab30b1f70e462b5994272 (diff) | |
download | ibus-942718e3a3177c33be2b04cf526c20be4ed227f6.tar.gz |
Show language id on ibus-ui-gtk3.switcher window.
BUG=RH#803177
TEST=Linux desktop
Review URL: https://codereview.appspot.com/5843059
-rw-r--r-- | ui/gtk3/switcher.vala | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/ui/gtk3/switcher.vala b/ui/gtk3/switcher.vala index 131cad52..73b58d2f 100644 --- a/ui/gtk3/switcher.vala +++ b/ui/gtk3/switcher.vala @@ -155,9 +155,22 @@ class Switcher : Gtk.Window { for (int i = 0; i < m_engines.length; i++) { var index = i; var engine = m_engines[i]; - var button = new Gtk.Button.with_label(engine.get_longname()); + var longname = engine.get_longname(); + var language = engine.get_language(); + var symbol = engine.get_symbol(); + var id = language; + + if (id.length > 2) { + id = id[0:2]; + } + if (symbol.length != 0) { + id = symbol; + } + var label = "%-15s %s".printf(longname, id); + var button = new Gtk.Button.with_label(label); button.set_image(new IconWidget(engine.get_icon(), width)); button.set_relief(Gtk.ReliefStyle.NONE); + button.set_alignment(1.0f, 0.0f); button.show(); button.enter_notify_event.connect((e) => { |