~ubuntu-branches/debian/sid/ibus/sid

« back to all changes in this revision

Viewing changes to ui/gtk3/switcher.vala

  • Committer: Package Import Robot
  • Author(s): Osamu Aoki, Aron Xu, Osamu Aoki
  • Date: 2014-08-04 22:42:19 UTC
  • mfrom: (1.5.7)
  • Revision ID: package-import@ubuntu.com-20140804224219-mjprlql1jdwi5sxm
Tags: 1.5.8-1
[ Aron Xu ]
* Allow parallel building

[ Osamu Aoki ]
* Update ibus document with Qt5 support

[ Aron Xu ]
* Imported Upstream version 1.5.8
* Remove patch for chasing HEAD, imported new upstream release
* Remove the patch for updating IBusKeymap jp, applied upstream
* Drop gtk2 version of the password patch because it's never executed
* Drop ibus-541492-xkb.patch
* Drop ibus-530711-preload-sys.patch
* Drop ibus-810211-no-switch-by-no-trigger.patch
* Drop 999-update-po.patch

[ Osamu Aoki ]
* linux-any for ibus-wayland
* Remove some symbols matching ibus-541492-xkb.patch
* Remove old patch for GTK+ 3.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
 
30
30
            this.longname = engine.get_longname();
31
31
 
32
 
            Gtk.Alignment align = new Gtk.Alignment(0.5f, 0.5f, 0.0f, 0.0f);
33
 
            add(align);
34
 
 
35
32
            var name = engine.get_name();
36
33
 
37
34
            if (name.length < 4 || name[0:4] != "xkb:") {
38
35
                IconWidget icon = new IconWidget(engine.get_icon(),
39
36
                                                 Gtk.IconSize.DIALOG);
40
 
                align.add(icon);
 
37
                icon.set_halign(Gtk.Align.CENTER);
 
38
                icon.set_valign(Gtk.Align.CENTER);
 
39
                add(icon);
41
40
            } else {
42
41
                var symbol = switcher.get_xkb_symbol(engine);
43
42
 
44
43
                Gtk.Label label = new Gtk.Label(symbol);
 
44
                label.set_halign(Gtk.Align.CENTER);
 
45
                label.set_valign(Gtk.Align.CENTER);
45
46
                string symbol_font = "Monospace Bold 16";
46
47
                string markup = "<span font=\"%s\">%s</span>".
47
48
                        printf(symbol_font, symbol);
54
55
                                     out fixed_height);
55
56
                label.set_size_request(fixed_width, fixed_height);
56
57
 
57
 
                align.add(label);
 
58
                add(label);
58
59
            }
59
60
        }
60
61
 
104
105
        );
105
106
        Gtk.Box vbox = new Gtk.Box(Gtk.Orientation.VERTICAL, 0);
106
107
        add(vbox);
107
 
        Gtk.Alignment align = new Gtk.Alignment(0.5f, 0.5f, 0.0f, 0.0f);
108
 
        vbox.pack_start(align, true, true, 0);
109
108
        m_box = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 0);
110
 
        align.add(m_box);
 
109
        m_box.set_halign(Gtk.Align.CENTER);
 
110
        m_box.set_valign(Gtk.Align.CENTER);
 
111
        vbox.pack_start(m_box, true, true, 0);
111
112
        m_label = new Gtk.Label("");
112
113
 
113
114
        /* Set the accessible role of the label to a status bar so it
117
118
        Atk.Object obj = m_label.get_accessible();
118
119
        obj.set_role (Atk.Role.STATUSBAR);
119
120
 
 
121
        /* Use Gtk.Widget.set_margin_start() and
 
122
         * Gtk.Widget.set_margin_top() since gtk 3.12 */
120
123
        m_label.set_padding(3, 3);
121
124
        vbox.pack_end(m_label, false, false, 0);
122
125
 
141
144
        /* Let gtk recalculate the window size. */
142
145
        resize(1, 1);
143
146
 
144
 
        m_result = 0;
145
147
        m_selected_engine = index;
146
148
        m_label.set_text(m_buttons[index].longname);
147
149
        m_buttons[index].grab_focus();
388
390
                    break;
389
391
                default:
390
392
                    debug("0x%04x", pe.keyval);
391
 
                    if (m_loop != null) {
392
 
                        m_loop.quit();
393
 
                        m_loop = null;
394
 
                    }
395
 
                    retval = false;
396
393
                    break;
397
394
            }
398
395
        } while (false);