Fix more SizeRequest implementations to avoid recursive calls to wrapper API
GtkFrame, GtkComboBox, GtkExpander, GtkMenu, GtkWrapBox These are all the examples I could find so far. https://bugzilla.gnome.org/show_bug.cgi?id=628829
This commit is contained in:
parent
8960d64cc6
commit
c29f0a1392
@ -6172,8 +6172,8 @@ gtk_combo_box_get_height (GtkSizeRequest *widget,
|
|||||||
|
|
||||||
/* Combo box is height-for-width only
|
/* Combo box is height-for-width only
|
||||||
* (so we always just reserve enough height for the minimum width) */
|
* (so we always just reserve enough height for the minimum width) */
|
||||||
gtk_size_request_get_width (widget, &min_width, NULL);
|
GTK_SIZE_REQUEST_GET_IFACE (widget)->get_width (widget, &min_width, NULL);
|
||||||
gtk_size_request_get_height_for_width (widget, min_width, minimum_size, natural_size);
|
GTK_SIZE_REQUEST_GET_IFACE (widget)->get_height_for_width (widget, min_width, minimum_size, natural_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -6184,7 +6184,7 @@ gtk_combo_box_get_width_for_height (GtkSizeRequest *widget,
|
|||||||
{
|
{
|
||||||
/* Combo box is height-for-width only
|
/* Combo box is height-for-width only
|
||||||
* (so we assume we always reserved enough height for the minimum width) */
|
* (so we assume we always reserved enough height for the minimum width) */
|
||||||
gtk_size_request_get_width (widget, minimum_size, natural_size);
|
GTK_SIZE_REQUEST_GET_IFACE (widget)->get_width (widget, minimum_size, natural_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1495,8 +1495,7 @@ gtk_expander_get_width_for_height (GtkSizeRequest *widget,
|
|||||||
gint *minimum_width,
|
gint *minimum_width,
|
||||||
gint *natural_width)
|
gint *natural_width)
|
||||||
{
|
{
|
||||||
gtk_size_request_get_width (widget, minimum_width, natural_width);
|
GTK_SIZE_REQUEST_GET_IFACE (widget)->get_width (widget, minimum_width, natural_width);
|
||||||
//GTK_SIZE_REQUEST_GET_IFACE (widget)->get_width (widget, minimum_width, natural_width);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -925,7 +925,7 @@ gtk_frame_get_width_for_height (GtkSizeRequest *widget,
|
|||||||
gint *minimum_width,
|
gint *minimum_width,
|
||||||
gint *natural_width)
|
gint *natural_width)
|
||||||
{
|
{
|
||||||
gtk_size_request_get_width (widget, minimum_width, natural_width);
|
GTK_SIZE_REQUEST_GET_IFACE (widget)->get_width (widget, minimum_width, natural_width);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -3150,8 +3150,8 @@ gtk_menu_get_height (GtkSizeRequest *widget,
|
|||||||
gint min_width;
|
gint min_width;
|
||||||
|
|
||||||
/* Menus are height-for-width only, just return the height for the minimum width */
|
/* Menus are height-for-width only, just return the height for the minimum width */
|
||||||
gtk_size_request_get_width (widget, &min_width, NULL);
|
GTK_SIZE_REQUEST_GET_IFACE (widget)->get_width (widget, &min_width, NULL);
|
||||||
gtk_size_request_get_height_for_width (widget, min_width, minimum_size, natural_size);
|
GTK_SIZE_REQUEST_GET_IFACE (widget)->get_height_for_width (widget, min_width, minimum_size, natural_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -1527,8 +1527,8 @@ gtk_wrap_box_get_width (GtkSizeRequest *widget,
|
|||||||
/* Return the width for the minimum height */
|
/* Return the width for the minimum height */
|
||||||
gint min_height;
|
gint min_height;
|
||||||
|
|
||||||
gtk_size_request_get_height (widget, &min_height, NULL);
|
GTK_SIZE_REQUEST_GET_IFACE (widget)->get_height (widget, &min_height, NULL);
|
||||||
gtk_size_request_get_width_for_height (widget, min_height, &min_width, &nat_width);
|
GTK_SIZE_REQUEST_GET_IFACE (widget)->get_width_for_height (widget, min_height, &min_width, &nat_width);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1559,8 +1559,8 @@ gtk_wrap_box_get_height (GtkSizeRequest *widget,
|
|||||||
/* Return the height for the minimum width */
|
/* Return the height for the minimum width */
|
||||||
gint min_width;
|
gint min_width;
|
||||||
|
|
||||||
gtk_size_request_get_width (widget, &min_width, NULL);
|
GTK_SIZE_REQUEST_GET_IFACE (widget)->get_width (widget, &min_width, NULL);
|
||||||
gtk_size_request_get_height_for_width (widget, min_width, &min_height, &nat_height);
|
GTK_SIZE_REQUEST_GET_IFACE (widget)->get_height_for_width (widget, min_width, &min_height, &nat_height);
|
||||||
}
|
}
|
||||||
else /* GTK_ORIENTATION_VERTICAL */
|
else /* GTK_ORIENTATION_VERTICAL */
|
||||||
{
|
{
|
||||||
@ -1637,7 +1637,7 @@ gtk_wrap_box_get_height_for_width (GtkSizeRequest *widget,
|
|||||||
gint min_width;
|
gint min_width;
|
||||||
|
|
||||||
/* Make sure its no smaller than the minimum */
|
/* Make sure its no smaller than the minimum */
|
||||||
gtk_size_request_get_width (widget, &min_width, NULL);
|
GTK_SIZE_REQUEST_GET_IFACE (widget)->get_width (widget, &min_width, NULL);
|
||||||
|
|
||||||
border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
|
border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
|
||||||
|
|
||||||
@ -1771,7 +1771,7 @@ gtk_wrap_box_get_height_for_width (GtkSizeRequest *widget,
|
|||||||
else /* GTK_ORIENTATION_VERTICAL */
|
else /* GTK_ORIENTATION_VERTICAL */
|
||||||
{
|
{
|
||||||
/* Return the minimum height */
|
/* Return the minimum height */
|
||||||
gtk_size_request_get_height (widget, &min_height, &nat_height);
|
GTK_SIZE_REQUEST_GET_IFACE (widget)->get_height (widget, &min_height, &nat_height);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (minimum_height)
|
if (minimum_height)
|
||||||
@ -1803,14 +1803,14 @@ gtk_wrap_box_get_width_for_height (GtkSizeRequest *widget,
|
|||||||
if (priv->orientation == GTK_ORIENTATION_HORIZONTAL)
|
if (priv->orientation == GTK_ORIENTATION_HORIZONTAL)
|
||||||
{
|
{
|
||||||
/* Return the minimum width */
|
/* Return the minimum width */
|
||||||
gtk_size_request_get_width (widget, &min_width, &nat_width);
|
GTK_SIZE_REQUEST_GET_IFACE (widget)->get_width (widget, &min_width, &nat_width);
|
||||||
}
|
}
|
||||||
else /* GTK_ORIENTATION_VERTICAL */
|
else /* GTK_ORIENTATION_VERTICAL */
|
||||||
{
|
{
|
||||||
gint min_height;
|
gint min_height;
|
||||||
|
|
||||||
/* Make sure its no smaller than the minimum */
|
/* Make sure its no smaller than the minimum */
|
||||||
gtk_size_request_get_height (widget, &min_height, NULL);
|
GTK_SIZE_REQUEST_GET_IFACE (widget)->get_height (widget, &min_height, NULL);
|
||||||
|
|
||||||
border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
|
border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user