mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-28 10:02:14 +00:00
FIX: Use Begin/EndUpdate when adding columns, so that AutoFillColumns doesn't interefere with settings Widths until after all columns have been added. Bug [0000231].
This commit is contained in:
parent
657aa61039
commit
503c8a9aa3
1 changed files with 17 additions and 10 deletions
|
|
@ -1323,18 +1323,25 @@ var
|
|||
begin
|
||||
ColumnsClass := GetColumnsClass;
|
||||
|
||||
dgPanel.Columns.Clear;
|
||||
for x:= 0 to ColumnsClass.ColumnsCount - 1 do
|
||||
begin
|
||||
with dgPanel.Columns.Add do
|
||||
dgPanel.Columns.BeginUpdate;
|
||||
try
|
||||
dgPanel.Columns.Clear;
|
||||
for x:= 0 to ColumnsClass.ColumnsCount - 1 do
|
||||
begin
|
||||
if not ((x = 0) and gAutoFillColumns and (gAutoSizeColumn = 0)) then
|
||||
SizePriority:= 0
|
||||
else
|
||||
SizePriority:= 1;
|
||||
Width:= ColumnsClass.GetColumnWidth(x);
|
||||
Title.Caption:= ColumnsClass.GetColumnTitle(x);
|
||||
with dgPanel.Columns.Add do
|
||||
begin
|
||||
// SizePriority = 0 means don't modify Width with AutoFill.
|
||||
// Last column is always modified if all columns have SizePriority = 0.
|
||||
if (x = 0) and (gAutoSizeColumn = 0) then
|
||||
SizePriority := 1
|
||||
else
|
||||
SizePriority := 0;
|
||||
Width:= ColumnsClass.GetColumnWidth(x);
|
||||
Title.Caption:= ColumnsClass.GetColumnTitle(x);
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
dgPanel.Columns.EndUpdate;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue