From 383d3da6dd3f9aedb6dd0b7710d9de7f232563cf Mon Sep 17 00:00:00 2001 From: Wu Xiaotian Date: Mon, 31 Dec 2018 17:45:12 +0800 Subject: Fixed number of cols error after reload menus. After install/uninstall applications, each category of applications display as one long line. --- libslab/app-resizer.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'libslab/app-resizer.c') diff --git a/libslab/app-resizer.c b/libslab/app-resizer.c index d5b27dc6..00c0cd2a 100644 --- a/libslab/app-resizer.c +++ b/libslab/app-resizer.c @@ -136,11 +136,11 @@ calculate_num_cols (AppResizer * resizer, gint avail_width) GtkTable *table = GTK_TABLE (resizer->cached_tables_list->data); GList *children = gtk_container_get_children (GTK_CONTAINER (table)); GtkWidget *table_element = GTK_WIDGET (children->data); - GtkAllocation allocation; + gint natural_width; g_list_free (children); - gtk_widget_get_allocation (table_element, &allocation); - resizer->cached_element_width = allocation.width; + gtk_widget_get_preferred_width (table_element, NULL, &natural_width); + resizer->cached_element_width = natural_width; resizer->cached_table_spacing = gtk_table_get_default_col_spacing (table); } -- cgit v1.2.1