Move MainForm's Save Window Position to DisplayConfig, add Stay on Top

This commit is contained in:
YoshiRulz 2022-06-10 04:13:57 +10:00
parent 3f8301509a
commit 2d015515b2
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
7 changed files with 42 additions and 18 deletions

View File

@ -102,6 +102,7 @@ namespace BizHawk.Client.Common
public RecentFiles RecentRoms { get; set; } = new RecentFiles(10);
public bool PauseWhenMenuActivated { get; set; } = true;
public bool SaveWindowPosition { get; set; } = true;
public bool MainFormStayOnTop { get; set; }
public bool StartPaused { get; set; }
public bool StartFullscreen { get; set; }
public int MainWndx { get; set; } = -1; // Negative numbers will be ignored

View File

@ -2422,7 +2422,7 @@ namespace BizHawk.Client.EmuHawk
private void DisplayConfigMenuItem_Click(object sender, EventArgs e)
{
using var window = new DisplayConfig(Config, GL);
if (window.ShowDialog().IsOk())
if (this.ShowDialogWithTempMute(window).IsOk())
{
DisplayManager.RefreshUserShader();
FrameBufferResized();

View File

@ -540,6 +540,8 @@ namespace BizHawk.Client.EmuHawk
Location = new Point(Config.MainWndx, Config.MainWndy);
}
if (Config.MainFormStayOnTop) TopMost = true;
if (_argParser.cmdRom != null)
{
// Commandline should always override auto-load

View File

@ -111,6 +111,8 @@
this.cbCaptionWindowed = new System.Windows.Forms.CheckBox();
this.linkLabel1 = new System.Windows.Forms.LinkLabel();
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
this.cbMainFormSaveWindowPosition = new System.Windows.Forms.CheckBox();
this.cbMainFormStayOnTop = new System.Windows.Forms.CheckBox();
this.groupBox1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.tbScanlineIntensity)).BeginInit();
this.grpFinalFilter.SuspendLayout();
@ -807,7 +809,7 @@
this.groupBox4.Controls.Add(this.cbFullscreenHacks);
this.groupBox4.Controls.Add(this.cbStatusBarFullscreen);
this.groupBox4.Controls.Add(this.cbMenuFullscreen);
this.groupBox4.Location = new System.Drawing.Point(143, 6);
this.groupBox4.Location = new System.Drawing.Point(153, 6);
this.groupBox4.Name = "groupBox4";
this.groupBox4.Size = new System.Drawing.Size(266, 211);
this.groupBox4.TabIndex = 27;
@ -862,6 +864,8 @@
//
// groupBox2
//
this.groupBox2.Controls.Add(this.cbMainFormStayOnTop);
this.groupBox2.Controls.Add(this.cbMainFormSaveWindowPosition);
this.groupBox2.Controls.Add(this.lblFrameTypeWindowed);
this.groupBox2.Controls.Add(this.cbStatusBarWindowed);
this.groupBox2.Controls.Add(this.label9);
@ -870,7 +874,7 @@
this.groupBox2.Controls.Add(this.cbCaptionWindowed);
this.groupBox2.Location = new System.Drawing.Point(6, 6);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(131, 211);
this.groupBox2.Size = new System.Drawing.Size(141, 211);
this.groupBox2.TabIndex = 26;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "Windowed";
@ -939,6 +943,26 @@
this.linkLabel1.Text = "Documentation";
this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.LinkLabel1_LinkClicked);
//
// cbMainFormSaveWindowPosition
//
this.cbMainFormSaveWindowPosition.AutoSize = true;
this.cbMainFormSaveWindowPosition.Location = new System.Drawing.Point(9, 150);
this.cbMainFormSaveWindowPosition.Name = "cbMainFormSaveWindowPosition";
this.cbMainFormSaveWindowPosition.Size = new System.Drawing.Size(133, 17);
this.cbMainFormSaveWindowPosition.TabIndex = 26;
this.cbMainFormSaveWindowPosition.Text = "Save Window Position";
this.cbMainFormSaveWindowPosition.UseVisualStyleBackColor = true;
//
// cbMainFormStayOnTop
//
this.cbMainFormStayOnTop.AutoSize = true;
this.cbMainFormStayOnTop.Location = new System.Drawing.Point(9, 174);
this.cbMainFormStayOnTop.Name = "cbMainFormStayOnTop";
this.cbMainFormStayOnTop.Size = new System.Drawing.Size(84, 17);
this.cbMainFormStayOnTop.TabIndex = 27;
this.cbMainFormStayOnTop.Text = "Stay on Top";
this.cbMainFormStayOnTop.UseVisualStyleBackColor = true;
//
// DisplayConfigLite
//
this.AcceptButton = this.btnOk;
@ -1071,5 +1095,7 @@
private WinForms.Controls.LocSzSingleColumnFLP flpStaticWindowTitles;
private WinForms.Controls.CheckBoxEx cbStaticWindowTitles;
private WinForms.Controls.LocLabelEx lblStaticWindowTitles;
private System.Windows.Forms.CheckBox cbMainFormStayOnTop;
private System.Windows.Forms.CheckBox cbMainFormSaveWindowPosition;
}
}

10
src/BizHawk.Client.EmuHawk/config/DisplayConfig.cs Normal file → Executable file
View File

