widget: Rename width and height member to {width,height}_request

Because that's much closer to the meaning of those values.
This commit is contained in:
Timm Bäder 2018-07-21 12:28:14 +02:00
parent f5e04b59e9
commit ab30850aad
2 changed files with 16 additions and 16 deletions

View File

@ -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;

View File

@ -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 */