Enforce minimum size for IconListView

This commit is contained in:
John Lewin 2017-09-13 11:32:29 -07:00
parent 4b2be41d0f
commit 2d43d41718

View file

@ -63,6 +63,12 @@ namespace MatterHackers.MatterControl.CustomWidgets
int newColumnCount = (int)Math.Floor(this.LocalBounds.Width / itemWidth);
int remainingSpace = (int)this.LocalBounds.Width - columnCount * itemWidth;
// Never collapse last column
if (newColumnCount < 1)
{
return;
}
// we find the space we want between each column and the sides
double spacePerColumn = remainingSpace / (newColumnCount + 1);
// set the margin to be 1/2 the space (it will happen on each side of each icon)