[Ryujinx.Ava] Address dotnet-format issues (#5361)
* dotnet format style --severity info Some changes were manually reverted. * dotnet format analyzers --serverity info Some changes have been minimally adapted. * Restore a few unused methods and variables * Silence dotnet format IDE0060 warnings * Silence dotnet format IDE0052 warnings * Silence dotnet format IDE0059 warnings * Address or silence dotnet format IDE1006 warnings * Address dotnet format CA1816 warnings * Address dotnet format CA1822 warnings * Address or silence dotnet format CA1069 warnings * Make dotnet format succeed in style mode * Address dotnet format CA1401 warnings * Address remaining dotnet format analyzer warnings * Address review comments * dotnet-format fixes after rebase * Address most dotnet format whitespace warnings * Apply dotnet format whitespace formatting A few of them have been manually reverted and the corresponding warning was silenced * Format if-blocks correctly * Another rebase, another dotnet format run * Run dotnet format whitespace after rebase * Run dotnet format style after rebase * Run dotnet format after rebase and remove unused usings - analyzers - style - whitespace * Add comments to disabled warnings * Remove a few unused parameters * Simplify properties and array initialization, Use const when possible, Remove trailing commas * Start working on disabled warnings * Fix and silence a few dotnet-format warnings again * Address IDE0260 warnings * Address a few disabled IDE0060 warnings * Silence IDE0060 in .editorconfig * Revert "Simplify properties and array initialization, Use const when possible, Remove trailing commas" This reverts commit 9462e4136c0a2100dc28b20cf9542e06790aa67e. * dotnet format whitespace after rebase * dotnet format pass with new editorconfig * Fix naming style issues * Apply suggestions from code review Co-authored-by: Ac_K <Acoustik666@gmail.com> * Revert one suggestion * Second dotnet format pass and fix build issues * Final pass of dotnet format * Add trailing commas * Fix formatting issues * Keep unnecessary assignment in IconColorPicker.cs * Use using declarations and extend resource lifetimes * Fix rebase issues * Adjust comment spacing * Fix typo * Fix naming issues * Apply suggestions from code review Co-authored-by: Ac_K <Acoustik666@gmail.com> * Revert unintentional change * Remove unused file * Remove static keyword from ViewModels Binding of static members doesn't work and is silently ignored. --------- Co-authored-by: Ac_K <Acoustik666@gmail.com>
This commit is contained in:
parent
8a363b5df2
commit
6c515e1822
108 changed files with 1140 additions and 1503 deletions
|
@ -155,7 +155,7 @@ namespace Ryujinx.Ava.UI.Windows
|
|||
|
||||
Dispatcher.UIThread.Post(() =>
|
||||
{
|
||||
ViewModel.StatusBarProgressValue = e.NumAppsLoaded;
|
||||
ViewModel.StatusBarProgressValue = e.NumAppsLoaded;
|
||||
ViewModel.StatusBarProgressMaximum = e.NumAppsFound;
|
||||
|
||||
if (e.NumAppsFound == 0)
|
||||
|
@ -323,7 +323,7 @@ namespace Ryujinx.Ava.UI.Windows
|
|||
ShowKeyErrorOnLoad = false;
|
||||
|
||||
Dispatcher.UIThread.Post(async () => await
|
||||
UserErrorDialog.ShowUserErrorDialog(UserError.NoKeys, this));
|
||||
UserErrorDialog.ShowUserErrorDialog(UserError.NoKeys));
|
||||
}
|
||||
|
||||
if (OperatingSystem.IsLinux() && LinuxHelper.VmMaxMapCount < LinuxHelper.RecommendedVmMaxMapCount)
|
||||
|
@ -373,24 +373,26 @@ namespace Ryujinx.Ava.UI.Windows
|
|||
|
||||
private void SetWindowSizePosition()
|
||||
{
|
||||
PixelPoint SavedPoint = new PixelPoint(ConfigurationState.Instance.Ui.WindowStartup.WindowPositionX,
|
||||
PixelPoint savedPoint = new(ConfigurationState.Instance.Ui.WindowStartup.WindowPositionX,
|
||||
ConfigurationState.Instance.Ui.WindowStartup.WindowPositionY);
|
||||
|
||||
ViewModel.WindowHeight = ConfigurationState.Instance.Ui.WindowStartup.WindowSizeHeight * Program.WindowScaleFactor;
|
||||
ViewModel.WindowWidth = ConfigurationState.Instance.Ui.WindowStartup.WindowSizeWidth * Program.WindowScaleFactor;
|
||||
|
||||
ViewModel.WindowState = ConfigurationState.Instance.Ui.WindowStartup.WindowMaximized.Value is true ? WindowState.Maximized : WindowState.Normal;
|
||||
|
||||
if (CheckScreenBounds(SavedPoint))
|
||||
{
|
||||
Position = SavedPoint;
|
||||
}
|
||||
|
||||
else WindowStartupLocation = WindowStartupLocation.CenterScreen;
|
||||
if (CheckScreenBounds(savedPoint))
|
||||
{
|
||||
Position = savedPoint;
|
||||
}
|
||||
else
|
||||
{
|
||||
WindowStartupLocation = WindowStartupLocation.CenterScreen;
|
||||
}
|
||||
}
|
||||
|
||||
private bool CheckScreenBounds(PixelPoint configPoint)
|
||||
{
|
||||
{
|
||||
for (int i = 0; i < Screens.ScreenCount; i++)
|
||||
{
|
||||
if (Screens.All[i].Bounds.Contains(configPoint))
|
||||
|
@ -399,7 +401,7 @@ namespace Ryujinx.Ava.UI.Windows
|
|||
}
|
||||
}
|
||||
|
||||
Logger.Warning?.Print(LogClass.Application, $"Failed to find valid start-up coordinates. Defaulting to primary monitor center.");
|
||||
Logger.Warning?.Print(LogClass.Application, "Failed to find valid start-up coordinates. Defaulting to primary monitor center.");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -425,10 +427,7 @@ namespace Ryujinx.Ava.UI.Windows
|
|||
|
||||
private void SetMainContent(Control content = null)
|
||||
{
|
||||
if (content == null)
|
||||
{
|
||||
content = GameLibrary;
|
||||
}
|
||||
content ??= GameLibrary;
|
||||
|
||||
if (MainContent.Content != content)
|
||||
{
|
||||
|
@ -438,21 +437,25 @@ namespace Ryujinx.Ava.UI.Windows
|
|||
|
||||
public static void UpdateGraphicsConfig()
|
||||
{
|
||||
#pragma warning disable IDE0055 // Disable formatting
|
||||
GraphicsConfig.ResScale = ConfigurationState.Instance.Graphics.ResScale == -1 ? ConfigurationState.Instance.Graphics.ResScaleCustom : ConfigurationState.Instance.Graphics.ResScale;
|
||||
GraphicsConfig.MaxAnisotropy = ConfigurationState.Instance.Graphics.MaxAnisotropy;
|
||||
GraphicsConfig.ShadersDumpPath = ConfigurationState.Instance.Graphics.ShadersDumpPath;
|
||||
GraphicsConfig.EnableShaderCache = ConfigurationState.Instance.Graphics.EnableShaderCache;
|
||||
GraphicsConfig.EnableTextureRecompression = ConfigurationState.Instance.Graphics.EnableTextureRecompression;
|
||||
GraphicsConfig.EnableMacroHLE = ConfigurationState.Instance.Graphics.EnableMacroHLE;
|
||||
#pragma warning restore IDE0055
|
||||
}
|
||||
|
||||
public void LoadHotKeys()
|
||||
{
|
||||
#pragma warning disable IDE0055 // Disable formatting
|
||||
HotKeyManager.SetHotKey(FullscreenHotKey, new KeyGesture(Key.Enter, KeyModifiers.Alt));
|
||||
HotKeyManager.SetHotKey(FullscreenHotKey2, new KeyGesture(Key.F11));
|
||||
HotKeyManager.SetHotKey(FullscreenHotKeyMacOS, new KeyGesture(Key.F, KeyModifiers.Control | KeyModifiers.Meta));
|
||||
HotKeyManager.SetHotKey(DockToggleHotKey, new KeyGesture(Key.F9));
|
||||
HotKeyManager.SetHotKey(ExitHotKey, new KeyGesture(Key.Escape));
|
||||
#pragma warning restore IDE0055
|
||||
}
|
||||
|
||||
private void VolumeStatus_CheckedChanged(object sender, SplitButtonClickEventArgs e)
|
||||
|
@ -536,8 +539,8 @@ namespace Ryujinx.Ava.UI.Windows
|
|||
ViewModel.Applications.Clear();
|
||||
|
||||
StatusBarView.LoadProgressBar.IsVisible = true;
|
||||
ViewModel.StatusBarProgressMaximum = 0;
|
||||
ViewModel.StatusBarProgressValue = 0;
|
||||
ViewModel.StatusBarProgressMaximum = 0;
|
||||
ViewModel.StatusBarProgressValue = 0;
|
||||
|
||||
LocaleManager.Instance.UpdateAndGetDynamicValue(LocaleKeys.StatusBarGamesLoaded, 0, 0);
|
||||
});
|
||||
|
@ -559,4 +562,4 @@ namespace Ryujinx.Ava.UI.Windows
|
|||
_isLoading = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue