From 1364a5441f8da5c66a00f12eb42e8b00d269640f Mon Sep 17 00:00:00 2001 From: zeljko Date: Fri, 5 Nov 2010 15:37:14 +0000 Subject: [PATCH] Gtk2: avoid presence of horizontal scrollbar when TListBox is cleared by using gtk_tree_view_columns_autosize().Fixes issue #17837 git-svn-id: trunk@28097 - --- lcl/interfaces/gtk2/gtk2int.pas | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lcl/interfaces/gtk2/gtk2int.pas b/lcl/interfaces/gtk2/gtk2int.pas index 58e7df1e79..b3d6dbf18a 100644 --- a/lcl/interfaces/gtk2/gtk2int.pas +++ b/lcl/interfaces/gtk2/gtk2int.pas @@ -735,6 +735,11 @@ begin gtk_list_store_clear(FGtkListStore); + //resize columns to optimal width. See issue #17837 + //TODO: see if this is needed by TComboBox and others. + if FOwner is TListBox then + gtk_tree_view_columns_autosize(PGtkTreeView(WidgetInfo^.CoreWidget)); + Dec(WidgetInfo^.ChangeLock); //Update the internal Index cache PInteger(WidgetInfo^.UserData)^ := -1;