From 8c209367a76b82712601ee549cef150fe6518266 Mon Sep 17 00:00:00 2001 From: Souryo Date: Sat, 26 Nov 2016 20:58:27 -0500 Subject: [PATCH] Debugger: Save debugger window size & bottom panel height --- GUI.NET/Config/DebugInfo.cs | 4 ++++ GUI.NET/Debugger/frmDebugger.cs | 11 +++++++++++ 2 files changed, 15 insertions(+) diff --git a/GUI.NET/Config/DebugInfo.cs b/GUI.NET/Config/DebugInfo.cs index 611f8413..92f715cb 100644 --- a/GUI.NET/Config/DebugInfo.cs +++ b/GUI.NET/Config/DebugInfo.cs @@ -88,6 +88,10 @@ namespace Mesen.GUI.Config public int RamColumnCount = 2; public float RamFontSize = 13; + public int WindowWidth = -1; + public int WindowHeight = -1; + public int BottomPanelHeight = -1; + public DebugInfo() { LeftView = new DebugViewInfo(); diff --git a/GUI.NET/Debugger/frmDebugger.cs b/GUI.NET/Debugger/frmDebugger.cs index 03a6e2ab..c485f4da 100644 --- a/GUI.NET/Debugger/frmDebugger.cs +++ b/GUI.NET/Debugger/frmDebugger.cs @@ -46,6 +46,12 @@ namespace Mesen.GUI.Debugger this.mnuShowOnlyDisassembledCode.Checked = ConfigManager.Config.DebugInfo.ShowOnlyDisassembledCode; this.mnuShowFunctionLabelLists.Checked = ConfigManager.Config.DebugInfo.ShowFunctionLabelLists; + this.Width = ConfigManager.Config.DebugInfo.WindowWidth; + this.Height = ConfigManager.Config.DebugInfo.WindowHeight; + if(ConfigManager.Config.DebugInfo.BottomPanelHeight > 0) { + this.splitContainer.SplitterDistance = ConfigManager.Config.DebugInfo.BottomPanelHeight; + } + _lastCodeWindow = ctrlDebuggerCode; this.ctrlDebuggerCode.SetConfig(ConfigManager.Config.DebugInfo.LeftView); @@ -416,6 +422,11 @@ namespace Mesen.GUI.Debugger protected override void OnFormClosed(FormClosedEventArgs e) { + ConfigManager.Config.DebugInfo.WindowWidth = this.Width; + ConfigManager.Config.DebugInfo.WindowHeight = this.Height; + ConfigManager.Config.DebugInfo.BottomPanelHeight = this.splitContainer.SplitterDistance; + ConfigManager.ApplyChanges(); + SaveWorkspace(); foreach(Form frm in this._childForms.ToArray()) {