mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-07-10 06:56:27 +02:00
UI: Fix some MainWindow bugs and implement menubar items to change window size. (#6750)
* Do not save window dimensions when maximized. * Implement option to disable window size/position memory. * Remove logging statements * Implement menubar items for common window sizes. * formatting fixes * Set 720p window as a composite value. * Remove unused using * Fix exception paramter. * Force restore window when a size change is requested * Fix some resizing bugs.
This commit is contained in:
parent
65c035cdf8
commit
d0cc13ce0b
8 changed files with 103 additions and 10 deletions
|
@ -1,6 +1,7 @@
|
|||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Interactivity;
|
||||
using Avalonia.Threading;
|
||||
using LibHac.Ncm;
|
||||
using LibHac.Tools.FsSystem.NcaUtils;
|
||||
using Ryujinx.Ava.Common.Locale;
|
||||
|
@ -211,6 +212,40 @@ namespace Ryujinx.Ava.UI.Views.Main
|
|||
}
|
||||
}
|
||||
|
||||
private async void ChangeWindowSize_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (sender is MenuItem item)
|
||||
{
|
||||
int height;
|
||||
int width;
|
||||
|
||||
switch (item.Tag)
|
||||
{
|
||||
case "720":
|
||||
height = 720;
|
||||
width = 1280;
|
||||
break;
|
||||
|
||||
case "1080":
|
||||
height = 1080;
|
||||
width = 1920;
|
||||
break;
|
||||
|
||||
default:
|
||||
throw new ArgumentNullException($"Invalid Tag for {item}");
|
||||
}
|
||||
|
||||
await Dispatcher.UIThread.InvokeAsync(() =>
|
||||
{
|
||||
ViewModel.WindowState = WindowState.Normal;
|
||||
|
||||
height += (int)Window.StatusBarHeight + (int)Window.MenuBarHeight;
|
||||
|
||||
Window.Arrange(new Rect(Window.Position.X, Window.Position.Y, width, height));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public async void CheckForUpdates(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (Updater.CanUpdate(true))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue