[gtk+] Entry: Handle :show-emoji-icon becoming false



commit 896f7c8ac0346c6edf7029df133dcc911da4f2bb
Author: Daniel Boles <dboles src gnome org>
Date:   Mon Aug 28 20:35:47 2017 +0100

    Entry: Handle :show-emoji-icon becoming false
    
    Disconnect the now-unwanted signal handler, and hide the icon.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=786940

 gtk/gtkentry.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c
index 449ec5a..e5418f9 100644
--- a/gtk/gtkentry.c
+++ b/gtk/gtkentry.c
@@ -9889,6 +9889,14 @@ set_show_emoji_icon (GtkEntry *entry,
 
       g_signal_connect (entry, "icon-press", G_CALLBACK (pick_emoji), NULL);
     }
+  else
+    {
+      g_signal_handlers_disconnect_by_func (entry, pick_emoji, NULL);
+
+      gtk_entry_set_icon_from_icon_name (entry,
+                                         GTK_ENTRY_ICON_SECONDARY,
+                                         NULL);
+    }
 
   g_object_notify_by_pspec (G_OBJECT (entry), entry_props[PROP_SHOW_EMOJI_ICON]);
   gtk_widget_queue_resize (GTK_WIDGET (entry));


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]