Skip to content

Commit

Permalink
Fixed reload display issue
Browse files Browse the repository at this point in the history
  • Loading branch information
m00ndark committed Feb 7, 2020
1 parent 65834d3 commit e034d97
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/GitBranchView/Forms/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -189,18 +189,18 @@ private async void UpdateRootFolders()
.OrderBy(root => root.Path)
.Select(root => new RootEntry(root))
.ToList();

rootEntries.ForEach(rootEntry => rootEntry.UpdateSize());
UpdateSize(rootEntries);
flowLayoutPanel.Controls.AddRange(rootEntries.ToArray<Control>());
rootEntries.FirstOrDefault()?.Focus();


foreach (RootEntry rootEntry in rootEntries)
{
rootEntry.SizeChanged += RootEntry_SizeChanged;
rootEntry.ClonedSuccessfully += RootEntry_ClonedSuccessfully;
}

rootEntries.ForEach(rootEntry => rootEntry.UpdateSize());
UpdateSize(rootEntries);
flowLayoutPanel.Controls.AddRange(rootEntries.ToArray<Control>());
rootEntries.FirstOrDefault()?.Focus();

await Task.WhenAll(rootEntries.Select(rootEntry => rootEntry.UpdateFolders()));
}
finally
Expand Down Expand Up @@ -256,8 +256,10 @@ private void UpdateSize(List<RootEntry> rootEntries)
if (rootEntry.Width == flowLayoutPanel.Width)
continue;

rootEntry.SizeChanged -= RootEntry_SizeChanged;
rootEntry.Width = flowLayoutPanel.Width;
rootEntry.UpdateWidth();
rootEntry.SizeChanged += RootEntry_SizeChanged;
}
}

Expand Down

0 comments on commit e034d97

Please sign in to comment.