[gtk/wip/dboles/entry-icon-empty-size-3: 4/4] Entry: Emit notify::pixbuf whenever icon's cleared



commit 307d0ce8669c562d4b978dd7495efd544bbd5c78
Author: Daniel Boles <dboles src gmail com>
Date:   Sat Dec 15 16:45:34 2018 +0000

    Entry: Emit notify::pixbuf whenever icon's cleared
    
    not just if it was specifically using pixbuf storage type, since the
    getter works for any storage type, so in any case when we had storage
    and clear it, we need to notify that the effective :pixbuf is now NULL.

 gtk/gtkentry.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c
index 824eee2740..4a7aed04fb 100644
--- a/gtk/gtkentry.c
+++ b/gtk/gtkentry.c
@@ -7484,15 +7484,18 @@ gtk_entry_clear_icon (GtkEntry             *entry,
   if (GDK_IS_WINDOW (icon_info->window))
     gdk_window_hide (icon_info->window);
 
+  _gtk_icon_helper_clear (icon_helper);
+
+  g_object_notify_by_pspec (G_OBJECT (entry),
+                            entry_props[icon_pos == GTK_ENTRY_ICON_PRIMARY
+                                        ? PROP_PIXBUF_PRIMARY
+                                        : PROP_PIXBUF_SECONDARY]);
+
   storage_type = _gtk_icon_helper_get_storage_type (icon_helper);
 
   switch (storage_type)
     {
     case GTK_IMAGE_PIXBUF:
-      g_object_notify_by_pspec (G_OBJECT (entry),
-                                entry_props[icon_pos == GTK_ENTRY_ICON_PRIMARY
-                                            ? PROP_PIXBUF_PRIMARY
-                                            : PROP_PIXBUF_SECONDARY]);
       break;
 
     case GTK_IMAGE_STOCK:
@@ -7521,8 +7524,6 @@ gtk_entry_clear_icon (GtkEntry             *entry,
       break;
     }
 
-  _gtk_icon_helper_clear (icon_helper);
-
   g_object_notify_by_pspec (G_OBJECT (entry),
                             entry_props[icon_pos == GTK_ENTRY_ICON_PRIMARY
                             ? PROP_STORAGE_TYPE_PRIMARY


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