@ -59,6 +59,13 @@ namespace BizHawk.Client.EmuHawk
cbStatusBarWindowed.Checked = _config.DispChromeStatusBarWindowed;
cbCaptionWindowed.Checked = _config.DispChromeCaptionWindowed;
cbMenuWindowed.Checked = _config.DispChromeMenuWindowed;
cbMainFormSaveWindowPosition.Checked = _config.SaveWindowPosition;
cbMainFormStayOnTop.Checked = _config.MainFormStayOnTop;
if (OSTailoredCode.IsUnixHost)
{
cbMainFormStayOnTop.Enabled = false;
cbMainFormStayOnTop.Visible = false;
}
cbStatusBarFullscreen.Checked = _config.DispChromeStatusBarFullscreen;
cbMenuFullscreen.Checked = _config.DispChromeMenuFullscreen;
trackbarFrameSizeWindowed.Value = _config.DispChromeFrameWindowed;
@ -135,6 +142,9 @@ namespace BizHawk.Client.EmuHawk
_config.DispChromeStatusBarWindowed = cbStatusBarWindowed.Checked;
_config.DispChromeCaptionWindowed = cbCaptionWindowed.Checked;
_config.DispChromeMenuWindowed = cbMenuWindowed.Checked;
_config.SaveWindowPosition = cbMainFormSaveWindowPosition.Checked;
_config.MainFormStayOnTop = cbMainFormStayOnTop.Checked;
Owner.TopMost = _config.MainFormStayOnTop;
_config.DispChromeStatusBarFullscreen = cbStatusBarFullscreen.Checked;
_config.DispChromeMenuFullscreen = cbMenuFullscreen.Checked;
_config.DispChromeFrameWindowed = trackbarFrameSizeWindowed.Value;

View File

@ -40,7 +40,6 @@
this.AcceptBackgroundInputControllerOnlyCheckBox = new System.Windows.Forms.CheckBox();
this.label1 = new BizHawk.WinForms.Controls.LocLabelEx();
this.RunInBackgroundCheckbox = new System.Windows.Forms.CheckBox();
this.SaveWindowPositionCheckbox = new System.Windows.Forms.CheckBox();
this.EnableContextMenuCheckbox = new System.Windows.Forms.CheckBox();
this.PauseWhenMenuActivatedCheckbox = new System.Windows.Forms.CheckBox();
this.groupBox3 = new System.Windows.Forms.GroupBox();
@ -135,7 +134,6 @@
this.tabPage1.Controls.Add(this.AcceptBackgroundInputControllerOnlyCheckBox);
this.tabPage1.Controls.Add(this.label1);
this.tabPage1.Controls.Add(this.RunInBackgroundCheckbox);
this.tabPage1.Controls.Add(this.SaveWindowPositionCheckbox);
this.tabPage1.Controls.Add(this.EnableContextMenuCheckbox);
this.tabPage1.Controls.Add(this.PauseWhenMenuActivatedCheckbox);
this.tabPage1.Controls.Add(this.groupBox3);
@ -212,16 +210,6 @@
this.RunInBackgroundCheckbox.Text = "Run in background";
this.RunInBackgroundCheckbox.UseVisualStyleBackColor = true;
//
// SaveWindowPositionCheckbox
//
this.SaveWindowPositionCheckbox.AutoSize = true;
this.SaveWindowPositionCheckbox.Location = new System.Drawing.Point(196, 29);
this.SaveWindowPositionCheckbox.Name = "SaveWindowPositionCheckbox";
this.SaveWindowPositionCheckbox.Size = new System.Drawing.Size(133, 17);
this.SaveWindowPositionCheckbox.TabIndex = 19;
this.SaveWindowPositionCheckbox.Text = "Save Window Position";
this.SaveWindowPositionCheckbox.UseVisualStyleBackColor = true;
//
// EnableContextMenuCheckbox
//
this.EnableContextMenuCheckbox.AutoSize = true;
@ -655,7 +643,6 @@
private System.Windows.Forms.CheckBox AcceptBackgroundInputControllerOnlyCheckBox;
private BizHawk.WinForms.Controls.LocLabelEx label1;
private System.Windows.Forms.CheckBox RunInBackgroundCheckbox;
private System.Windows.Forms.CheckBox SaveWindowPositionCheckbox;
private System.Windows.Forms.CheckBox EnableContextMenuCheckbox;
private System.Windows.Forms.CheckBox PauseWhenMenuActivatedCheckbox;
private System.Windows.Forms.GroupBox groupBox3;

2
src/BizHawk.Client.EmuHawk/config/EmuHawkOptions.cs Normal file → Executable file
View File

@ -64,7 +64,6 @@ namespace BizHawk.Client.EmuHawk
StartPausedCheckbox.Checked = _config.StartPaused;
PauseWhenMenuActivatedCheckbox.Checked = _config.PauseWhenMenuActivated;
EnableContextMenuCheckbox.Checked = _config.ShowContextMenu;
SaveWindowPositionCheckbox.Checked = _config.SaveWindowPosition;
RunInBackgroundCheckbox.Checked = _config.RunInBackground;
AcceptBackgroundInputCheckbox.Checked = _config.AcceptBackgroundInput;
AcceptBackgroundInputControllerOnlyCheckBox.Checked = _config.AcceptBackgroundInputControllerOnly;
@ -128,7 +127,6 @@ namespace BizHawk.Client.EmuHawk
_config.StartPaused = StartPausedCheckbox.Checked;
_config.PauseWhenMenuActivated = PauseWhenMenuActivatedCheckbox.Checked;
_config.ShowContextMenu = EnableContextMenuCheckbox.Checked;
_config.SaveWindowPosition = SaveWindowPositionCheckbox.Checked;
_config.RunInBackground = RunInBackgroundCheckbox.Checked;
_config.AcceptBackgroundInput = AcceptBackgroundInputCheckbox.Checked;
_config.AcceptBackgroundInputControllerOnly = AcceptBackgroundInputControllerOnlyCheckBox.Checked;