[gtk+/wip/baedert/visible-widgets: 21/22] sizerequest: Use gtk_widget_measure to measure widget sizes
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/baedert/visible-widgets: 21/22] sizerequest: Use gtk_widget_measure to measure widget sizes
- Date: Thu, 19 Jan 2017 06:20:09 +0000 (UTC)
commit 8e9c8d3d4e6ee0c621ec6932b412e0df9200007e
Author: Timm Bäder <mail baedert org>
Date: Mon Jan 16 18:47:31 2017 +0100
sizerequest: Use gtk_widget_measure to measure widget sizes
gtk/gtksizerequest.c | 16 ++++++++++------
1 files changed, 10 insertions(+), 6 deletions(-)
---
diff --git a/gtk/gtksizerequest.c b/gtk/gtksizerequest.c
index 1e16ea8..3c58d34 100644
--- a/gtk/gtksizerequest.c
+++ b/gtk/gtksizerequest.c
@@ -143,9 +143,11 @@ gtk_widget_query_size_for_orientation (GtkWidget *widget,
gint minimum_height;
gint natural_height;
- /* Pull the base natural height from the cache as it's needed to adjust
- * the proposed 'for_size' */
- gtk_widget_get_preferred_height (widget, &minimum_height, &natural_height);
+ /* Pull the base natural height from the cache as it's needed to adjust
+ * the proposed 'for_size' */
+ gtk_widget_measure (widget, GTK_ORIENTATION_VERTICAL, -1,
+ &minimum_height, &natural_height,
+ NULL, NULL);
/* convert for_size to unadjusted height (for_size is a proposed allocation) */
gtk_widget_adjust_size_allocation (widget,
@@ -182,9 +184,11 @@ gtk_widget_query_size_for_orientation (GtkWidget *widget,
gint minimum_width;
gint natural_width;
- /* Pull the base natural width from the cache as it's needed to adjust
- * the proposed 'for_size' */
- gtk_widget_get_preferred_width (widget, &minimum_width, &natural_width);
+ /* Pull the base natural width from the cache as it's needed to adjust
+ * the proposed 'for_size' */
+ gtk_widget_measure (widget, GTK_ORIENTATION_HORIZONTAL, -1,
+ &minimum_width, &natural_width,
+ NULL, NULL);
/* convert for_size to unadjusted width (for_size is a proposed allocation) */
gtk_widget_adjust_size_allocation (widget,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]