Enforce minimum size for IconListView
This commit is contained in:
parent
4b2be41d0f
commit
2d43d41718
1 changed files with 6 additions and 0 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue