summaryrefslogtreecommitdiff
path: root/gtk/gtklistbox.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2020-10-20 03:56:30 +0200
committerBenjamin Otte <otte@redhat.com>2020-10-20 04:50:12 +0200
commit22100089c31bfbc5d2441ba045a4341b2f4d6ebc (patch)
treef260bc20d2835601794994ec2deb3d440c7d8914 /gtk/gtklistbox.c
parent074d54ef5a552e2fba155b541fad1687a2cd8734 (diff)
downloadgtk+-22100089c31bfbc5d2441ba045a4341b2f4d6ebc.tar.gz
listbox: Reorder the widgets when sorting
... instead of just reordering the CSS nodes.
Diffstat (limited to 'gtk/gtklistbox.c')
-rw-r--r--gtk/gtklistbox.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/gtk/gtklistbox.c b/gtk/gtklistbox.c
index 03334b477b..b6612f34c7 100644
--- a/gtk/gtklistbox.c
+++ b/gtk/gtklistbox.c
@@ -24,7 +24,6 @@
#include "gtkadjustmentprivate.h"
#include "gtkbinlayout.h"
#include "gtkbuildable.h"
-#include "gtkcssnodeprivate.h"
#include "gtkgestureclick.h"
#include "gtkintl.h"
#include "gtkmain.h"
@@ -1260,22 +1259,14 @@ do_sort (GtkListBoxRow *a,
}
static void
-gtk_list_box_css_node_foreach (gpointer data,
- gpointer user_data)
+gtk_list_box_reorder_foreach (gpointer data,
+ gpointer user_data)
{
GtkWidget **previous = user_data;
GtkWidget *row = data;
- GtkCssNode *row_node;
- GtkCssNode *prev_node;
if (*previous)
- {
- prev_node = gtk_widget_get_css_node (*previous);
- row_node = gtk_widget_get_css_node (row);
- gtk_css_node_insert_after (gtk_css_node_get_parent (row_node),
- row_node,
- prev_node);
- }
+ gtk_widget_insert_after (row, _gtk_widget_get_parent (row), *previous);
*previous = row;
}
@@ -1299,7 +1290,7 @@ gtk_list_box_invalidate_sort (GtkListBox *box)
return;
g_sequence_sort (box->children, (GCompareDataFunc)do_sort, box);
- g_sequence_foreach (box->children, gtk_list_box_css_node_foreach, &previous);
+ g_sequence_foreach (box->children, gtk_list_box_reorder_foreach, &previous);
gtk_list_box_invalidate_headers (box);
gtk_widget_queue_resize (GTK_WIDGET (box));