From 4b567dfaa4e751d1252edba777ecf712dfbcad2e Mon Sep 17 00:00:00 2001 From: Hib Eris Date: Sun, 25 Jan 2015 13:55:17 +0100 Subject: [PATCH] [glib] Remove use of deprecated GtkAlignment from demo/page.c https://bugs.freedesktop.org/show_bug.cgi?id=88788 --- glib/demo/page.c | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/glib/demo/page.c b/glib/demo/page.c index f9413a8..ba7e52f 100644 --- a/glib/demo/page.c +++ b/glib/demo/page.c @@ -215,7 +215,7 @@ pgd_page_create_widget (PopplerDocument *document) GtkWidget *vbox; GtkWidget *hbox, *page_selector; GtkWidget *button; - GtkWidget *frame, *alignment; + GtkWidget *frame; GtkWidget *table; GtkWidget *label; GtkWidget *thumnail_box; @@ -269,12 +269,16 @@ pgd_page_create_widget (PopplerDocument *document) gtk_frame_set_label_widget (GTK_FRAME (frame), label); gtk_widget_show (label); - 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 (frame), alignment); - gtk_widget_show (alignment); - 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); @@ -287,7 +291,7 @@ pgd_page_create_widget (PopplerDocument *document) pgd_table_add_property_with_value_widget (GTK_GRID (table), "Page Duration:", &(demo->duration), NULL, &row); - gtk_container_add (GTK_CONTAINER (alignment), table); + gtk_container_add (GTK_CONTAINER (frame), table); gtk_widget_show (table); gtk_box_pack_start (GTK_BOX (hbox), frame, TRUE, TRUE, 0); @@ -301,12 +305,16 @@ pgd_page_create_widget (PopplerDocument *document) gtk_frame_set_label_widget (GTK_FRAME (frame), label); gtk_widget_show (label); - 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 (frame), alignment); - gtk_widget_show (alignment); - thumnail_box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6); + gtk_widget_set_margin_top (thumnail_box, 5); + gtk_widget_set_margin_bottom (thumnail_box, 5); +#if GTK_CHECK_VERSION(3, 12, 0) + gtk_widget_set_margin_start (thumnail_box, 12); + gtk_widget_set_margin_end (thumnail_box, 5); +#else + gtk_widget_set_margin_left (thumnail_box, 12); + gtk_widget_set_margin_right (thumnail_box, 5); +#endif demo->thumbnail = gtk_image_new (); gtk_box_pack_start (GTK_BOX (thumnail_box), demo->thumbnail, TRUE, TRUE, 0); @@ -317,7 +325,7 @@ pgd_page_create_widget (PopplerDocument *document) gtk_box_pack_start (GTK_BOX (thumnail_box), demo->thumbnail_size, TRUE, TRUE, 0); gtk_widget_show (demo->thumbnail_size); - gtk_container_add (GTK_CONTAINER (alignment), thumnail_box); + gtk_container_add (GTK_CONTAINER (frame), thumnail_box); gtk_widget_show (thumnail_box); gtk_box_pack_start (GTK_BOX (hbox), frame, TRUE, TRUE, 0); -- 1.9.1