[gtk+/gtk-3-22] entry: Consider input hints for Emoji support
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-3-22] entry: Consider input hints for Emoji support
- Date: Sat, 2 Sep 2017 12:49:02 +0000 (UTC)
commit 172c6c194949755672db747508918c9265e0d89f
Author: Matthias Clasen <mclasen redhat com>
Date: Sat Sep 2 08:42:52 2017 -0400
entry: Consider input hints for Emoji support
Don't show "insert emoji" in the context menu if input
hints indicate that Emoji input is not useful.
gtk/gtkentry.c | 20 ++++++++++++--------
1 files changed, 12 insertions(+), 8 deletions(-)
---
diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c
index 6c5a614..2ee6931 100644
--- a/gtk/gtkentry.c
+++ b/gtk/gtkentry.c
@@ -9576,14 +9576,18 @@ popup_targets_received (GtkClipboard *clipboard,
gtk_widget_show (menuitem);
gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
- menuitem = gtk_menu_item_new_with_mnemonic (_("Insert _Emoji"));
- gtk_widget_set_sensitive (menuitem,
- mode == DISPLAY_NORMAL &&
- info_entry_priv->editable);
- g_signal_connect_swapped (menuitem, "activate",
- G_CALLBACK (gtk_entry_choose_emoji), entry);
- gtk_widget_show (menuitem);
- gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
+ if (info_entry_priv->show_emoji_icon ||
+ (gtk_entry_get_input_hints (entry) & GTK_INPUT_HINT_NO_EMOJI) == 0)
+ {
+ menuitem = gtk_menu_item_new_with_mnemonic (_("Insert _Emoji"));
+ gtk_widget_set_sensitive (menuitem,
+ mode == DISPLAY_NORMAL &&
+ info_entry_priv->editable);
+ g_signal_connect_swapped (menuitem, "activate",
+ G_CALLBACK (gtk_entry_choose_emoji), entry);
+ gtk_widget_show (menuitem);
+ gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
+ }
g_signal_emit (entry, signals[POPULATE_POPUP], 0, menu);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]