099955b0.patch 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. From 099955b0c06dbddc9469bd3c8e63673a3a82883f Mon Sep 17 00:00:00 2001
  2. From: Benjamin Otte <otte@redhat.com>
  3. Date: Tue, 16 May 2023 18:08:21 +0200
  4. Subject: [PATCH] gridview: Add border-spacing where it was missed
  5. We were computing column widths without taking border-spacing into
  6. account, making them slightly too big.
  7. ---
  8. gtk/gtkgridview.c | 4 ++--
  9. 1 file changed, 2 insertions(+), 2 deletions(-)
  10. diff --git a/gtk/gtkgridview.c b/gtk/gtkgridview.c
  11. index 274f34c3c95..885826a138e 100644
  12. --- a/gtk/gtkgridview.c
  13. +++ b/gtk/gtkgridview.c
  14. @@ -657,7 +657,7 @@ gtk_grid_view_measure_list (GtkWidget *widget,
  15. gtk_grid_view_measure_column_size (self, &col_min, &col_nat);
  16. for_size = MAX (for_size, col_min * (int) self->min_columns);
  17. n_columns = gtk_grid_view_compute_n_columns (self, for_size, xspacing, col_min, col_nat);
  18. - column_size = for_size / n_columns;
  19. + column_size = (for_size + xspacing) / n_columns - xspacing;
  20. i = 0;
  21. row_height = 0;
  22. @@ -770,7 +770,7 @@ gtk_grid_view_size_allocate (GtkWidget *widget,
  23. orientation == GTK_ORIENTATION_VERTICAL ? width : height,
  24. xspacing,
  25. col_min, col_nat);
  26. - self->column_width = (orientation == GTK_ORIENTATION_VERTICAL ? width : height) / self->n_columns;
  27. + self->column_width = ((orientation == GTK_ORIENTATION_VERTICAL ? width : height) + xspacing) / self->n_columns - xspacing;
  28. self->column_width = MAX (self->column_width, col_min);
  29. /* step 2: determine height of known rows */
  30. --
  31. GitLab