From 7b6a2f7b4d45ac785bcaa2b76119c7118b600194 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Sat, 29 Sep 2018 22:38:09 +0200 Subject: [PATCH] listview: Reset listitems' CSS animations when rebinding This way, newly displayed rows don't play an unselect animation (text fading in) when they are unselected, but the row was previously used for a selected item. --- gtk/gtklistitem.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gtk/gtklistitem.c b/gtk/gtklistitem.c index d4daec987e..b1461dd386 100644 --- a/gtk/gtklistitem.c +++ b/gtk/gtklistitem.c @@ -22,9 +22,11 @@ #include "gtklistitemprivate.h" #include "gtkbinlayout.h" +#include "gtkcssnodeprivate.h" #include "gtkintl.h" #include "gtkselectionmodel.h" /* for GTK_INVALID_LIST_POSITION */ #include "gtkwidget.h" +#include "gtkwidgetprivate.h" /** * SECTION:gtklistitem @@ -327,6 +329,8 @@ gtk_list_item_set_item (GtkListItem *self, if (item) self->item = g_object_ref (item); + gtk_css_node_invalidate (gtk_widget_get_css_node (GTK_WIDGET (self)), GTK_CSS_CHANGE_ANIMATIONS); + g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_ITEM]); }