[gtk+] widget: Use gtk_widget_measure to measure widget sizes
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] widget: Use gtk_widget_measure to measure widget sizes
- Date: Wed, 7 Dec 2016 07:18:15 +0000 (UTC)
commit ea22bd9d403eebe4b528c9e46efa9b8d4f5c5a15
Author: Timm Bäder <mail baedert org>
Date: Mon Dec 5 18:19:04 2016 +0100
widget: Use gtk_widget_measure to measure widget sizes
gtk/gtkwidget.c | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 35ed182..560cd14 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -5402,8 +5402,10 @@ gtk_widget_size_allocate_with_baseline (GtkWidget *widget,
* of get_height_for_width will internally limit the for_size to natural size
* when aligning implicitly.
*/
- gtk_widget_get_preferred_width (widget, &min_width, &natural_width);
- gtk_widget_get_preferred_height_for_width (widget, real_allocation.width, &min_height,
&natural_height);
+ gtk_widget_measure (widget, GTK_ORIENTATION_HORIZONTAL, -1,
+ &min_width, &natural_width, NULL, NULL);
+ gtk_widget_measure (widget, GTK_ORIENTATION_VERTICAL, real_allocation.width,
+ &min_height, &natural_height, NULL, NULL);
}
else
{
@@ -5411,8 +5413,10 @@ gtk_widget_size_allocate_with_baseline (GtkWidget *widget,
* of get_width_for_height will internally limit the for_size to natural size
* when aligning implicitly.
*/
- gtk_widget_get_preferred_height (widget, &min_height, &natural_height);
- gtk_widget_get_preferred_width_for_height (widget, real_allocation.height, &min_width, &natural_width);
+ gtk_widget_measure (widget, GTK_ORIENTATION_VERTICAL, -1,
+ &min_height, &natural_height, NULL, NULL);
+ gtk_widget_measure (widget, GTK_ORIENTATION_HORIZONTAL, real_allocation.height,
+ &min_width, &natural_width, NULL, NULL);
}
#ifdef G_ENABLE_CONSISTENCY_CHECKS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]