widget: Remove get_valign_with_baseline

This only existed for backwards compat reasons which aren't interesting
for gtk4.
This commit is contained in:
Timm Bäder 2017-03-05 15:18:32 +01:00
parent f1f39e8924
commit f860ff8647
6 changed files with 11 additions and 42 deletions

View File

@ -4675,7 +4675,6 @@ GtkAlign
gtk_widget_get_halign
gtk_widget_set_halign
gtk_widget_get_valign
gtk_widget_get_valign_with_baseline
gtk_widget_set_valign
gtk_widget_get_margin_start
gtk_widget_set_margin_start

View File

@ -553,7 +553,7 @@ gtk_button_box_child_requisition (GtkWidget *widget,
_gtk_widget_get_preferred_size_and_baseline (child,
&child_requisition, NULL, &child_baseline, NULL);
if (orientation == GTK_ORIENTATION_HORIZONTAL &&
gtk_widget_get_valign_with_baseline (child) == GTK_ALIGN_BASELINE &&
gtk_widget_get_valign (child) == GTK_ALIGN_BASELINE &&
child_baseline != -1)
{
have_baseline = TRUE;
@ -618,7 +618,7 @@ gtk_button_box_child_requisition (GtkWidget *widget,
(*heights)[i] = -1;
if (orientation == GTK_ORIENTATION_HORIZONTAL &&
gtk_widget_get_valign_with_baseline (child) == GTK_ALIGN_BASELINE &&
gtk_widget_get_valign (child) == GTK_ALIGN_BASELINE &&
child_baseline != -1)
{
(*baselines)[i] = child_baseline;
@ -639,7 +639,7 @@ gtk_button_box_child_requisition (GtkWidget *widget,
(*heights)[i] = child_requisition.height + ipad_h;
if (orientation == GTK_ORIENTATION_HORIZONTAL &&
gtk_widget_get_valign_with_baseline (child) == GTK_ALIGN_BASELINE &&
gtk_widget_get_valign (child) == GTK_ALIGN_BASELINE &&
child_baseline != -1)
(*baselines)[i] = child_baseline;
}

View File

@ -631,7 +631,7 @@ gtk_box_size_allocate_no_center (GtkWidget *widget,
sizes[i].natural_size = child_size;
if (private->orientation == GTK_ORIENTATION_HORIZONTAL &&
gtk_widget_get_valign_with_baseline (child->widget) == GTK_ALIGN_BASELINE)
gtk_widget_get_valign (child->widget) == GTK_ALIGN_BASELINE)
{
int child_allocation_width;
int child_minimum_height, child_natural_height;
@ -976,7 +976,7 @@ gtk_box_size_allocate_with_center (GtkWidget *widget,
sizes[packing][i].natural_size = child_size;
if (priv->orientation == GTK_ORIENTATION_HORIZONTAL &&
gtk_widget_get_valign_with_baseline (child->widget) == GTK_ALIGN_BASELINE)
gtk_widget_get_valign (child->widget) == GTK_ALIGN_BASELINE)
{
gint child_allocation_width;
gint child_minimum_height, child_natural_height;

View File

@ -261,7 +261,7 @@ gtk_widget_query_size_for_orientation (GtkWidget *widget,
min_baseline = -1;
nat_baseline = -1;
}
else if (gtk_widget_get_valign_with_baseline (widget) != GTK_ALIGN_BASELINE)
else if (gtk_widget_get_valign (widget) != GTK_ALIGN_BASELINE)
{
/* Ignore requested baseline for non-aligned widgets */
min_baseline = -1;

View File

@ -3422,7 +3422,7 @@ gtk_widget_get_property (GObject *object,
g_value_set_enum (value, gtk_widget_get_halign (widget));
break;
case PROP_VALIGN:
g_value_set_enum (value, gtk_widget_get_valign_with_baseline (widget));
g_value_set_enum (value, gtk_widget_get_valign (widget));
break;
case PROP_MARGIN_START:
g_value_set_int (value, gtk_widget_get_margin_start (widget));
@ -5380,7 +5380,7 @@ gtk_widget_size_allocate_with_baseline (GtkWidget *widget,
/* Never pass a baseline to a child unless it requested it.
This means containers don't have to manually check for this. */
if (baseline != -1 &&
gtk_widget_get_valign_with_baseline (widget) != GTK_ALIGN_BASELINE)
gtk_widget_get_valign (widget) != GTK_ALIGN_BASELINE)
baseline = -1;
alloc_needed = priv->alloc_needed;
@ -12851,48 +12851,20 @@ gtk_widget_set_halign (GtkWidget *widget,
g_object_notify_by_pspec (G_OBJECT (widget), widget_props[PROP_HALIGN]);
}
/**
* gtk_widget_get_valign_with_baseline:
* @widget: a #GtkWidget
*
* Gets the value of the #GtkWidget:valign property, including
* %GTK_ALIGN_BASELINE.
*
* Returns: the vertical alignment of @widget
*
* Since: 3.10
*/
GtkAlign
gtk_widget_get_valign_with_baseline (GtkWidget *widget)
{
g_return_val_if_fail (GTK_IS_WIDGET (widget), GTK_ALIGN_FILL);
return widget->priv->valign;
}
/**
* gtk_widget_get_valign:
* @widget: a #GtkWidget
*
* Gets the value of the #GtkWidget:valign property.
*
* For backwards compatibility reasons this method will never return
* %GTK_ALIGN_BASELINE, but instead it will convert it to
* %GTK_ALIGN_FILL. If your widget want to support baseline aligned
* children it must use gtk_widget_get_valign_with_baseline(), or
* `g_object_get (widget, "valign", &value, NULL)`, which will
* also report the true value.
*
* Returns: the vertical alignment of @widget, ignoring baseline alignment
* Returns: the vertical alignment of @widget
*/
GtkAlign
gtk_widget_get_valign (GtkWidget *widget)
{
GtkAlign align;
g_return_val_if_fail (GTK_IS_WIDGET (widget), GTK_ALIGN_FILL);
align = gtk_widget_get_valign_with_baseline (widget);
if (align == GTK_ALIGN_BASELINE)
return GTK_ALIGN_FILL;
return align;
return widget->priv->valign;
}
/**

View File

@ -901,8 +901,6 @@ void gtk_widget_set_halign (GtkWidget *widget,
GtkAlign align);
GDK_AVAILABLE_IN_ALL
GtkAlign gtk_widget_get_valign (GtkWidget *widget);
GDK_AVAILABLE_IN_3_10
GtkAlign gtk_widget_get_valign_with_baseline (GtkWidget *widget);
GDK_AVAILABLE_IN_ALL
void gtk_widget_set_valign (GtkWidget *widget,
GtkAlign align);