summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfujiwarat <takao.fujiwara1@gmail.com>2014-05-09 11:40:21 +0900
committerfujiwarat <takao.fujiwara1@gmail.com>2014-05-09 11:40:21 +0900
commit34692850bd58543e016e35ea7c863d311ca92519 (patch)
tree62ce608a28be08c2a4a8ff9f628c7b62f38c1889
parent386bafb0b91a61d51385e0bba2b3fc4b1e2d9013 (diff)
Let ibus-ui-gtk3 not to show zero-lenght preedit text.
preedit text is shown by ibus-ui-gtk3 on X11 applications and do not have to show it likes GTK+ when the lenght is zero. BUG=http://code.google.com/p/ibus/issues/detail?id=1709 TEST=ibus-ui-gtk3 with ibus-pinyin and x11 applications Review URL: https://codereview.appspot.com/93150043
-rw-r--r--ui/gtk3/candidatepanel.vala11
1 files changed, 9 insertions, 2 deletions
diff --git a/ui/gtk3/candidatepanel.vala b/ui/gtk3/candidatepanel.vala
index e22135b1..db2d5aa7 100644
--- a/ui/gtk3/candidatepanel.vala
+++ b/ui/gtk3/candidatepanel.vala
@@ -112,8 +112,15 @@ public class CandidatePanel : Gtk.Box{
public void set_preedit_text(IBus.Text? text, uint cursor) {
if (text != null) {
- m_preedit_label.set_text(text.get_text());
- m_preedit_label.show();
+ var str = text.get_text();
+
+ if (str.length > 0) {
+ m_preedit_label.set_text(str);
+ m_preedit_label.show();
+ } else {
+ m_preedit_label.set_text("");
+ m_preedit_label.hide();
+ }
} else {
m_preedit_label.set_text("");
m_preedit_label.hide();