Skip to content

Commit

Permalink
Remove SizeChanged handler
Browse files Browse the repository at this point in the history
The current implementation of the `SizeChanged` handler causes a bad
distortion to the UI and renders the listview unusable.

The handler is removed and the column is resized at the time of bindings
items to the list.
This adds a small artifact that if the list was resized after items have
been bound, the column may no longer be of the full width of the list.

Fixes gitextensions#5437
Fixes gitextensions#5438
  • Loading branch information
Igor Velikorossov committed Sep 19, 2018
1 parent adb881b commit ad3f8b4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 16 deletions.
5 changes: 2 additions & 3 deletions GitUI/UserControls/FileStatusList.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 1 addition & 13 deletions GitUI/UserControls/FileStatusList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -927,8 +927,8 @@ private void UpdateFileStatusListView(bool updateCausedByFilter = false)
}
}

FileStatusListView_SizeChanged(null, null);
FileStatusListView.SetGroupState(ListViewGroupState.Collapsible);
FileStatusListView.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize);
FileStatusListView.EndUpdate();

return;
Expand Down Expand Up @@ -1053,18 +1053,6 @@ public void SelectFirstVisibleItem()
[Browsable(false)]
public GitRevision Revision { get; set; }

private void FileStatusListView_SizeChanged(object sender, EventArgs e)
{
NoFiles.Size = new Size(Size.Width - 10, Size.Height - 10);
Refresh();
FileStatusListView.BeginUpdate();

FileStatusListView.AutoResizeColumn(
0,
ColumnHeaderAutoResizeStyle.HeaderSize);
FileStatusListView.EndUpdate();
}

private void FileStatusListView_KeyDown(object sender, KeyEventArgs e)
{
switch (e.KeyCode)
Expand Down

0 comments on commit ad3f8b4

Please sign in to comment.