mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-06 10:50:08 +00:00
treeview: Use gtk_widget_measure to measure widget sizes
This commit is contained in:
parent
846e6dc0b1
commit
75a3d0fab6
@ -2782,7 +2782,8 @@ gtk_tree_view_size_allocate (GtkWidget *widget,
|
|||||||
child_rect.width -= child->border.left + child->border.right;
|
child_rect.width -= child->border.left + child->border.right;
|
||||||
child_rect.height -= child->border.top + child->border.bottom;
|
child_rect.height -= child->border.top + child->border.bottom;
|
||||||
|
|
||||||
gtk_widget_get_preferred_width (GTK_WIDGET (child->widget), &size, NULL);
|
gtk_widget_measure (GTK_WIDGET (child->widget), GTK_ORIENTATION_HORIZONTAL, -1,
|
||||||
|
&size, NULL, NULL, NULL);
|
||||||
|
|
||||||
if (size > child_rect.width)
|
if (size > child_rect.width)
|
||||||
{
|
{
|
||||||
@ -2796,9 +2797,10 @@ gtk_tree_view_size_allocate (GtkWidget *widget,
|
|||||||
child_rect.width = size;
|
child_rect.width = size;
|
||||||
}
|
}
|
||||||
|
|
||||||
gtk_widget_get_preferred_height_for_width (GTK_WIDGET (child->widget),
|
gtk_widget_measure (GTK_WIDGET (child->widget), GTK_ORIENTATION_VERTICAL,
|
||||||
child_rect.width,
|
child_rect.width,
|
||||||
&size, NULL);
|
&size, NULL,
|
||||||
|
NULL, NULL);
|
||||||
if (size > child_rect.height)
|
if (size > child_rect.height)
|
||||||
{
|
{
|
||||||
/* Enlarge the child, extending in both directions equally */
|
/* Enlarge the child, extending in both directions equally */
|
||||||
|
Loading…
Reference in New Issue
Block a user