mirror of
https://github.com/libretro/Mesen.git
synced 2024-12-16 13:56:48 +00:00
UI: Save/restore window position
This commit is contained in:
parent
91b93a9cf3
commit
682b6d1d36
@ -1,5 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Drawing;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
@ -29,6 +30,7 @@ namespace Mesen.GUI.Config
|
|||||||
public PlayerProfile Profile;
|
public PlayerProfile Profile;
|
||||||
public DebugInfo DebugInfo;
|
public DebugInfo DebugInfo;
|
||||||
public AviRecordInfo AviRecordInfo;
|
public AviRecordInfo AviRecordInfo;
|
||||||
|
public Point? WindowLocation;
|
||||||
|
|
||||||
public Configuration()
|
public Configuration()
|
||||||
{
|
{
|
||||||
|
@ -48,6 +48,11 @@ namespace Mesen.GUI.Forms
|
|||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
|
if(ConfigManager.Config.WindowLocation.HasValue) {
|
||||||
|
this.StartPosition = FormStartPosition.Manual;
|
||||||
|
this.Location = ConfigManager.Config.WindowLocation.Value;
|
||||||
|
}
|
||||||
|
|
||||||
_commandLineArgs = args;
|
_commandLineArgs = args;
|
||||||
|
|
||||||
Application.AddMessageFilter(this);
|
Application.AddMessageFilter(this);
|
||||||
@ -175,6 +180,11 @@ namespace Mesen.GUI.Forms
|
|||||||
|
|
||||||
ConfigManager.Config.EmulationInfo.EmulationSpeed = InteropEmu.GetEmulationSpeed();
|
ConfigManager.Config.EmulationInfo.EmulationSpeed = InteropEmu.GetEmulationSpeed();
|
||||||
ConfigManager.Config.VideoInfo.VideoScale = _regularScale;
|
ConfigManager.Config.VideoInfo.VideoScale = _regularScale;
|
||||||
|
if(this.WindowState == FormWindowState.Normal) {
|
||||||
|
ConfigManager.Config.WindowLocation = this.Location;
|
||||||
|
} else {
|
||||||
|
ConfigManager.Config.WindowLocation = this.RestoreBounds.Location;
|
||||||
|
}
|
||||||
ConfigManager.ApplyChanges();
|
ConfigManager.ApplyChanges();
|
||||||
|
|
||||||
StopEmu();
|
StopEmu();
|
||||||
|
Loading…
Reference in New Issue
Block a user