From 1ca841ba261f9ce6880e82cdf28d78e76d92a5ed Mon Sep 17 00:00:00 2001 From: Paul Hebble Date: Wed, 25 Apr 2018 17:39:26 +0000 Subject: [PATCH] Ignore splitter exceptions --- GUI/Main.cs | 10 +++++++++- GUI/MainModInfo.Designer.cs | 4 ++-- GUI/MainModInfo.cs | 10 +++++++++- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/GUI/Main.cs b/GUI/Main.cs index b2858176bf..5835a019a3 100644 --- a/GUI/Main.cs +++ b/GUI/Main.cs @@ -280,7 +280,15 @@ protected override void OnLoad(EventArgs e) Location = configuration.WindowLoc; Size = configuration.WindowSize; WindowState = configuration.IsWindowMaximised ? FormWindowState.Maximized : FormWindowState.Normal; - splitContainer1.SplitterDistance = configuration.PanelPosition; + try + { + splitContainer1.SplitterDistance = configuration.PanelPosition; + } + catch + { + // SplitContainer is mis-designed to throw exceptions + // if the min/max limits are exceeded rather than simply obeying them. + } ModInfoTabControl.ModMetaSplitPosition = configuration.ModInfoPosition; if (!configuration.CheckForUpdatesOnLaunchNoNag && AutoUpdate.CanUpdate) diff --git a/GUI/MainModInfo.Designer.cs b/GUI/MainModInfo.Designer.cs index be29518d4f..d49c4e6eee 100644 --- a/GUI/MainModInfo.Designer.cs +++ b/GUI/MainModInfo.Designer.cs @@ -109,12 +109,12 @@ private void InitializeComponent() // splitContainer2.Panel1 // this.splitContainer2.Panel1.Controls.Add(this.MetaDataUpperLayoutPanel); - this.splitContainer2.Panel1MinSize = 100; + this.splitContainer2.Panel1MinSize = 75; // // splitContainer2.Panel2 // this.splitContainer2.Panel2.Controls.Add(this.MetaDataLowerLayoutPanel); - this.splitContainer2.Panel2MinSize = 300; + this.splitContainer2.Panel2MinSize = 225; this.splitContainer2.Size = new System.Drawing.Size(348, 496); this.splitContainer2.SplitterWidth = 10; this.splitContainer2.SplitterDistance = 235; diff --git a/GUI/MainModInfo.cs b/GUI/MainModInfo.cs index b10d8ceaa0..a70c84ed0d 100644 --- a/GUI/MainModInfo.cs +++ b/GUI/MainModInfo.cs @@ -69,7 +69,15 @@ public int ModMetaSplitPosition } set { - this.splitContainer2.SplitterDistance = value; + try + { + this.splitContainer2.SplitterDistance = value; + } + catch + { + // SplitContainer is mis-designed to throw exceptions + // if the min/max limits are exceeded rather than simply obeying them. + } } }