Fixed bug in dockers panel system that allowed the panel to go bonkers when resized smaller than possible.

This commit is contained in:
codeimp 2010-10-03 16:44:34 +00:00
parent 706317a676
commit e6d4bdb607
2 changed files with 18 additions and 9 deletions

View file

@ -409,19 +409,25 @@ namespace CodeImp.DoomBuilder.Controls
int collapsedwidth = GetCollapsedWidth();
if(rightalign)
{
this.Left += delta;
this.Width -= delta;
if(this.Width < collapsedwidth)
if((this.Width > collapsedwidth) || (delta < 0))
{
this.Left -= collapsedwidth - this.Width;
this.Width = collapsedwidth;
this.Left += delta;
this.Width -= delta;
if(this.Width < collapsedwidth)
{
this.Left -= collapsedwidth - this.Width;
this.Width = collapsedwidth;
}
}
}
else
{
this.Width += delta;
if(this.Width < collapsedwidth)
this.Width = collapsedwidth;
if((this.Width > collapsedwidth) || (delta > 0))
{
this.Width += delta;
if(this.Width < collapsedwidth)
this.Width = collapsedwidth;
}
}
General.MainWindow.UnlockUpdate();

View file

@ -2801,9 +2801,12 @@ namespace CodeImp.DoomBuilder.Windows
private void dockerspanel_UserResize(object sender, EventArgs e)
{
General.Settings.DockersWidth = dockerspanel.Width;
if(!General.Settings.CollapseDockers)
{
dockersspace.Width = dockerspanel.Width;
dockerspanel.Left = dockersspace.Left;
}
}
#endregion