From ab30850aad59df6eb15a4965ecef86eb6d0dee22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Sat, 21 Jul 2018 12:28:14 +0200 Subject: [PATCH] widget: Rename width and height member to {width,height}_request Because that's much closer to the meaning of those values. --- gtk/gtkwidget.c | 28 ++++++++++++++-------------- gtk/gtkwidgetprivate.h | 4 ++-- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c index f3498d90b9..7699887c7f 100644 --- a/gtk/gtkwidget.c +++ b/gtk/gtkwidget.c @@ -2868,8 +2868,8 @@ gtk_widget_init (GTypeInstance *instance, gpointer g_class) priv->halign = GTK_ALIGN_FILL; priv->valign = GTK_ALIGN_FILL; - priv->width = -1; - priv->height = -1; + priv->width_request = -1; + priv->height_request = -1; _gtk_size_request_cache_init (&priv->requests); @@ -7822,16 +7822,16 @@ gtk_widget_set_usize_internal (GtkWidget *widget, g_object_freeze_notify (G_OBJECT (widget)); - if (width > -2 && priv->width != width) + if (width > -2 && priv->width_request != width) { g_object_notify_by_pspec (G_OBJECT (widget), widget_props[PROP_WIDTH_REQUEST]); - priv->width = width; + priv->width_request = width; changed = TRUE; } - if (height > -2 && priv->height != height) + if (height > -2 && priv->height_request != height) { g_object_notify_by_pspec (G_OBJECT (widget), widget_props[PROP_HEIGHT_REQUEST]); - priv->height = height; + priv->height_request = height; changed = TRUE; } @@ -7917,10 +7917,10 @@ gtk_widget_get_size_request (GtkWidget *widget, g_return_if_fail (GTK_IS_WIDGET (widget)); if (width) - *width = priv->width; + *width = priv->width_request; if (height) - *height = priv->height; + *height = priv->height_request; } /*< private > @@ -7935,7 +7935,7 @@ gtk_widget_has_size_request (GtkWidget *widget) { GtkWidgetPrivate *priv = gtk_widget_get_instance_private (widget); - return !(priv->width == -1 && priv->height == -1); + return !(priv->width_request == -1 && priv->height_request == -1); } /** @@ -8673,10 +8673,10 @@ gtk_widget_adjust_size_request (GtkWidget *widget, { GtkWidgetPrivate *priv = gtk_widget_get_instance_private (widget); - if (orientation == GTK_ORIENTATION_HORIZONTAL && priv->width > 0) - *minimum_size = MAX (*minimum_size, priv->width); - else if (orientation == GTK_ORIENTATION_VERTICAL && priv->height > 0) - *minimum_size = MAX (*minimum_size, priv->height); + if (orientation == GTK_ORIENTATION_HORIZONTAL && priv->width_request > 0) + *minimum_size = MAX (*minimum_size, priv->width_request); + else if (orientation == GTK_ORIENTATION_VERTICAL && priv->height_request > 0) + *minimum_size = MAX (*minimum_size, priv->height_request); /* Fix it if set_size_request made natural size smaller than min size. * This would also silently fix broken widgets, but we warn about them @@ -8703,7 +8703,7 @@ gtk_widget_adjust_baseline_request (GtkWidget *widget, { GtkWidgetPrivate *priv = gtk_widget_get_instance_private (widget); - if (priv->height >= 0) + if (priv->height_request >= 0) { /* No baseline support for explicitly set height */ *minimum_baseline = -1; diff --git a/gtk/gtkwidgetprivate.h b/gtk/gtkwidgetprivate.h index 009e2a548f..8acf071e92 100644 --- a/gtk/gtkwidgetprivate.h +++ b/gtk/gtkwidgetprivate.h @@ -106,8 +106,8 @@ struct _GtkWidgetPrivate guint8 verifying_invariants_count; #endif - gint width; - gint height; + int width_request; + int height_request; GtkBorder margin; /* Animations and other things to update on clock ticks */