summaryrefslogtreecommitdiff
path: root/gtk/gtkgridview.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2020-06-24 04:49:21 +0200
committerBenjamin Otte <otte@redhat.com>2020-06-26 07:13:32 +0200
commitc2b0330c567c9b97035c9092b16ea1aa97a9f3e8 (patch)
tree734b114dba757ce81ed40e6fc8064f77df4cb6cd /gtk/gtkgridview.c
parentde4803bb217ddfd2c9cc355f5fabc2cde2a8cdf8 (diff)
downloadgtk+-c2b0330c567c9b97035c9092b16ea1aa97a9f3e8.tar.gz
listbase: Move a common function from the children into GtkListBase
We want to use it for the rubberband later.
Diffstat (limited to 'gtk/gtkgridview.c')
-rw-r--r--gtk/gtkgridview.c39
1 files changed, 1 insertions, 38 deletions
diff --git a/gtk/gtkgridview.c b/gtk/gtkgridview.c
index 5b2a381c69..5fde3eb895 100644
--- a/gtk/gtkgridview.c
+++ b/gtk/gtkgridview.c
@@ -687,43 +687,6 @@ cell_set_size (Cell *cell,
gtk_rb_tree_node_mark_dirty (cell);
}
-static void
-gtk_grid_view_size_allocate_child (GtkGridView *self,
- GtkWidget *child,
- int x,
- int y,
- int width,
- int height)
-{
- GtkAllocation child_allocation;
-
- if (gtk_list_base_get_orientation (GTK_LIST_BASE (self)) == GTK_ORIENTATION_VERTICAL)
- {
- child_allocation.x = x;
- child_allocation.y = y;
- child_allocation.width = width;
- child_allocation.height = height;
- }
- else if (_gtk_widget_get_direction (GTK_WIDGET (self)) == GTK_TEXT_DIR_LTR)
- {
- child_allocation.x = y;
- child_allocation.y = x;
- child_allocation.width = height;
- child_allocation.height = width;
- }
- else
- {
- int mirror_point = gtk_widget_get_width (GTK_WIDGET (self));
-
- child_allocation.x = mirror_point - y - height;
- child_allocation.y = x;
- child_allocation.width = height;
- child_allocation.height = width;
- }
-
- gtk_widget_size_allocate (child, &child_allocation, -1);
-}
-
static int
gtk_grid_view_compute_total_height (GtkGridView *self)
{
@@ -873,7 +836,7 @@ gtk_grid_view_size_allocate (GtkWidget *widget,
{
row_height += cell->size;
- gtk_grid_view_size_allocate_child (self,
+ gtk_list_base_size_allocate_child (GTK_LIST_BASE (self),
cell->parent.widget,
x + ceil (self->column_width * i),
y,