From e6d4bdb607cdd33b4b88af6f4e6bcc6cef31c6f9 Mon Sep 17 00:00:00 2001 From: codeimp Date: Sun, 3 Oct 2010 16:44:34 +0000 Subject: [PATCH] Fixed bug in dockers panel system that allowed the panel to go bonkers when resized smaller than possible. --- Source/Core/Controls/DockersControl.cs | 22 ++++++++++++++-------- Source/Core/Windows/MainForm.cs | 5 ++++- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/Source/Core/Controls/DockersControl.cs b/Source/Core/Controls/DockersControl.cs index 2e7cd739..f81ab15a 100644 --- a/Source/Core/Controls/DockersControl.cs +++ b/Source/Core/Controls/DockersControl.cs @@ -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(); diff --git a/Source/Core/Windows/MainForm.cs b/Source/Core/Windows/MainForm.cs index 928a31fd..35ce95d1 100644 --- a/Source/Core/Windows/MainForm.cs +++ b/Source/Core/Windows/MainForm.cs @@ -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