Revert Maximized = Fullscreen changes, fixes #20

This commit is contained in:
Evan Husted 2024-10-21 02:42:32 -05:00
parent f3efada444
commit 509f6d738c
4 changed files with 14 additions and 16 deletions

View file

@ -964,10 +964,10 @@ namespace Ryujinx.Ava
{
if (_viewModel.StartGamesInFullscreen)
{
_viewModel.WindowState = MainWindow.FullScreenWindowState;
_viewModel.WindowState = WindowState.FullScreen;
}
if (_viewModel.WindowState == MainWindow.FullScreenWindowState)
if (_viewModel.WindowState is WindowState.FullScreen)
{
_viewModel.ShowMenuAndStatusBar = false;
}
@ -1138,7 +1138,7 @@ namespace Ryujinx.Ava
Dispatcher.UIThread.Post(() =>
{
if (_keyboardInterface.GetKeyboardStateSnapshot().IsPressed(Key.Delete) && _viewModel.WindowState != MainWindow.FullScreenWindowState)
if (_keyboardInterface.GetKeyboardStateSnapshot().IsPressed(Key.Delete) && _viewModel.WindowState is not WindowState.FullScreen)
{
Device.Processes.ActiveApplication.DiskCacheLoadState?.Cancel();
}

View file

@ -1426,7 +1426,7 @@ namespace Ryujinx.Ava.UI.ViewModels
public async Task ExitCurrentState()
{
if (WindowState == MainWindow.FullScreenWindowState)
if (WindowState is WindowState.FullScreen)
{
ToggleFullscreen();
}
@ -1754,7 +1754,7 @@ namespace Ryujinx.Ava.UI.ViewModels
}
else
{
WindowState = MainWindow.FullScreenWindowState;
WindowState = WindowState.FullScreen;
if (IsGameRunning)
{
@ -1762,7 +1762,7 @@ namespace Ryujinx.Ava.UI.ViewModels
}
}
IsFullScreen = WindowState == MainWindow.FullScreenWindowState;
IsFullScreen = WindowState is WindowState.FullScreen;
}
public static void SaveConfig()

View file

@ -67,14 +67,6 @@ namespace Ryujinx.Ava.UI.Windows
public readonly double StatusBarHeight;
public readonly double MenuBarHeight;
// The special window decoration from AppWindow in FluentAvalonia is only present on Windows;
// and as such optimizing for the fact that the menu bar and the title bar are the same is only needed on Windows.
// Maximized is considered superior to FullScreen on Windows in this case because you get the benefits of being in full screen,
// while still being able to use the standard 3 window controls in the top right to minimize, make the window smaller, or close the app.
public static readonly WindowState FullScreenWindowState =
OperatingSystem.IsWindows() ? WindowState.Maximized : WindowState.FullScreen;
public MainWindow()
{
DataContext = ViewModel = new MainWindowViewModel
@ -193,7 +185,7 @@ namespace Ryujinx.Ava.UI.Windows
ViewModel.ShowContent = true;
ViewModel.IsLoadingIndeterminate = false;
if (startFullscreen && ViewModel.WindowState != MainWindow.FullScreenWindowState)
if (startFullscreen && ViewModel.WindowState is not WindowState.FullScreen)
{
ViewModel.ToggleFullscreen();
}
@ -205,7 +197,7 @@ namespace Ryujinx.Ava.UI.Windows
ViewModel.ShowLoadProgress = true;
ViewModel.IsLoadingIndeterminate = true;
if (startFullscreen && ViewModel.WindowState != MainWindow.FullScreenWindowState)
if (startFullscreen && ViewModel.WindowState is not WindowState.FullScreen)
{
ViewModel.ToggleFullscreen();
}