[gtk/matthiasc/for-master: 2/7] text: Avoid clash of preedit and placeholder
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/matthiasc/for-master: 2/7] text: Avoid clash of preedit and placeholder
- Date: Fri, 22 May 2020 16:27:43 +0000 (UTC)
commit 01df1334011c50bc64c5f88cdb11f96cd5ba1801
Author: Matthias Clasen <mclasen redhat com>
Date: Thu May 21 22:42:53 2020 -0400
text: Avoid clash of preedit and placeholder
Take preedit into account when determining the
visibility of placeholder text.
gtk/gtktext.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtktext.c b/gtk/gtktext.c
index d60e036208..cb655e0d48 100644
--- a/gtk/gtktext.c
+++ b/gtk/gtktext.c
@@ -3488,6 +3488,7 @@ update_placeholder_visibility (GtkText *self)
if (priv->placeholder)
gtk_widget_set_child_visible (priv->placeholder,
+ priv->preedit_length == 0 &&
gtk_entry_buffer_get_length (priv->buffer) == 0);
}
@@ -4150,7 +4151,7 @@ gtk_text_commit_cb (GtkIMContext *context,
}
}
-static void
+static void
gtk_text_preedit_changed_cb (GtkIMContext *context,
GtkText *self)
{
@@ -4171,8 +4172,9 @@ gtk_text_preedit_changed_cb (GtkIMContext *context,
cursor_pos = CLAMP (cursor_pos, 0, g_utf8_strlen (preedit_string, -1));
priv->preedit_cursor = cursor_pos;
g_free (preedit_string);
-
+
gtk_text_recompute (self);
+ update_placeholder_visibility (self);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]