From d717a2dcfc8603561f8a0f78982244e8b8fd9006 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Tue, 30 Aug 2011 15:11:02 +0200 Subject: [PATCH] grid: Swap wrong spacing properties row-spacing behaved like column-spacing should have and vice versa. Also update tests that erroneously checked this behavior. Thanks to Joanmarie Diggs for finding this. --- gtk/gtkgrid.c | 16 ++++++++-------- tests/reftests/grid-spacing1.ui | 2 +- tests/reftests/grid-spacing2.ui | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/gtk/gtkgrid.c b/gtk/gtkgrid.c index df6d74daec..f6ec2f1111 100644 --- a/gtk/gtkgrid.c +++ b/gtk/gtkgrid.c @@ -163,11 +163,11 @@ gtk_grid_get_property (GObject *object, break; case PROP_ROW_SPACING: - g_value_set_int (value, ROWS (priv)->spacing); + g_value_set_int (value, COLUMNS (priv)->spacing); break; case PROP_COLUMN_SPACING: - g_value_set_int (value, COLUMNS (priv)->spacing); + g_value_set_int (value, ROWS (priv)->spacing); break; case PROP_ROW_HOMOGENEOUS: @@ -1821,9 +1821,9 @@ gtk_grid_set_row_spacing (GtkGrid *grid, priv = grid->priv; - if (ROWS (priv)->spacing != spacing) + if (COLUMNS (priv)->spacing != spacing) { - ROWS (priv)->spacing = spacing; + COLUMNS (priv)->spacing = spacing; if (gtk_widget_get_visible (GTK_WIDGET (grid))) gtk_widget_queue_resize (GTK_WIDGET (grid)); @@ -1848,7 +1848,7 @@ gtk_grid_get_row_spacing (GtkGrid *grid) priv = grid->priv; - return ROWS (priv)->spacing; + return COLUMNS (priv)->spacing; } /** @@ -1868,9 +1868,9 @@ gtk_grid_set_column_spacing (GtkGrid *grid, priv = grid->priv; - if (COLUMNS (priv)->spacing != spacing) + if (ROWS (priv)->spacing != spacing) { - COLUMNS (priv)->spacing = spacing; + ROWS (priv)->spacing = spacing; if (gtk_widget_get_visible (GTK_WIDGET (grid))) gtk_widget_queue_resize (GTK_WIDGET (grid)); @@ -1896,5 +1896,5 @@ gtk_grid_get_column_spacing (GtkGrid *grid) priv = grid->priv; - return COLUMNS (priv)->spacing; + return ROWS (priv)->spacing; } diff --git a/tests/reftests/grid-spacing1.ui b/tests/reftests/grid-spacing1.ui index a8a330ada1..eda8526a04 100644 --- a/tests/reftests/grid-spacing1.ui +++ b/tests/reftests/grid-spacing1.ui @@ -13,7 +13,7 @@ True False - 20 + 20 True diff --git a/tests/reftests/grid-spacing2.ui b/tests/reftests/grid-spacing2.ui index 0e9c82f056..fe28a55913 100644 --- a/tests/reftests/grid-spacing2.ui +++ b/tests/reftests/grid-spacing2.ui @@ -13,7 +13,7 @@ True False - 20 + 20 True