[gtk/wip/otte/bitset: 20/23] listview: Allocate rubberband at end of size_allocate()



commit d6dbd93a775b252f36456311651aac0618188cf8
Author: Benjamin Otte <otte redhat com>
Date:   Fri Jun 26 02:55:53 2020 +0200

    listview: Allocate rubberband at end of size_allocate()
    
    Otherwise the rubberband uses the wrong scroll offsets.

 gtk/gtkgridview.c | 4 ++--
 gtk/gtklistview.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtkgridview.c b/gtk/gtkgridview.c
index 5fde3eb895..ac3d49cdda 100644
--- a/gtk/gtkgridview.c
+++ b/gtk/gtkgridview.c
@@ -716,8 +716,6 @@ gtk_grid_view_size_allocate (GtkWidget *widget,
   int x, y;
   guint i;
 
-  gtk_list_base_allocate_rubberband (GTK_LIST_BASE (widget));
-
   orientation = gtk_list_base_get_orientation (GTK_LIST_BASE (self));
   scroll_policy = gtk_list_base_get_scroll_policy (GTK_LIST_BASE (self), orientation);
   opposite_orientation = OPPOSITE_ORIENTATION (orientation);
@@ -877,6 +875,8 @@ gtk_grid_view_size_allocate (GtkWidget *widget,
             }
         }
     }
+
+  gtk_list_base_allocate_rubberband (GTK_LIST_BASE (widget));
 }
 
 static void
diff --git a/gtk/gtklistview.c b/gtk/gtklistview.c
index b34b216e71..3bffebdeea 100644
--- a/gtk/gtklistview.c
+++ b/gtk/gtklistview.c
@@ -567,8 +567,6 @@ gtk_list_view_size_allocate (GtkWidget *widget,
   GtkOrientation orientation, opposite_orientation;
   GtkScrollablePolicy scroll_policy;
 
-  gtk_list_base_allocate_rubberband (GTK_LIST_BASE (self));
-
   orientation = gtk_list_base_get_orientation (GTK_LIST_BASE (self));
   opposite_orientation = OPPOSITE_ORIENTATION (orientation);
   scroll_policy = gtk_list_base_get_scroll_policy (GTK_LIST_BASE (self), orientation);
@@ -658,6 +656,8 @@ gtk_list_view_size_allocate (GtkWidget *widget,
 
       y += row->height * row->parent.n_items;
     }
+
+  gtk_list_base_allocate_rubberband (GTK_LIST_BASE (self));
 }
 
 static void


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