Debugger: Performance fixes

This commit is contained in:
Sour 2018-01-03 19:12:02 -05:00
parent cdaba3ffe8
commit e7fbff9996
3 changed files with 13 additions and 8 deletions

View file

@ -83,11 +83,12 @@ namespace Mesen.GUI.Debugger.Controls
private void UpdateList(List<StackInfo> 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()

View file

@ -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)

View file

@ -35,6 +35,7 @@ namespace Mesen.GUI.Debugger
{
base.OnShown(e);
tlpMain.SuspendLayout();
int i = 0;
foreach(KeyValuePair<string, string> 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;
}