mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-29 06:51:10 +00:00
widget: Remove gtk_widget_get_allocated_size()
Use gtk_widget_get_allocated_width/height in the only user (GtkStack), even though that isn't 100% correct.
This commit is contained in:
parent
8ce6cf569f
commit
9a8082bab2
@ -1195,12 +1195,9 @@ set_visible_child (GtkStack *stack,
|
||||
{
|
||||
if (gtk_widget_is_visible (widget))
|
||||
{
|
||||
GtkAllocation allocation;
|
||||
|
||||
priv->last_visible_child = priv->visible_child;
|
||||
gtk_widget_get_allocated_size (priv->last_visible_child->widget, &allocation, NULL);
|
||||
priv->last_visible_widget_width = allocation.width;
|
||||
priv->last_visible_widget_height = allocation.height;
|
||||
priv->last_visible_widget_width = gtk_widget_get_allocated_width (priv->last_visible_child->widget);
|
||||
priv->last_visible_widget_height = gtk_widget_get_allocated_height (priv->last_visible_child->widget);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -11099,41 +11099,6 @@ gtk_widget_get_has_tooltip (GtkWidget *widget)
|
||||
return priv->has_tooltip;
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_widget_get_allocated_size:
|
||||
* @widget: a #GtkWidget
|
||||
* @allocation: (out): a pointer to a #GtkAllocation to copy to
|
||||
* @baseline: (out) (allow-none): a pointer to an integer to copy to
|
||||
*
|
||||
* Retrieves the widget’s allocated size.
|
||||
*
|
||||
* This function returns the last values passed to
|
||||
* gtk_widget_size_allocate(). The value differs from
|
||||
* the size returned in gtk_widget_get_allocation() in that functions
|
||||
* like gtk_widget_set_halign() can adjust the allocation, but not
|
||||
* the value returned by this function.
|
||||
*
|
||||
* If a widget is not visible, its allocated size is 0.
|
||||
*/
|
||||
void
|
||||
gtk_widget_get_allocated_size (GtkWidget *widget,
|
||||
GtkAllocation *allocation,
|
||||
int *baseline)
|
||||
{
|
||||
GtkWidgetPrivate *priv = gtk_widget_get_instance_private (widget);
|
||||
|
||||
g_return_if_fail (GTK_IS_WIDGET (widget));
|
||||
g_return_if_fail (allocation != NULL);
|
||||
|
||||
allocation->x = graphene_matrix_get_value (&priv->allocated_transform, 3, 0);
|
||||
allocation->y = graphene_matrix_get_value (&priv->allocated_transform, 3, 1);
|
||||
allocation->width = priv->allocated_width;
|
||||
allocation->height = priv->allocated_height;
|
||||
|
||||
if (baseline)
|
||||
*baseline = priv->allocated_size_baseline;
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_widget_get_allocation:
|
||||
* @widget: a #GtkWidget
|
||||
|
@ -605,10 +605,6 @@ GDK_AVAILABLE_IN_ALL
|
||||
int gtk_widget_get_allocated_height (GtkWidget *widget);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
int gtk_widget_get_allocated_baseline (GtkWidget *widget);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
void gtk_widget_get_allocated_size (GtkWidget *widget,
|
||||
GtkAllocation *allocation,
|
||||
int *baseline);
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
void gtk_widget_get_allocation (GtkWidget *widget,
|
||||
|
Loading…
Reference in New Issue
Block a user