batch-rename-dialog: Don't use gtk_widget_get_preferred_height()

The functions for getting the width and height separately are gone
in GTK4. When not using them for height-for-width/width-for-height
measurements, they can be trivially replaced with get_preferred_size().

Rebased and ammended by António Fernandes <antoniof@gnome.org>
This commit is contained in:
Ernestas Kulik 2018-07-06 10:13:07 +03:00 committed by António Fernandes
parent 33ff2defe4
commit bc2cb5e15b

View file

@ -512,7 +512,7 @@ static void
update_rows_height (NautilusBatchRenameDialog *dialog)
{
GList *l;
gint current_row_natural_height;
GtkRequisition current_row_natural_size;
gint maximum_height;
maximum_height = -1;
@ -520,37 +520,37 @@ update_rows_height (NautilusBatchRenameDialog *dialog)
/* check if maximum height has changed */
for (l = dialog->listbox_labels_new; l != NULL; l = l->next)
{
gtk_widget_get_preferred_height (GTK_WIDGET (l->data),
NULL,
&current_row_natural_height);
gtk_widget_get_preferred_size (GTK_WIDGET (l->data),
NULL,
&current_row_natural_size);
if (current_row_natural_height > maximum_height)
if (current_row_natural_size.height > maximum_height)
{
maximum_height = current_row_natural_height;
maximum_height = current_row_natural_size.height;
}
}
for (l = dialog->listbox_labels_old; l != NULL; l = l->next)
{
gtk_widget_get_preferred_height (GTK_WIDGET (l->data),
NULL,
&current_row_natural_height);
gtk_widget_get_preferred_size (GTK_WIDGET (l->data),
NULL,
&current_row_natural_size);
if (current_row_natural_height > maximum_height)
if (current_row_natural_size.height > maximum_height)
{
maximum_height = current_row_natural_height;
maximum_height = current_row_natural_size.height;
}
}
for (l = dialog->listbox_icons; l != NULL; l = l->next)
{
gtk_widget_get_preferred_height (GTK_WIDGET (l->data),
NULL,
&current_row_natural_height);
gtk_widget_get_preferred_size (GTK_WIDGET (l->data),
NULL,
&current_row_natural_size);
if (current_row_natural_height > maximum_height)
if (current_row_natural_size.height > maximum_height)
{
maximum_height = current_row_natural_height;
maximum_height = current_row_natural_size.height;
}
}