From b8b660ae329c0c2becd7917d9f4d52dca49f7231 Mon Sep 17 00:00:00 2001 From: Hib Eris Date: Sun, 25 Jan 2015 13:18:36 +0100 Subject: [PATCH] [glib] Remove use of deprecated GtkAlignment from demo/forms.c https://bugs.freedesktop.org/show_bug.cgi?id=88788 --- glib/demo/forms.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/glib/demo/forms.c b/glib/demo/forms.c index 9dfe3cd..8fa8785 100644 --- a/glib/demo/forms.c +++ b/glib/demo/forms.c @@ -129,27 +129,30 @@ static void pgd_form_field_view_set_field (GtkWidget *field_view, PopplerFormField *field) { - GtkWidget *alignment; GtkWidget *table; PopplerAction *action; GEnumValue *enum_value; gchar *text; gint row = 0; - alignment = gtk_bin_get_child (GTK_BIN (field_view)); - if (alignment) { - gtk_container_remove (GTK_CONTAINER (field_view), alignment); + table = gtk_bin_get_child (GTK_BIN (field_view)); + if (table) { + gtk_container_remove (GTK_CONTAINER (field_view), table); } - - alignment = gtk_alignment_new (0.5, 0.5, 1, 1); - gtk_alignment_set_padding (GTK_ALIGNMENT (alignment), 5, 5, 12, 5); - gtk_container_add (GTK_CONTAINER (field_view), alignment); - gtk_widget_show (alignment); if (!field) return; table = gtk_grid_new (); + gtk_widget_set_margin_top (table, 5); + gtk_widget_set_margin_bottom (table, 5); +#if GTK_CHECK_VERSION(3, 12, 0) + gtk_widget_set_margin_start (table, 12); + gtk_widget_set_margin_end (table, 5); +#else + gtk_widget_set_margin_left (table, 12); + gtk_widget_set_margin_right (table, 5); +#endif gtk_grid_set_column_spacing (GTK_GRID (table), 6); gtk_grid_set_row_spacing (GTK_GRID (table), 6); @@ -251,7 +254,7 @@ pgd_form_field_view_set_field (GtkWidget *field_view, g_assert_not_reached (); } - gtk_container_add (GTK_CONTAINER (alignment), table); + gtk_container_add (GTK_CONTAINER (field_view), table); gtk_widget_show (table); } -- 1.9.1