Debugger: Make event viewer color config window non-modal

This commit is contained in:
Sour 2018-03-15 19:15:48 -04:00
parent b6e10bc810
commit a68b28c06e
3 changed files with 15 additions and 3 deletions

View File

@ -162,11 +162,15 @@ namespace Mesen.GUI.Debugger
private void mnuConfigureColors_Click(object sender, EventArgs e)
{
using(frmEventViewerColors frm = new frmEventViewerColors()) {
if(frm.ShowDialog(this, this) == DialogResult.OK) {
if(frmEventViewerColors.Instance != null) {
frmEventViewerColors.Instance.BringToFront();
} else {
frmEventViewerColors frm = new frmEventViewerColors();
frm.Show(this, this);
frm.FormClosed += (s, evt) => {
this.GetData();
this.RefreshViewer();
}
};
}
}

View File

@ -529,6 +529,9 @@
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(406, 378);
this.Controls.Add(this.tableLayoutPanel1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "frmEventViewerColors";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Configure Colors...";

View File

@ -14,10 +14,13 @@ namespace Mesen.GUI.Debugger
{
public partial class frmEventViewerColors : BaseConfigForm
{
public static frmEventViewerColors Instance { get; private set; }
public frmEventViewerColors()
{
InitializeComponent();
Instance = this;
picMapperWrite.BackColor = ConfigManager.Config.DebugInfo.EventViewerMapperRegisterWriteColor;
picMapperRead.BackColor = ConfigManager.Config.DebugInfo.EventViewerMapperRegisterReadColor;
@ -78,6 +81,8 @@ namespace Mesen.GUI.Debugger
ConfigManager.ApplyChanges();
}
Instance = null;
}
private void btnReset_Click(object sender, EventArgs e)