From b6790b112f7947deb8e178f0ca863fdb2d250b1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Sun, 5 Mar 2017 08:55:55 +0100 Subject: tests/revealer-size: Use gtk_widget_measure --- testsuite/gtk/revealer-size.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'testsuite/gtk/revealer-size.c') diff --git a/testsuite/gtk/revealer-size.c b/testsuite/gtk/revealer-size.c index 752992c04c..fefae48b73 100644 --- a/testsuite/gtk/revealer-size.c +++ b/testsuite/gtk/revealer-size.c @@ -24,19 +24,25 @@ keep_size (int direction, gtk_revealer_set_reveal_child (revealer, TRUE); - gtk_widget_get_preferred_width (GTK_WIDGET (child), &min_child_width, NULL); - gtk_widget_get_preferred_height (GTK_WIDGET (child), &min_child_height, NULL); + gtk_widget_measure (child, GTK_ORIENTATION_HORIZONTAL, -1, + &min_child_width, NULL, NULL, NULL); + gtk_widget_measure (child, GTK_ORIENTATION_VERTICAL, -1, + &min_child_height, NULL, NULL, NULL); - gtk_widget_get_preferred_width (GTK_WIDGET (revealer), &min_width, NULL); - gtk_widget_get_preferred_height (GTK_WIDGET (revealer), &min_height, NULL); + gtk_widget_measure (GTK_WIDGET (revealer), GTK_ORIENTATION_HORIZONTAL, -1, + &min_width, NULL, NULL, NULL); + gtk_widget_measure (GTK_WIDGET (revealer), GTK_ORIENTATION_VERTICAL, -1, + &min_height, NULL, NULL, NULL); g_assert_cmpint (min_width, ==, min_child_width); g_assert_cmpint (min_height, ==, min_child_height); gtk_revealer_set_reveal_child (revealer, FALSE); - gtk_widget_get_preferred_width (GTK_WIDGET (revealer), &min_width, NULL); - gtk_widget_get_preferred_height (GTK_WIDGET (revealer), &min_height, NULL); + gtk_widget_measure (GTK_WIDGET (revealer), GTK_ORIENTATION_HORIZONTAL, -1, + &min_width, NULL, NULL, NULL); + gtk_widget_measure (GTK_WIDGET (revealer), GTK_ORIENTATION_VERTICAL, -1, + &min_height, NULL, NULL, NULL); if (direction & KEEP_WIDTH) g_assert_cmpint (min_width, ==, min_child_width); -- cgit v1.2.1