From 41237509add076da22172c51e4ccc35df5e7d798 Mon Sep 17 00:00:00 2001 From: Daniel Boles Date: Thu, 6 Jul 2023 23:03:20 +0100 Subject: [PATCH] =?utf8?q?Image=E2=80=94Notify=20when=20:storage-type=20ch?= =?utf8?q?anges=20from=20EMPTY?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit PROP_STORAGE_TYPE was only notified if it was changing *to* EMPTY, in gtk_image_clear_internal(). We did not notify when it changes *from* EMPTY to something non-empty. We should as not doing so is confusing, e.g. if a user wants to bind :storage-type to :visible if non-empty, which I just did! So, in functions that apply an ImageType, now notify. Also do so in gtk_image_set_from_definition, declared in imageprivate.h, even though none of the function there are currently used anywhere. (Should they be removed?) --- gtk/gtkimage.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gtk/gtkimage.c b/gtk/gtkimage.c index cc4283dd24..9759dbdf8b 100644 --- a/gtk/gtkimage.c +++ b/gtk/gtkimage.c @@ -762,6 +762,7 @@ gtk_image_set_from_icon_name (GtkImage *image, _gtk_icon_helper_set_icon_name (image->icon_helper, icon_name); g_object_notify_by_pspec (G_OBJECT (image), image_props[PROP_ICON_NAME]); + g_object_notify_by_pspec (G_OBJECT (image), image_props[PROP_STORAGE_TYPE]); g_object_thaw_notify (G_OBJECT (image)); } @@ -795,6 +796,7 @@ gtk_image_set_from_gicon (GtkImage *image, } g_object_notify_by_pspec (G_OBJECT (image), image_props[PROP_GICON]); + g_object_notify_by_pspec (G_OBJECT (image), image_props[PROP_STORAGE_TYPE]); g_object_thaw_notify (G_OBJECT (image)); } @@ -857,6 +859,7 @@ gtk_image_set_from_paintable (GtkImage *image, } g_object_notify_by_pspec (G_OBJECT (image), image_props[PROP_PAINTABLE]); + g_object_notify_by_pspec (G_OBJECT (image), image_props[PROP_STORAGE_TYPE]); g_object_thaw_notify (G_OBJECT (image)); } @@ -1079,6 +1082,8 @@ gtk_image_set_from_definition (GtkImage *image, gtk_image_notify_for_storage_type (image, gtk_image_definition_get_storage_type (def)); } + g_object_notify_by_pspec (G_OBJECT (image), image_props[PROP_STORAGE_TYPE]); + g_object_thaw_notify (G_OBJECT (image)); } -- 2.30.2