mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2025-01-16 07:30:32 +00:00
Update MainWindow.cs
This commit is contained in:
parent
fd879f34f4
commit
5cb50f531c
1 changed files with 26 additions and 2 deletions
|
@ -152,8 +152,10 @@ namespace Ryujinx.Ui
|
||||||
int monitorWidth = monitor.Geometry.Width * monitor.ScaleFactor;
|
int monitorWidth = monitor.Geometry.Width * monitor.ScaleFactor;
|
||||||
int monitorHeight = monitor.Geometry.Height * monitor.ScaleFactor;
|
int monitorHeight = monitor.Geometry.Height * monitor.ScaleFactor;
|
||||||
|
|
||||||
DefaultWidth = monitorWidth < 1280 ? monitorWidth : 1280;
|
DefaultWidth = monitorWidth < 1280 ? monitorWidth : ConfigurationState.Instance.Ui.WindowSizeWidth;
|
||||||
DefaultHeight = monitorHeight < 760 ? monitorHeight : 760;
|
DefaultHeight = monitorHeight < 760 ? monitorHeight : ConfigurationState.Instance.Ui.WindowSizeHeight;
|
||||||
|
Move(ConfigurationState.Instance.Ui.WindowPositionX,ConfigurationState.Instance.Ui.WindowPositionY);
|
||||||
|
if (ConfigurationState.Instance.Ui.WindowMaximized == true) { Maximize(); };
|
||||||
|
|
||||||
Icon = new Gdk.Pixbuf(Assembly.GetAssembly(typeof(ConfigurationState)), "Ryujinx.Ui.Common.Resources.Logo_Ryujinx.png");
|
Icon = new Gdk.Pixbuf(Assembly.GetAssembly(typeof(ConfigurationState)), "Ryujinx.Ui.Common.Resources.Logo_Ryujinx.png");
|
||||||
Title = $"Ryujinx {Program.Version}";
|
Title = $"Ryujinx {Program.Version}";
|
||||||
|
@ -1297,10 +1299,30 @@ namespace Ryujinx.Ui
|
||||||
OpenHelper.OpenFolder(logPath);
|
OpenHelper.OpenFolder(logPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void SaveWindowSizePosition()
|
||||||
|
{
|
||||||
|
int windowWidth;
|
||||||
|
int windowHeight;
|
||||||
|
int windowXPos;
|
||||||
|
int windowYPos;
|
||||||
|
|
||||||
|
GetSize(out windowWidth, out windowHeight);
|
||||||
|
GetPosition(out windowXPos, out windowYPos);
|
||||||
|
|
||||||
|
ConfigurationState.Instance.Ui.WindowMaximized.Value = IsMaximized;
|
||||||
|
ConfigurationState.Instance.Ui.WindowSizeWidth.Value = windowWidth;
|
||||||
|
ConfigurationState.Instance.Ui.WindowSizeHeight.Value = windowHeight;
|
||||||
|
ConfigurationState.Instance.Ui.WindowPositionX.Value = windowXPos;
|
||||||
|
ConfigurationState.Instance.Ui.WindowPositionY.Value = windowYPos;
|
||||||
|
|
||||||
|
SaveConfig();
|
||||||
|
}
|
||||||
|
|
||||||
private void Exit_Pressed(object sender, EventArgs args)
|
private void Exit_Pressed(object sender, EventArgs args)
|
||||||
{
|
{
|
||||||
if (!_gameLoaded || !ConfigurationState.Instance.ShowConfirmExit || GtkDialog.CreateExitDialog())
|
if (!_gameLoaded || !ConfigurationState.Instance.ShowConfirmExit || GtkDialog.CreateExitDialog())
|
||||||
{
|
{
|
||||||
|
SaveWindowSizePosition();
|
||||||
End();
|
End();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1309,6 +1331,8 @@ namespace Ryujinx.Ui
|
||||||
{
|
{
|
||||||
if (!_gameLoaded || !ConfigurationState.Instance.ShowConfirmExit || GtkDialog.CreateExitDialog())
|
if (!_gameLoaded || !ConfigurationState.Instance.ShowConfirmExit || GtkDialog.CreateExitDialog())
|
||||||
{
|
{
|
||||||
|
|
||||||
|
SaveWindowSizePosition();
|
||||||
End();
|
End();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue