widget: Adapt _gtk_widget_get_preferred_size_for_size()

... for baseline support byu taking two extra (possible NULL) arguments.
This commit is contained in:
Benjamin Otte 2013-04-27 23:16:11 +02:00
parent 8f06590712
commit 1349292e47
5 changed files with 31 additions and 14 deletions

View File

@ -356,7 +356,7 @@ gtk_menu_bar_size_request (GtkWidget *widget,
if (gtk_widget_get_visible (child))
{
_gtk_widget_get_preferred_size_for_size (child, orientation, size, &child_minimum, &child_natural);
_gtk_widget_get_preferred_size_for_size (child, orientation, size, &child_minimum, &child_natural, NULL, NULL);
if (use_toggle_size)
{

View File

@ -2267,7 +2267,9 @@ gtk_notebook_size_request (GtkWidget *widget,
orientation,
size,
&child_minimum,
&child_natural);
&child_natural,
NULL,
NULL);
*minimum = MAX (*minimum, child_minimum);
*natural = MAX (*natural, child_natural);

View File

@ -885,7 +885,7 @@ gtk_paned_get_preferred_size (GtkWidget *widget,
if (priv->child1 && gtk_widget_get_visible (priv->child1))
{
_gtk_widget_get_preferred_size_for_size (priv->child1, orientation, size, &child_min, &child_nat);
_gtk_widget_get_preferred_size_for_size (priv->child1, orientation, size, &child_min, &child_nat, NULL, NULL);
if (priv->child1_shrink && priv->orientation == orientation)
*minimum = 0;
else
@ -895,7 +895,7 @@ gtk_paned_get_preferred_size (GtkWidget *widget,
if (priv->child2 && gtk_widget_get_visible (priv->child2))
{
_gtk_widget_get_preferred_size_for_size (priv->child2, orientation, size, &child_min, &child_nat);
_gtk_widget_get_preferred_size_for_size (priv->child2, orientation, size, &child_min, &child_nat, NULL, NULL);
if (priv->orientation == orientation)
{

View File

@ -858,20 +858,33 @@ _gtk_widget_get_preferred_size_for_size (GtkWidget *widget,
GtkOrientation orientation,
gint size,
gint *minimum,
gint *natural)
gint *natural,
gint *minimum_baseline,
gint *natural_baseline)
{
g_return_if_fail (GTK_IS_WIDGET (widget));
g_return_if_fail (size >= -1);
if (orientation == GTK_ORIENTATION_HORIZONTAL)
if (size < 0)
gtk_widget_get_preferred_width (widget, minimum, natural);
else
gtk_widget_get_preferred_width_for_height (widget, size, minimum, natural);
{
if (size < 0)
gtk_widget_get_preferred_width (widget, minimum, natural);
else
gtk_widget_get_preferred_width_for_height (widget, size, minimum, natural);
if (minimum_baseline)
*minimum_baseline = -1;
if (natural_baseline)
*natural_baseline = -1;
}
else
if (size < 0)
gtk_widget_get_preferred_height (widget, minimum, natural);
else
gtk_widget_get_preferred_height_for_width (widget, size, minimum, natural);
{
gtk_widget_get_preferred_height_and_baseline_for_width (widget,
size,
minimum,
natural,
minimum_baseline,
natural_baseline);
}
}

View File

@ -76,7 +76,9 @@ void _gtk_widget_get_preferred_size_for_size (GtkWidget *widget,
GtkOrientation orientation,
gint size,
gint *minimum,
gint *natural);
gint *natural,
gint *minimum_baseline,
gint *natural_baseline);
gboolean _gtk_widget_has_baseline_support (GtkWidget *widget);
gboolean _gtk_widget_get_translation_to_window (GtkWidget *widget,