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