diff --git a/GUI.NET/Debugger/Controls/ctrlCallstack.cs b/GUI.NET/Debugger/Controls/ctrlCallstack.cs index d8c7958e..f4a0154d 100644 --- a/GUI.NET/Debugger/Controls/ctrlCallstack.cs +++ b/GUI.NET/Debugger/Controls/ctrlCallstack.cs @@ -83,11 +83,12 @@ namespace Mesen.GUI.Debugger.Controls private void UpdateList(List stack) { - if(this.lstCallstack.Items.Count != stack.Count) { - this.lstCallstack.Items.Clear(); - for(int i = 0, len = stack.Count; i < len; i++) { - this.lstCallstack.Items.Add("").SubItems.AddRange(new string[] { "", "" }); - } + this.lstCallstack.BeginUpdate(); + while(this.lstCallstack.Items.Count > stack.Count) { + this.lstCallstack.Items.RemoveAt(this.lstCallstack.Items.Count - 1); + } + while(this.lstCallstack.Items.Count < stack.Count) { + this.lstCallstack.Items.Add("").SubItems.AddRange(new string[] { "", "" }); } for(int i = 0, len = stack.Count; i < len; i++) { @@ -106,6 +107,7 @@ namespace Mesen.GUI.Debugger.Controls item.Font = new Font(item.Font, FontStyle.Regular); } } + this.lstCallstack.EndUpdate(); } private void UpdateList() diff --git a/GUI.NET/Debugger/Controls/ctrlDebuggerCode.cs b/GUI.NET/Debugger/Controls/ctrlDebuggerCode.cs index 81840b86..b5f9a81e 100644 --- a/GUI.NET/Debugger/Controls/ctrlDebuggerCode.cs +++ b/GUI.NET/Debugger/Controls/ctrlDebuggerCode.cs @@ -786,8 +786,10 @@ namespace Mesen.GUI.Debugger private void ctrlCodeViewer_FontSizeChanged(object sender, EventArgs e) { - _config.FontSize = this.FontSize; - UpdateConfig(); + if(_config.FontSize != this.FontSize) { + _config.FontSize = this.FontSize; + UpdateConfig(); + } } private void mnuEditLabel_Click(object sender, EventArgs e) diff --git a/GUI.NET/Debugger/frmCodeTooltip.cs b/GUI.NET/Debugger/frmCodeTooltip.cs index 16c67670..76153f84 100644 --- a/GUI.NET/Debugger/frmCodeTooltip.cs +++ b/GUI.NET/Debugger/frmCodeTooltip.cs @@ -35,6 +35,7 @@ namespace Mesen.GUI.Debugger { base.OnShown(e); + tlpMain.SuspendLayout(); int i = 0; foreach(KeyValuePair kvp in _values) { tlpMain.RowStyles.Insert(1, new RowStyle()); @@ -74,7 +75,7 @@ namespace Mesen.GUI.Debugger tlpMain.SetColumnSpan(codeWindow, 2); tlpMain.Controls.Add(codeWindow); } - + tlpMain.ResumeLayout(); this.Width = this.tlpMain.Width; this.Height = this.tlpMain.Height; }