[gtk+] tests/revealer-size: Use gtk_widget_measure
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] tests/revealer-size: Use gtk_widget_measure
- Date: Sun, 5 Mar 2017 11:41:24 +0000 (UTC)
commit b6790b112f7947deb8e178f0ca863fdb2d250b1d
Author: Timm Bäder <mail baedert org>
Date: Sun Mar 5 08:55:55 2017 +0100
tests/revealer-size: Use gtk_widget_measure
testsuite/gtk/revealer-size.c | 18 ++++++++++++------
1 files changed, 12 insertions(+), 6 deletions(-)
---
diff --git a/testsuite/gtk/revealer-size.c b/testsuite/gtk/revealer-size.c
index 752992c..fefae48 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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]