Show language id on ibus-ui-gtk3.switcher window.
authorfujiwarat <takao.fujiwara1@gmail.com>
Mon, 19 Mar 2012 07:20:55 +0000 (16:20 +0900)
committerfujiwarat <takao.fujiwara1@gmail.com>
Mon, 19 Mar 2012 07:20:55 +0000 (16:20 +0900)
BUG=RH#803177
TEST=Linux desktop

Review URL: https://codereview.appspot.com/5843059

ui/gtk3/switcher.vala

index 131cad5294ea59fe51124451c9ebe511fe99855d..73b58d2fbb420367b26db3e605697ad99f6976b0 100644 (file)
@@ -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) => {