UI: Update Avalonia to v12.1

- Avalonia to 12.1.1

- FluentAvalonia to 3.0.2

- Move DevTools Ctrl+F12 keybind to app initialization
This commit is contained in:
KeatonTheBot
2026-08-16 16:37:27 -05:00
parent 0e5fead0f9
commit 47e55acf21
66 changed files with 315 additions and 204 deletions
+8 -8
View File
@@ -3,19 +3,19 @@
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally> <ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageVersion Include="Avalonia" Version="11.3.18" /> <PackageVersion Include="Avalonia" Version="12.1.1" />
<PackageVersion Include="Avalonia.Controls.DataGrid" Version="11.3.13" /> <PackageVersion Include="Avalonia.Controls.DataGrid" Version="12.1.2" />
<PackageVersion Include="Avalonia.Desktop" Version="11.3.18" /> <PackageVersion Include="Avalonia.Desktop" Version="12.1.1" />
<PackageVersion Include="Avalonia.Diagnostics" Version="11.3.18" /> <PackageVersion Include="AvaloniaUI.DiagnosticsSupport" Version="2.2.3" />
<PackageVersion Include="Avalonia.Markup.Xaml.Loader" Version="11.3.18" /> <PackageVersion Include="Avalonia.Markup.Xaml.Loader" Version="12.1.1" />
<PackageVersion Include="Svg.Controls.Avalonia" Version="11.3.9.5" /> <PackageVersion Include="Svg.Controls.Avalonia" Version="12.0.0.13" />
<PackageVersion Include="Svg.Controls.Skia.Avalonia" Version="11.3.9.5" /> <PackageVersion Include="Svg.Controls.Skia.Avalonia" Version="12.0.0.13" />
<PackageVersion Include="CommandLineParser" Version="2.9.1" /> <PackageVersion Include="CommandLineParser" Version="2.9.1" />
<PackageVersion Include="CommunityToolkit.Mvvm" Version="8.4.2" /> <PackageVersion Include="CommunityToolkit.Mvvm" Version="8.4.2" />
<PackageVersion Include="Concentus" Version="2.2.2" /> <PackageVersion Include="Concentus" Version="2.2.2" />
<PackageVersion Include="DiscordRichPresence" Version="1.6.1.70" /> <PackageVersion Include="DiscordRichPresence" Version="1.6.1.70" />
<PackageVersion Include="DynamicData" Version="9.4.33" /> <PackageVersion Include="DynamicData" Version="9.4.33" />
<PackageVersion Include="FluentAvaloniaUI" Version="2.5.1" /> <PackageVersion Include="FluentAvaloniaUI" Version="3.0.2" />
<PackageVersion Include="Gommon" Version="2.8.1.2" /> <PackageVersion Include="Gommon" Version="2.8.1.2" />
<PackageVersion Include="Humanizer" Version="3.0.10" /> <PackageVersion Include="Humanizer" Version="3.0.10" />
<PackageVersion Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4" /> <PackageVersion Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4" />
+5
View File
@@ -1,5 +1,6 @@
using Avalonia; using Avalonia;
using Avalonia.Controls.ApplicationLifetimes; using Avalonia.Controls.ApplicationLifetimes;
using Avalonia.Input;
using Avalonia.Input.Platform; using Avalonia.Input.Platform;
using Avalonia.Markup.Xaml; using Avalonia.Markup.Xaml;
using Avalonia.Platform; using Avalonia.Platform;
@@ -39,6 +40,10 @@ namespace Ryujinx.Ava
FAUISettings.SetAnimationsEnabledAtAppLevel(false); FAUISettings.SetAnimationsEnabledAtAppLevel(false);
AvaloniaXamlLoader.Load(this); AvaloniaXamlLoader.Load(this);
#if DEBUG
this.AttachDeveloperTools(options => options.Gesture = new KeyGesture(Key.F12, KeyModifiers.Control));
#endif
if (OperatingSystem.IsMacOS()) if (OperatingSystem.IsMacOS())
{ {
+4 -4
View File
@@ -34,12 +34,12 @@
Width="100" Width="100"
VerticalAlignment="Center" VerticalAlignment="Center"
Text="Rrrrr" Text="Rrrrr"
UseFloatingWatermark="True" UseFloatingPlaceholder="True"
Watermark="Hello" /> PlaceholderText="Hello" />
<CheckBox>Test Check</CheckBox> <CheckBox>Test Check</CheckBox>
</StackPanel> </StackPanel>
</Grid> </Grid>
<ui:NumberBox Value="1" /> <ui:FANumberBox Value="1" />
</StackPanel> </StackPanel>
</Border> </Border>
</Design.PreviewWith> </Design.PreviewWith>
@@ -233,7 +233,7 @@
</Style> </Style>
<Style Selector="Button"> <Style Selector="Button">
<Setter Property="MinWidth" <Setter Property="MinWidth"
Value="80" /> Value="0" />
</Style> </Style>
<Style Selector="ProgressBar:horizontal"> <Style Selector="ProgressBar:horizontal">
<Setter Property="MinWidth" Value="0"/> <Setter Property="MinWidth" Value="0"/>
@@ -1,3 +1,4 @@
using Avalonia.Data;
using Avalonia.Data.Core; using Avalonia.Data.Core;
using Avalonia.Markup.Xaml; using Avalonia.Markup.Xaml;
using Avalonia.Markup.Xaml.MarkupExtensions; using Avalonia.Markup.Xaml.MarkupExtensions;
+18 -18
View File
@@ -248,11 +248,11 @@ namespace Ryujinx.Modules
string updateFile = Path.Combine(_updateDir, "update.bin"); string updateFile = Path.Combine(_updateDir, "update.bin");
TaskDialog taskDialog = new() FATaskDialog taskDialog = new()
{ {
Header = LocaleManager.Instance[LocaleKeys.RyujinxUpdater], Header = LocaleManager.Instance[LocaleKeys.RyujinxUpdater],
SubHeader = LocaleManager.Instance[LocaleKeys.UpdaterDownloading], SubHeader = LocaleManager.Instance[LocaleKeys.UpdaterDownloading],
IconSource = new SymbolIconSource { Symbol = Symbol.Download }, IconSource = new FASymbolIconSource { Symbol = FASymbol.Download },
ShowProgressBar = true, ShowProgressBar = true,
XamlRoot = parent, XamlRoot = parent,
}; };
@@ -341,7 +341,7 @@ namespace Ryujinx.Modules
} }
} }
private static void DoUpdateWithMultipleThreads(TaskDialog taskDialog, string downloadUrl, string updateFile) private static void DoUpdateWithMultipleThreads(FATaskDialog taskDialog, string downloadUrl, string updateFile)
{ {
// Multi-Threaded Updater // Multi-Threaded Updater
long chunkSize = _buildSize / ConnectionCount; long chunkSize = _buildSize / ConnectionCount;
@@ -389,7 +389,7 @@ namespace Ryujinx.Modules
Interlocked.Add(ref totalProgressPercentage, args.ProgressPercentage); Interlocked.Add(ref totalProgressPercentage, args.ProgressPercentage);
taskDialog.SetProgressBarState(totalProgressPercentage / ConnectionCount, TaskDialogProgressState.Normal); taskDialog.SetProgressBarState(totalProgressPercentage / ConnectionCount, FATaskDialogProgressState.Normal);
}; };
client.DownloadDataCompleted += (_, args) => client.DownloadDataCompleted += (_, args) =>
@@ -466,7 +466,7 @@ namespace Ryujinx.Modules
} }
} }
private static void DoUpdateWithSingleThreadWorker(TaskDialog taskDialog, string downloadUrl, string updateFile) private static void DoUpdateWithSingleThreadWorker(FATaskDialog taskDialog, string downloadUrl, string updateFile)
{ {
using HttpClient client = new(); using HttpClient client = new();
// We do not want to timeout while downloading // We do not want to timeout while downloading
@@ -494,7 +494,7 @@ namespace Ryujinx.Modules
byteWritten += readSize; byteWritten += readSize;
taskDialog.SetProgressBarState(GetPercentage(byteWritten, totalBytes), TaskDialogProgressState.Normal); taskDialog.SetProgressBarState(GetPercentage(byteWritten, totalBytes), FATaskDialogProgressState.Normal);
updateFileStream.Write(buffer, 0, readSize); updateFileStream.Write(buffer, 0, readSize);
} }
@@ -509,7 +509,7 @@ namespace Ryujinx.Modules
return max == 0 ? 0 : value / max * 100; return max == 0 ? 0 : value / max * 100;
} }
private static void DoUpdateWithSingleThread(TaskDialog taskDialog, string downloadUrl, string updateFile) private static void DoUpdateWithSingleThread(FATaskDialog taskDialog, string downloadUrl, string updateFile)
{ {
Thread worker = new(() => DoUpdateWithSingleThreadWorker(taskDialog, downloadUrl, updateFile)) Thread worker = new(() => DoUpdateWithSingleThreadWorker(taskDialog, downloadUrl, updateFile))
{ {
@@ -521,7 +521,7 @@ namespace Ryujinx.Modules
[SupportedOSPlatform("linux")] [SupportedOSPlatform("linux")]
[SupportedOSPlatform("macos")] [SupportedOSPlatform("macos")]
private static void ExtractTarGzipFile(TaskDialog taskDialog, string archivePath, string outputDirectoryPath) private static void ExtractTarGzipFile(FATaskDialog taskDialog, string archivePath, string outputDirectoryPath)
{ {
using Stream inStream = File.OpenRead(archivePath); using Stream inStream = File.OpenRead(archivePath);
using GZipInputStream gzipStream = new(inStream); using GZipInputStream gzipStream = new(inStream);
@@ -553,12 +553,12 @@ namespace Ryujinx.Modules
return; return;
} }
taskDialog.SetProgressBarState(GetPercentage(tarEntry.Size, inStream.Length), TaskDialogProgressState.Normal); taskDialog.SetProgressBarState(GetPercentage(tarEntry.Size, inStream.Length), FATaskDialogProgressState.Normal);
}); });
} }
} }
private static void ExtractZipFile(TaskDialog taskDialog, string archivePath, string outputDirectoryPath) private static void ExtractZipFile(FATaskDialog taskDialog, string archivePath, string outputDirectoryPath)
{ {
using Stream inStream = File.OpenRead(archivePath); using Stream inStream = File.OpenRead(archivePath);
using ZipFile zipFile = new(inStream); using ZipFile zipFile = new(inStream);
@@ -585,16 +585,16 @@ namespace Ryujinx.Modules
Dispatcher.UIThread.Post(() => Dispatcher.UIThread.Post(() =>
{ {
taskDialog.SetProgressBarState(GetPercentage(count, zipFile.Count), TaskDialogProgressState.Normal); taskDialog.SetProgressBarState(GetPercentage(count, zipFile.Count), FATaskDialogProgressState.Normal);
}); });
} }
} }
private static void InstallUpdate(TaskDialog taskDialog, string updateFile) private static void InstallUpdate(FATaskDialog taskDialog, string updateFile)
{ {
// Extract Update // Extract Update
taskDialog.SubHeader = LocaleManager.Instance[LocaleKeys.UpdaterExtracting]; taskDialog.SubHeader = LocaleManager.Instance[LocaleKeys.UpdaterExtracting];
taskDialog.SetProgressBarState(0, TaskDialogProgressState.Normal); taskDialog.SetProgressBarState(0, FATaskDialogProgressState.Normal);
if (OperatingSystem.IsLinux() || OperatingSystem.IsMacOS()) if (OperatingSystem.IsLinux() || OperatingSystem.IsMacOS())
{ {
@@ -615,7 +615,7 @@ namespace Ryujinx.Modules
List<string> allFiles = EnumerateFilesToDelete().ToList(); List<string> allFiles = EnumerateFilesToDelete().ToList();
taskDialog.SubHeader = LocaleManager.Instance[LocaleKeys.UpdaterRenaming]; taskDialog.SubHeader = LocaleManager.Instance[LocaleKeys.UpdaterRenaming];
taskDialog.SetProgressBarState(0, TaskDialogProgressState.Normal); taskDialog.SetProgressBarState(0, FATaskDialogProgressState.Normal);
// NOTE: On macOS, replacement is delayed to the restart phase. // NOTE: On macOS, replacement is delayed to the restart phase.
if (!OperatingSystem.IsMacOS()) if (!OperatingSystem.IsMacOS())
@@ -631,7 +631,7 @@ namespace Ryujinx.Modules
Dispatcher.UIThread.InvokeAsync(() => Dispatcher.UIThread.InvokeAsync(() =>
{ {
taskDialog.SetProgressBarState(GetPercentage(count, allFiles.Count), TaskDialogProgressState.Normal); taskDialog.SetProgressBarState(GetPercentage(count, allFiles.Count), FATaskDialogProgressState.Normal);
}); });
} }
catch catch
@@ -643,7 +643,7 @@ namespace Ryujinx.Modules
Dispatcher.UIThread.InvokeAsync(() => Dispatcher.UIThread.InvokeAsync(() =>
{ {
taskDialog.SubHeader = LocaleManager.Instance[LocaleKeys.UpdaterAddingFiles]; taskDialog.SubHeader = LocaleManager.Instance[LocaleKeys.UpdaterAddingFiles];
taskDialog.SetProgressBarState(0, TaskDialogProgressState.Normal); taskDialog.SetProgressBarState(0, FATaskDialogProgressState.Normal);
}); });
MoveAllFilesOver(_updatePublishDir, _homeDir, taskDialog); MoveAllFilesOver(_updatePublishDir, _homeDir, taskDialog);
@@ -745,7 +745,7 @@ namespace Ryujinx.Modules
return files.Where(f => !new FileInfo(f).Attributes.HasFlag(FileAttributes.Hidden | FileAttributes.System)); return files.Where(f => !new FileInfo(f).Attributes.HasFlag(FileAttributes.Hidden | FileAttributes.System));
} }
private static void MoveAllFilesOver(string root, string dest, TaskDialog taskDialog) private static void MoveAllFilesOver(string root, string dest, FATaskDialog taskDialog)
{ {
int total = Directory.GetFiles(root, "*", SearchOption.AllDirectories).Length; int total = Directory.GetFiles(root, "*", SearchOption.AllDirectories).Length;
foreach (string directory in Directory.GetDirectories(root)) foreach (string directory in Directory.GetDirectories(root))
@@ -769,7 +769,7 @@ namespace Ryujinx.Modules
Dispatcher.UIThread.InvokeAsync(() => Dispatcher.UIThread.InvokeAsync(() =>
{ {
taskDialog.SetProgressBarState(GetPercentage(count, total), TaskDialogProgressState.Normal); taskDialog.SetProgressBarState(GetPercentage(count, total), FATaskDialogProgressState.Normal);
}); });
} }
} }
+1 -1
View File
@@ -32,7 +32,7 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="Avalonia" /> <PackageReference Include="Avalonia" />
<PackageReference Include="Avalonia.Desktop" /> <PackageReference Include="Avalonia.Desktop" />
<PackageReference Include="Avalonia.Diagnostics" Condition="'$(Configuration)'=='Debug'" /> <PackageReference Include="AvaloniaUI.DiagnosticsSupport" Condition="'$(Configuration)'=='Debug'" />
<PackageReference Include="Avalonia.Controls.DataGrid" /> <PackageReference Include="Avalonia.Controls.DataGrid" />
<PackageReference Include="Avalonia.Markup.Xaml.Loader" /> <PackageReference Include="Avalonia.Markup.Xaml.Loader" />
<PackageReference Include="Svg.Controls.Avalonia" /> <PackageReference Include="Svg.Controls.Avalonia" />
+1 -1
View File
@@ -79,7 +79,7 @@ namespace Ryujinx.Ava.UI.Applet
LocaleManager.Instance[LocaleKeys.DialogOpenSettingsWindowLabel], LocaleManager.Instance[LocaleKeys.DialogOpenSettingsWindowLabel],
"", "",
LocaleManager.Instance[LocaleKeys.SettingsButtonClose], LocaleManager.Instance[LocaleKeys.SettingsButtonClose],
(int)Symbol.Important, (int)FASymbol.Important,
deferEvent, deferEvent,
async window => async window =>
{ {
@@ -70,16 +70,16 @@ namespace Ryujinx.Ava.UI.Applet
public static async Task<UserResult> ShowControllerAppletDialog(MainWindow window, ControllerAppletUIArgs args) public static async Task<UserResult> ShowControllerAppletDialog(MainWindow window, ControllerAppletUIArgs args)
{ {
ContentDialog contentDialog = new(); FAContentDialog contentDialog = new();
UserResult result = UserResult.Cancel; UserResult result = UserResult.Cancel;
ControllerAppletDialog content = new(window, args); ControllerAppletDialog content = new(window, args);
contentDialog.Title = LocaleManager.Instance[LocaleKeys.DialogControllerAppletTitle]; contentDialog.Title = LocaleManager.Instance[LocaleKeys.DialogControllerAppletTitle];
contentDialog.Content = content; contentDialog.Content = content;
void Handler(ContentDialog sender, ContentDialogClosedEventArgs eventArgs) void Handler(FAContentDialog sender, FAContentDialogClosedEventArgs eventArgs)
{ {
if (eventArgs.Result == ContentDialogResult.Primary) if (eventArgs.Result == FAContentDialogResult.Primary)
{ {
result = UserResult.Ok; result = UserResult.Ok;
} }
@@ -130,7 +130,7 @@ namespace Ryujinx.Ava.UI.Applet
public void Close() public void Close()
{ {
((ContentDialog)Parent)?.Hide(); ((FAContentDialog)Parent)?.Hide();
} }
} }
} }
@@ -46,7 +46,7 @@
Text="{Binding Message}" Text="{Binding Message}"
TextInput="Message_TextInput" TextInput="Message_TextInput"
TextWrapping="Wrap" TextWrapping="Wrap"
UseFloatingWatermark="True" /> UseFloatingPlaceholder="True" />
<TextBlock <TextBlock
Name="Error" Name="Error"
Grid.Row="4" Grid.Row="4"
@@ -21,7 +21,7 @@ namespace Ryujinx.Ava.UI.Controls
private int _inputMin; private int _inputMin;
private readonly string _placeholder; private readonly string _placeholder;
private ContentDialog _host; private FAContentDialog _host;
public SwkbdAppletDialog(string mainText, string secondaryText, string placeholder, string message) public SwkbdAppletDialog(string mainText, string secondaryText, string placeholder, string message)
{ {
@@ -32,11 +32,11 @@ namespace Ryujinx.Ava.UI.Controls
_placeholder = placeholder; _placeholder = placeholder;
InitializeComponent(); InitializeComponent();
Input.Watermark = _placeholder; Input.PlaceholderText = _placeholder;
if (string.IsNullOrWhiteSpace(Input.Watermark)) if (string.IsNullOrWhiteSpace(Input.PlaceholderText))
{ {
Input.UseFloatingWatermark = false; Input.UseFloatingPlaceholder = false;
} }
Input.AddHandler(TextInputEvent, Message_TextInput, RoutingStrategies.Tunnel, true); Input.AddHandler(TextInputEvent, Message_TextInput, RoutingStrategies.Tunnel, true);
@@ -48,7 +48,7 @@ namespace Ryujinx.Ava.UI.Controls
InitializeComponent(); InitializeComponent();
} }
protected override void OnGotFocus(GotFocusEventArgs e) protected override void OnGotFocus(FocusChangedEventArgs e)
{ {
// FIXME: This does not work. Might be a bug in Avalonia with DialogHost // FIXME: This does not work. Might be a bug in Avalonia with DialogHost
// Currently focus will be redirected to the overlay window instead. // Currently focus will be redirected to the overlay window instead.
@@ -61,7 +61,7 @@ namespace Ryujinx.Ava.UI.Controls
public static async Task<(UserResult Result, string Input)> ShowInputDialog(string title, SoftwareKeyboardUIArgs args) public static async Task<(UserResult Result, string Input)> ShowInputDialog(string title, SoftwareKeyboardUIArgs args)
{ {
ContentDialog contentDialog = new(); FAContentDialog contentDialog = new();
UserResult result = UserResult.Cancel; UserResult result = UserResult.Cancel;
@@ -80,9 +80,9 @@ namespace Ryujinx.Ava.UI.Controls
contentDialog.CloseButtonText = LocaleManager.Instance[LocaleKeys.InputDialogCancel]; contentDialog.CloseButtonText = LocaleManager.Instance[LocaleKeys.InputDialogCancel];
contentDialog.Content = content; contentDialog.Content = content;
void Handler(ContentDialog sender, ContentDialogClosedEventArgs eventArgs) void Handler(FAContentDialog sender, FAContentDialogClosedEventArgs eventArgs)
{ {
if (eventArgs.Result == ContentDialogResult.Primary) if (eventArgs.Result == FAContentDialogResult.Primary)
{ {
result = UserResult.Ok; result = UserResult.Ok;
input = content.Input.Text; input = content.Input.Text;
@@ -174,7 +174,7 @@ namespace Ryujinx.Ava.UI.Controls
{ {
if (e.Key == Key.Enter && _host.IsPrimaryButtonEnabled) if (e.Key == Key.Enter && _host.IsPrimaryButtonEnabled)
{ {
_host.Hide(ContentDialogResult.Primary); _host.Hide(FAContentDialogResult.Primary);
} }
else else
{ {
@@ -77,7 +77,7 @@
</Panel> </Panel>
</Grid> </Grid>
</Border> </Border>
<ui:SymbolIcon <ui:FASymbolIcon
Margin="5,5,0,0" Margin="5,5,0,0"
HorizontalAlignment="Left" HorizontalAlignment="Left"
VerticalAlignment="Top" VerticalAlignment="Top"
@@ -146,7 +146,7 @@
TextAlignment="End" TextAlignment="End"
TextWrapping="Wrap" /> TextWrapping="Wrap" />
</StackPanel> </StackPanel>
<ui:SymbolIcon <ui:FASymbolIcon
Grid.Row="0" Grid.Row="0"
Grid.Column="0" Grid.Column="0"
Margin="-5,-5,0,0" Margin="-5,-5,0,0"
@@ -23,7 +23,7 @@ namespace Ryujinx.Ava.UI.Controls
{ {
DlcSelectViewModel viewModel = new(selectedTitleId, appLibrary); DlcSelectViewModel viewModel = new(selectedTitleId, appLibrary);
ContentDialog contentDialog = new() FAContentDialog contentDialog = new()
{ {
PrimaryButtonText = LocaleManager.Instance[LocaleKeys.Continue], PrimaryButtonText = LocaleManager.Instance[LocaleKeys.Continue],
SecondaryButtonText = string.Empty, SecondaryButtonText = string.Empty,
@@ -9,9 +9,9 @@
d:DesignHeight="450" d:DesignHeight="450"
x:Class="Ryujinx.Ava.UI.Controls.NavigationDialogHost" x:Class="Ryujinx.Ava.UI.Controls.NavigationDialogHost"
Focusable="True"> Focusable="True">
<ui:Frame <ui:FAFrame
HorizontalAlignment="Stretch" HorizontalAlignment="Stretch"
VerticalAlignment="Stretch" VerticalAlignment="Stretch"
x:Name="ContentFrame"> x:Name="ContentFrame">
</ui:Frame> </ui:FAFrame>
</UserControl> </UserControl>
@@ -74,7 +74,7 @@ namespace Ryujinx.Ava.UI.Controls
VirtualFileSystem ownerVirtualFileSystem, HorizonClient ownerHorizonClient) VirtualFileSystem ownerVirtualFileSystem, HorizonClient ownerHorizonClient)
{ {
NavigationDialogHost content = new(ownerAccountManager, ownerContentManager, ownerVirtualFileSystem, ownerHorizonClient); NavigationDialogHost content = new(ownerAccountManager, ownerContentManager, ownerVirtualFileSystem, ownerHorizonClient);
ContentDialog contentDialog = new() FAContentDialog contentDialog = new()
{ {
Title = LocaleManager.Instance[LocaleKeys.UserProfileWindowTitle], Title = LocaleManager.Instance[LocaleKeys.UserProfileWindowTitle],
PrimaryButtonText = "", PrimaryButtonText = "",
@@ -8,7 +8,7 @@ namespace Ryujinx.Ava.UI.Controls
{ {
public UpdateWaitWindow(string primaryText, string secondaryText, CancellationTokenSource cancellationToken) : this(primaryText, secondaryText) public UpdateWaitWindow(string primaryText, string secondaryText, CancellationTokenSource cancellationToken) : this(primaryText, secondaryText)
{ {
SystemDecorations = SystemDecorations.Full; WindowDecorations = WindowDecorations.Full;
ShowInTaskbar = true; ShowInTaskbar = true;
Closing += (_, _) => cancellationToken.Cancel(); Closing += (_, _) => cancellationToken.Cancel();
@@ -19,7 +19,7 @@ namespace Ryujinx.Ava.UI.Controls
PrimaryText.Text = primaryText; PrimaryText.Text = primaryText;
SecondaryText.Text = secondaryText; SecondaryText.Text = secondaryText;
WindowStartupLocation = WindowStartupLocation.CenterOwner; WindowStartupLocation = WindowStartupLocation.CenterOwner;
SystemDecorations = SystemDecorations.BorderOnly; WindowDecorations = WindowDecorations.BorderOnly;
ShowInTaskbar = false; ShowInTaskbar = false;
} }
+94
View File
@@ -0,0 +1,94 @@
using System;
#nullable enable
namespace Ryujinx.Ava.UI.Helpers;
public ref struct CharacterReader(ReadOnlySpan<char> s)
{
private ReadOnlySpan<char> _s = s;
public bool End => this._s.IsEmpty;
public char Peek => this._s[0];
public int Position { get; private set; }
public char Take()
{
++this.Position;
int num = (int) this._s[0];
this._s = this._s.Slice(1);
return (char) num;
}
public void SkipWhitespace()
{
ReadOnlySpan<char> readOnlySpan = this._s.TrimStart();
this.Position += this._s.Length - readOnlySpan.Length;
this._s = readOnlySpan;
}
public bool TakeIf(char c)
{
if ((int) this.Peek != (int) c)
return false;
int num = (int) this.Take();
return true;
}
internal bool TakeIf(string s)
{
if (!this.TryPeek(s.Length).SequenceEqual<char>(s.AsSpan()))
return false;
this._s = this._s.Slice(s.Length);
this.Position += s.Length;
return true;
}
public bool TakeIf(Func<char, bool> condition)
{
if (!condition(this.Peek))
return false;
int num = (int) this.Take();
return true;
}
public ReadOnlySpan<char> TakeUntil(char c)
{
int num = 0;
while (num < this._s.Length && (int) this._s[num] != (int) c)
++num;
ReadOnlySpan<char> until = this._s.Slice(0, num);
this._s = this._s.Slice(num);
this.Position += num;
return until;
}
public ReadOnlySpan<char> TakeWhile(Func<char, bool> condition)
{
int num = 0;
while (num < this._s.Length && condition(this._s[num]))
++num;
ReadOnlySpan<char> readOnlySpan = this._s.Slice(0, num);
this._s = this._s.Slice(num);
this.Position += num;
return readOnlySpan;
}
public ReadOnlySpan<char> TryPeek(int count)
{
return this._s.Length < count ? ReadOnlySpan<char>.Empty : this._s.Slice(0, count);
}
public ReadOnlySpan<char> PeekWhitespace()
{
return this._s.Slice(0, this._s.Length - this._s.TrimStart().Length);
}
public void Skip(int count)
{
if (this._s.Length < count)
throw new IndexOutOfRangeException();
this._s = this._s.Slice(count);
}
}
+19 -19
View File
@@ -28,11 +28,11 @@ namespace Ryujinx.Ava.UI.Helpers
string closeButton, string closeButton,
UserResult primaryButtonResult = UserResult.Ok, UserResult primaryButtonResult = UserResult.Ok,
ManualResetEvent deferResetEvent = null, ManualResetEvent deferResetEvent = null,
TypedEventHandler<ContentDialog, ContentDialogButtonClickEventArgs> deferCloseAction = null) TypedEventHandler<FAContentDialog, FAContentDialogButtonClickEventArgs> deferCloseAction = null)
{ {
UserResult result = UserResult.None; UserResult result = UserResult.None;
ContentDialog contentDialog = new() FAContentDialog contentDialog = new()
{ {
Title = title, Title = title,
PrimaryButtonText = primaryButton, PrimaryButtonText = primaryButton,
@@ -77,7 +77,7 @@ namespace Ryujinx.Ava.UI.Helpers
int iconSymbol, int iconSymbol,
UserResult primaryButtonResult = UserResult.Ok, UserResult primaryButtonResult = UserResult.Ok,
ManualResetEvent deferResetEvent = null, ManualResetEvent deferResetEvent = null,
TypedEventHandler<ContentDialog, ContentDialogButtonClickEventArgs> deferCloseAction = null) TypedEventHandler<FAContentDialog, FAContentDialogButtonClickEventArgs> deferCloseAction = null)
{ {
Grid content = CreateTextDialogContent(primaryText, secondaryText, iconSymbol); Grid content = CreateTextDialogContent(primaryText, secondaryText, iconSymbol);
@@ -110,7 +110,7 @@ namespace Ryujinx.Ava.UI.Helpers
deferResetEvent, deferResetEvent,
DeferClose); DeferClose);
async void DeferClose(ContentDialog sender, ContentDialogButtonClickEventArgs args) async void DeferClose(FAContentDialog sender, FAContentDialogButtonClickEventArgs args)
{ {
if (startedDeferring) if (startedDeferring)
{ {
@@ -121,7 +121,7 @@ namespace Ryujinx.Ava.UI.Helpers
startedDeferring = true; startedDeferring = true;
Deferral deferral = args.GetDeferral(); FADeferral deferral = args.GetDeferral();
sender.PrimaryButtonClick -= DeferClose; sender.PrimaryButtonClick -= DeferClose;
@@ -154,9 +154,9 @@ namespace Ryujinx.Ava.UI.Helpers
MinHeight = 80, MinHeight = 80,
}; };
SymbolIcon icon = new() FASymbolIcon icon = new()
{ {
Symbol = (Symbol)symbol, Symbol = (FASymbol)symbol,
Margin = new Thickness(10), Margin = new Thickness(10),
FontSize = 40, FontSize = 40,
FlowDirection = FlowDirection.LeftToRight, FlowDirection = FlowDirection.LeftToRight,
@@ -209,7 +209,7 @@ namespace Ryujinx.Ava.UI.Helpers
acceptButton, acceptButton,
"", "",
closeButton, closeButton,
(int)Symbol.Important); (int)FASymbol.Important);
} }
internal static async Task<UserResult> CreateConfirmationDialog( internal static async Task<UserResult> CreateConfirmationDialog(
@@ -227,7 +227,7 @@ namespace Ryujinx.Ava.UI.Helpers
acceptButtonText, acceptButtonText,
"", "",
cancelButtonText, cancelButtonText,
(int)Symbol.Help, (int)FASymbol.Help,
primaryButtonResult); primaryButtonResult);
} }
internal static async Task<UserResult> CreateConfirmationDialogExtended( internal static async Task<UserResult> CreateConfirmationDialogExtended(
@@ -245,7 +245,7 @@ namespace Ryujinx.Ava.UI.Helpers
acceptButtonText, acceptButtonText,
noacceptButtonText, noacceptButtonText,
cancelButtonText, cancelButtonText,
(int)Symbol.Help, (int)FASymbol.Help,
primaryButtonResult); primaryButtonResult);
internal static async Task<UserResult> CreateLocalizedConfirmationDialog(string primaryText, string secondaryText) internal static async Task<UserResult> CreateLocalizedConfirmationDialog(string primaryText, string secondaryText)
@@ -265,7 +265,7 @@ namespace Ryujinx.Ava.UI.Helpers
"", "",
"", "",
LocaleManager.Instance[LocaleKeys.InputDialogOk], LocaleManager.Instance[LocaleKeys.InputDialogOk],
(int)Symbol.Important); (int)FASymbol.Important);
} }
internal static async Task CreateWarningDialog(string primary, string secondaryText) internal static async Task CreateWarningDialog(string primary, string secondaryText)
@@ -277,7 +277,7 @@ namespace Ryujinx.Ava.UI.Helpers
"", "",
"", "",
LocaleManager.Instance[LocaleKeys.InputDialogOk], LocaleManager.Instance[LocaleKeys.InputDialogOk],
(int)Symbol.Important); (int)FASymbol.Important);
} }
internal static async Task CreateErrorDialog(string errorMessage, string secondaryErrorMessage = "") internal static async Task CreateErrorDialog(string errorMessage, string secondaryErrorMessage = "")
@@ -291,7 +291,7 @@ namespace Ryujinx.Ava.UI.Helpers
secondaryErrorMessage, secondaryErrorMessage,
"", "",
LocaleManager.Instance[LocaleKeys.InputDialogOk], LocaleManager.Instance[LocaleKeys.InputDialogOk],
(int)Symbol.Dismiss); (int)FASymbol.Dismiss);
} }
internal static async Task<bool> CreateChoiceDialog(string title, string primary, string secondaryText) internal static async Task<bool> CreateChoiceDialog(string title, string primary, string secondaryText)
@@ -310,7 +310,7 @@ namespace Ryujinx.Ava.UI.Helpers
LocaleManager.Instance[LocaleKeys.InputDialogYes], LocaleManager.Instance[LocaleKeys.InputDialogYes],
"", "",
LocaleManager.Instance[LocaleKeys.InputDialogNo], LocaleManager.Instance[LocaleKeys.InputDialogNo],
(int)Symbol.Help, (int)FASymbol.Help,
UserResult.Yes); UserResult.Yes);
_isChoiceDialogOpen = false; _isChoiceDialogOpen = false;
@@ -334,9 +334,9 @@ namespace Ryujinx.Ava.UI.Helpers
LocaleManager.Instance[LocaleKeys.DialogExitSubMessage]); LocaleManager.Instance[LocaleKeys.DialogExitSubMessage]);
} }
public static async Task<ContentDialogResult> ShowAsync(ContentDialog contentDialog) public static async Task<FAContentDialogResult> ShowAsync(FAContentDialog contentDialog)
{ {
ContentDialogResult result; FAContentDialogResult result;
bool isTopDialog = true; bool isTopDialog = true;
Window parent = GetMainWindow(); Window parent = GetMainWindow();
@@ -390,14 +390,14 @@ namespace Ryujinx.Ava.UI.Helpers
result = await ShowDialog(); result = await ShowDialog();
} }
result = await _contentDialogOverlayWindow.ShowDialog<ContentDialogResult>(parent); result = await _contentDialogOverlayWindow.ShowDialog<FAContentDialogResult>(parent);
} }
else else
{ {
result = await ShowDialog(); result = await ShowDialog();
} }
async Task<ContentDialogResult> ShowDialog() async Task<FAContentDialogResult> ShowDialog()
{ {
if (_contentDialogOverlayWindow is not null) if (_contentDialogOverlayWindow is not null)
{ {
@@ -407,7 +407,7 @@ namespace Ryujinx.Ava.UI.Helpers
} }
else else
{ {
result = ContentDialogResult.None; result = FAContentDialogResult.None;
Logger.Warning?.Print(LogClass.UI, "Content dialog overlay failed to populate. Default value has been returned."); Logger.Warning?.Print(LogClass.UI, "Content dialog overlay failed to populate. Default value has been returned.");
} }
@@ -11,10 +11,10 @@ namespace Ryujinx.Ava.UI.Helpers
private static readonly Dictionary<Glyph, string> _glyphs = new() private static readonly Dictionary<Glyph, string> _glyphs = new()
{ {
{ Glyph.List, char.ConvertFromUtf32((int)Symbol.List) }, { Glyph.List, char.ConvertFromUtf32((int)FASymbol.List) },
{ Glyph.Grid, char.ConvertFromUtf32((int)Symbol.ViewAll) }, { Glyph.Grid, char.ConvertFromUtf32((int)FASymbol.ViewAll) },
{ Glyph.Chip, char.ConvertFromUtf32(59748) }, { Glyph.Chip, char.ConvertFromUtf32(59748) },
{ Glyph.Important, char.ConvertFromUtf32((int)Symbol.Important) }, { Glyph.Important, char.ConvertFromUtf32((int)FASymbol.Important) },
}; };
public GlyphValueConverter(string key) public GlyphValueConverter(string key)
@@ -271,7 +271,7 @@ namespace Ryujinx.Ava.UI.ViewModels
string msg = string.Format(LocaleManager.Instance[LocaleKeys.DlcWindowDlcAddedMessage], numAdded); string msg = string.Format(LocaleManager.Instance[LocaleKeys.DlcWindowDlcAddedMessage], numAdded);
return Dispatcher.UIThread.InvokeAsync(async () => return Dispatcher.UIThread.InvokeAsync(async () =>
{ {
await ContentDialogHelper.ShowTextDialog(LocaleManager.Instance[LocaleKeys.DialogConfirmationTitle], msg, "", "", "", LocaleManager.Instance[LocaleKeys.InputDialogOk], (int)Symbol.Checkmark); await ContentDialogHelper.ShowTextDialog(LocaleManager.Instance[LocaleKeys.DialogConfirmationTitle], msg, "", "", "", LocaleManager.Instance[LocaleKeys.InputDialogOk], (int)FASymbol.Checkmark);
}); });
} }
} }
@@ -1196,7 +1196,7 @@ namespace Ryujinx.Ava.UI.ViewModels
{ {
await ContentDialogHelper.ShowTextDialog( await ContentDialogHelper.ShowTextDialog(
LocaleManager.Instance[numAdded > 0 || numRemoved > 0 ? LocaleKeys.RyujinxConfirm : LocaleKeys.RyujinxInfo], LocaleManager.Instance[numAdded > 0 || numRemoved > 0 ? LocaleKeys.RyujinxConfirm : LocaleKeys.RyujinxInfo],
msg, "", "", "", LocaleManager.Instance[LocaleKeys.InputDialogOk], (int)Symbol.Checkmark); msg, "", "", "", LocaleManager.Instance[LocaleKeys.InputDialogOk], (int)FASymbol.Checkmark);
}); });
} }
@@ -1275,9 +1275,12 @@ namespace Ryujinx.Ava.UI.ViewModels
Glyph = Glyph.Grid; Glyph = Glyph.Grid;
} }
public void SetAspectRatio(AspectRatio aspectRatio) public void SetAspectRatio(object aspectRatio)
{ {
ConfigurationState.Instance.Graphics.AspectRatio.Value = aspectRatio; if (aspectRatio is AspectRatio ratio)
{
ConfigurationState.Instance.Graphics.AspectRatio.Value = ratio;
}
} }
public async Task InstallFirmwareFromFile() public async Task InstallFirmwareFromFile()
@@ -204,7 +204,7 @@ namespace Ryujinx.Ava.UI.ViewModels
string msg = string.Format(LocaleManager.Instance[LocaleKeys.UpdateWindowUpdateAddedMessage], numAdded); string msg = string.Format(LocaleManager.Instance[LocaleKeys.UpdateWindowUpdateAddedMessage], numAdded);
return Dispatcher.UIThread.InvokeAsync(async () => return Dispatcher.UIThread.InvokeAsync(async () =>
{ {
await ContentDialogHelper.ShowTextDialog(LocaleManager.Instance[LocaleKeys.DialogConfirmationTitle], msg, "", "", "", LocaleManager.Instance[LocaleKeys.InputDialogOk], (int)Symbol.Checkmark); await ContentDialogHelper.ShowTextDialog(LocaleManager.Instance[LocaleKeys.DialogConfirmationTitle], msg, "", "", "", LocaleManager.Instance[LocaleKeys.InputDialogOk], (int)FASymbol.Checkmark);
}); });
} }
} }
+4 -4
View File
@@ -93,7 +93,7 @@
VerticalAlignment="Center" VerticalAlignment="Center"
ToolTip.Tip="{locale:Locale ControllerSettingsLoadProfileToolTip}" ToolTip.Tip="{locale:Locale ControllerSettingsLoadProfileToolTip}"
Command="{Binding LoadProfile}"> Command="{Binding LoadProfile}">
<ui:SymbolIcon <ui:FASymbolIcon
Symbol="View" Symbol="View"
FontSize="15" FontSize="15"
Height="20" /> Height="20" />
@@ -105,7 +105,7 @@
VerticalAlignment="Center" VerticalAlignment="Center"
ToolTip.Tip="{locale:Locale ControllerSettingsSaveProfileToolTip}" ToolTip.Tip="{locale:Locale ControllerSettingsSaveProfileToolTip}"
Command="{Binding SaveProfile}"> Command="{Binding SaveProfile}">
<ui:SymbolIcon <ui:FASymbolIcon
Symbol="Save" Symbol="Save"
FontSize="15" FontSize="15"
Height="20" /> Height="20" />
@@ -117,7 +117,7 @@
VerticalAlignment="Center" VerticalAlignment="Center"
ToolTip.Tip="{locale:Locale ControllerSettingsRemoveProfileToolTip}" ToolTip.Tip="{locale:Locale ControllerSettingsRemoveProfileToolTip}"
Command="{Binding RemoveProfile}"> Command="{Binding RemoveProfile}">
<ui:SymbolIcon <ui:FASymbolIcon
Symbol="Delete" Symbol="Delete"
FontSize="15" FontSize="15"
Height="20" /> Height="20" />
@@ -152,7 +152,7 @@
Margin="5,0,0,0" Margin="5,0,0,0"
VerticalAlignment="Center" VerticalAlignment="Center"
Command="{Binding LoadDevices}"> Command="{Binding LoadDevices}">
<ui:SymbolIcon <ui:FASymbolIcon
Symbol="Refresh" Symbol="Refresh"
FontSize="15" FontSize="15"
Height="20"/> Height="20"/>
@@ -121,7 +121,7 @@
Margin="0,10,0,0" Margin="0,10,0,0"
VerticalAlignment="Center" VerticalAlignment="Center"
Text="{locale:Locale ControllerSettingsMotionControllerSlot}" /> Text="{locale:Locale ControllerSettingsMotionControllerSlot}" />
<ui:NumberBox <ui:FANumberBox
Grid.Row="0" Grid.Row="0"
Grid.Column="1" Grid.Column="1"
Name="CemuHookSlotUpDown" Name="CemuHookSlotUpDown"
@@ -136,7 +136,7 @@
Grid.Column="0" Grid.Column="0"
VerticalAlignment="Center" VerticalAlignment="Center"
Text="{locale:Locale ControllerSettingsMotionRightJoyConSlot}" /> Text="{locale:Locale ControllerSettingsMotionRightJoyConSlot}" />
<ui:NumberBox <ui:FANumberBox
Grid.Row="1" Grid.Row="1"
Grid.Column="1" Grid.Column="1"
Name="CemuHookRightJoyConSlotUpDown" Name="CemuHookRightJoyConSlotUpDown"
@@ -40,7 +40,7 @@ namespace Ryujinx.Ava.UI.Views.Input
{ {
MotionInputView content = new(viewModel); MotionInputView content = new(viewModel);
ContentDialog contentDialog = new() FAContentDialog contentDialog = new()
{ {
Title = LocaleManager.Instance[LocaleKeys.ControllerMotionTitle], Title = LocaleManager.Instance[LocaleKeys.ControllerMotionTitle],
PrimaryButtonText = LocaleManager.Instance[LocaleKeys.ControllerSettingsSave], PrimaryButtonText = LocaleManager.Instance[LocaleKeys.ControllerSettingsSave],
@@ -35,7 +35,7 @@ namespace Ryujinx.Ava.UI.Views.Input
{ {
RumbleInputView content = new(viewModel); RumbleInputView content = new(viewModel);
ContentDialog contentDialog = new() FAContentDialog contentDialog = new()
{ {
Title = LocaleManager.Instance[LocaleKeys.ControllerRumbleTitle], Title = LocaleManager.Instance[LocaleKeys.ControllerRumbleTitle],
PrimaryButtonText = LocaleManager.Instance[LocaleKeys.ControllerSettingsSave], PrimaryButtonText = LocaleManager.Instance[LocaleKeys.ControllerSettingsSave],
@@ -95,7 +95,7 @@ namespace Ryujinx.Ava.UI.Views.Main
{ {
base.OnAttachedToVisualTree(e); base.OnAttachedToVisualTree(e);
if (VisualRoot is MainWindow window) if (TopLevel.GetTopLevel(this) is MainWindow window)
{ {
Window = window; Window = window;
} }
@@ -40,7 +40,7 @@
VerticalAlignment="Center" VerticalAlignment="Center"
Background="Transparent" Background="Transparent"
Click="Refresh_OnClick"> Click="Refresh_OnClick">
<ui:SymbolIcon <ui:FASymbolIcon
Width="50" Width="50"
Height="100" Height="100"
Symbol="Refresh" /> Symbol="Refresh" />
@@ -96,7 +96,7 @@
Margin="-5,0,5,0" Margin="-5,0,5,0"
Background="Transparent" Background="Transparent"
BorderThickness="0"> BorderThickness="0">
<ui:SymbolIcon Symbol="Settings" <ui:FASymbolIcon Symbol="Settings"
HorizontalAlignment="Stretch" HorizontalAlignment="Stretch"
VerticalAlignment="Center" VerticalAlignment="Center"
Width="14" Width="14"
@@ -23,7 +23,7 @@ namespace Ryujinx.Ava.UI.Views.Main
{ {
base.OnAttachedToVisualTree(e); base.OnAttachedToVisualTree(e);
if (VisualRoot is MainWindow window) if (TopLevel.GetTopLevel(this) is MainWindow window)
{ {
Window = window; Window = window;
} }
@@ -25,7 +25,7 @@
VerticalAlignment="Stretch" VerticalAlignment="Stretch"
Command="{Binding SetListMode}" Command="{Binding SetListMode}"
IsEnabled="{Binding IsGrid}"> IsEnabled="{Binding IsGrid}">
<ui:FontIcon <ui:FAFontIcon
Margin="0" Margin="0"
HorizontalAlignment="Stretch" HorizontalAlignment="Stretch"
VerticalAlignment="Center" VerticalAlignment="Center"
@@ -39,7 +39,7 @@
VerticalAlignment="Stretch" VerticalAlignment="Stretch"
Command="{Binding SetGridMode}" Command="{Binding SetGridMode}"
IsEnabled="{Binding IsList}"> IsEnabled="{Binding IsList}">
<ui:FontIcon <ui:FAFontIcon
Margin="0" Margin="0"
HorizontalAlignment="Stretch" HorizontalAlignment="Stretch"
VerticalAlignment="Center" VerticalAlignment="Center"
@@ -79,7 +79,7 @@
DockPanel.Dock="Right" DockPanel.Dock="Right"
KeyUp="SearchBox_OnKeyUp" KeyUp="SearchBox_OnKeyUp"
Text="{Binding SearchText}" Text="{Binding SearchText}"
Watermark="{locale:Locale MenuSearch}" /> PlaceholderText="{locale:Locale MenuSearch}" />
<DropDownButton <DropDownButton
Width="150" Width="150"
HorizontalAlignment="Right" HorizontalAlignment="Right"
@@ -22,7 +22,7 @@ namespace Ryujinx.Ava.UI.Views.Main
{ {
base.OnAttachedToVisualTree(e); base.OnAttachedToVisualTree(e);
if (VisualRoot is MainWindow window) if (TopLevel.GetTopLevel(this) is MainWindow window)
{ {
ViewModel = window.ViewModel; ViewModel = window.ViewModel;
} }
@@ -55,7 +55,7 @@
Text="{locale:Locale SettingsTabSystemAudioVolume}" Text="{locale:Locale SettingsTabSystemAudioVolume}"
ToolTip.Tip="{locale:Locale AudioVolumeTooltip}" ToolTip.Tip="{locale:Locale AudioVolumeTooltip}"
Width="250" /> Width="250" />
<ui:NumberBox Value="{Binding Volume}" <ui:FANumberBox Value="{Binding Volume}"
ToolTip.Tip="{locale:Locale AudioVolumeTooltip}" ToolTip.Tip="{locale:Locale AudioVolumeTooltip}"
Width="350" Width="350"
SmallChange="1" SmallChange="1"
@@ -95,7 +95,7 @@
Text="{locale:Locale SettingsTabSystemTurboMultiplier}" Text="{locale:Locale SettingsTabSystemTurboMultiplier}"
ToolTip.Tip="{locale:Locale SettingsTabSystemTurboMultiplierToolTip}" ToolTip.Tip="{locale:Locale SettingsTabSystemTurboMultiplierToolTip}"
Width="250" /> Width="250" />
<ui:NumberBox ToolTip.Tip="{locale:Locale SettingsTabSystemTurboMultiplierValueToolTip}" <ui:FANumberBox ToolTip.Tip="{locale:Locale SettingsTabSystemTurboMultiplierValueToolTip}"
Value="{Binding TurboMultiplier}" Value="{Binding TurboMultiplier}"
Width="165" Width="165"
SmallChange="1.0" SmallChange="1.0"
@@ -41,7 +41,7 @@
<TextBlock VerticalAlignment="Center" <TextBlock VerticalAlignment="Center"
Text="{locale:Locale SettingsTabDebugGDBStubPort}" Text="{locale:Locale SettingsTabDebugGDBStubPort}"
Width="250" /> Width="250" />
<ui:NumberBox Value="{Binding GDBStubPort}" <ui:FANumberBox Value="{Binding GDBStubPort}"
Width="350" Width="350"
SmallChange="1" SmallChange="1"
LargeChange="10" LargeChange="10"
@@ -98,7 +98,7 @@
<ComboBoxItem <ComboBoxItem
Content="{locale:Locale SettingsTabGraphicsResolutionScaleCustom}" /> Content="{locale:Locale SettingsTabGraphicsResolutionScaleCustom}" />
</ComboBox> </ComboBox>
<ui:NumberBox <ui:FANumberBox
Margin="10,0,0,0" Margin="10,0,0,0"
ToolTip.Tip="{locale:Locale ResolutionScaleEntryTooltip}" ToolTip.Tip="{locale:Locale ResolutionScaleEntryTooltip}"
MinWidth="150" MinWidth="150"
@@ -311,4 +311,4 @@
</StackPanel> </StackPanel>
</Border> </Border>
</ScrollViewer> </ScrollViewer>
</UserControl> </UserControl>
@@ -79,7 +79,7 @@
ToolTip.Tip="{locale:Locale FSAccessLogModeTooltip}" ToolTip.Tip="{locale:Locale FSAccessLogModeTooltip}"
Text="{locale:Locale SettingsTabLoggingFsGlobalAccessLogMode}" Text="{locale:Locale SettingsTabLoggingFsGlobalAccessLogMode}"
Width="285" /> Width="285" />
<ui:NumberBox <ui:FANumberBox
Maximum="3" Maximum="3"
Minimum="0" Minimum="0"
Width="150" Width="150"
@@ -55,7 +55,7 @@
Width="250" Width="250"
MaxLength="16" MaxLength="16"
ToolTip.Tip="{locale:Locale LdnPassphraseInputTooltip}" ToolTip.Tip="{locale:Locale LdnPassphraseInputTooltip}"
Watermark="{locale:Locale LdnPassphraseInputPublic}" /> PlaceholderText="{locale:Locale LdnPassphraseInputPublic}" />
<Button <Button
Name="GenLdnPassButton" Name="GenLdnPassButton"
MinWidth="90" MinWidth="90"
@@ -1,7 +1,7 @@
using Avalonia;
using Avalonia.Controls; using Avalonia.Controls;
using Avalonia.Interactivity; using Avalonia.Interactivity;
using Avalonia.Platform.Storage; using Avalonia.Platform.Storage;
using Avalonia.VisualTree;
using Ryujinx.Ava.UI.ViewModels; using Ryujinx.Ava.UI.ViewModels;
using Ryujinx.Common.Utilities; using Ryujinx.Common.Utilities;
using System.Collections.Generic; using System.Collections.Generic;
@@ -32,7 +32,7 @@ namespace Ryujinx.Ava.UI.Views.Settings
} }
else else
{ {
if (this.GetVisualRoot() is Window window) if (TopLevel.GetTopLevel(this) is Window window)
{ {
IReadOnlyList<IStorageFolder> result = await window.StorageProvider.OpenFolderPickerAsync(new FolderPickerOpenOptions IReadOnlyList<IStorageFolder> result = await window.StorageProvider.OpenFolderPickerAsync(new FolderPickerOpenOptions
{ {
@@ -82,7 +82,7 @@ namespace Ryujinx.Ava.UI.Views.Settings
} }
else else
{ {
if (this.GetVisualRoot() is Window window) if (TopLevel.GetTopLevel(this) is Window window)
{ {
IReadOnlyList<IStorageFolder> result = await window.StorageProvider.OpenFolderPickerAsync(new FolderPickerOpenOptions IReadOnlyList<IStorageFolder> result = await window.StorageProvider.OpenFolderPickerAsync(new FolderPickerOpenOptions
{ {
@@ -33,7 +33,7 @@
Width="300" Width="300"
HorizontalAlignment="Stretch" HorizontalAlignment="Stretch"
MaxLength="{Binding MaxProfileNameLength}" MaxLength="{Binding MaxProfileNameLength}"
Watermark="{locale:Locale ProfileNameSelectionWatermark}" PlaceholderText="{locale:Locale ProfileNameSelectionWatermark}"
Text="{Binding Name}" /> Text="{Binding Name}" />
<TextBlock Name="IdText" Text="{locale:Locale UserProfilesUserId}" /> <TextBlock Name="IdText" Text="{locale:Locale UserProfilesUserId}" />
<TextBox <TextBox
@@ -53,7 +53,7 @@
BorderBrush="{DynamicResource AppListHoverBackgroundColor}" BorderBrush="{DynamicResource AppListHoverBackgroundColor}"
BorderThickness="1"> BorderThickness="1">
<Panel> <Panel>
<ui:SymbolIcon <ui:FASymbolIcon
FontSize="60" FontSize="60"
Width="96" Width="96"
Height="96" Height="96"
@@ -85,7 +85,7 @@
Width="50" Width="50"
MinWidth="50" MinWidth="50"
Click="BackButton_Click"> Click="BackButton_Click">
<ui:SymbolIcon Symbol="Back" /> <ui:FASymbolIcon Symbol="Back" />
</Button> </Button>
</StackPanel> </StackPanel>
<StackPanel <StackPanel
@@ -9,6 +9,7 @@ using Ryujinx.Ava.UI.Helpers;
using Ryujinx.Ava.UI.Models; using Ryujinx.Ava.UI.Models;
using Ryujinx.HLE.HOS.Services.Account.Acc; using Ryujinx.HLE.HOS.Services.Account.Acc;
using System; using System;
using NavigationEventArgs = FluentAvalonia.UI.Navigation.FANavigationEventArgs;
using UserProfile = Ryujinx.Ava.UI.Models.UserProfile; using UserProfile = Ryujinx.Ava.UI.Models.UserProfile;
namespace Ryujinx.Ava.UI.Views.User namespace Ryujinx.Ava.UI.Views.User
@@ -26,7 +27,7 @@ namespace Ryujinx.Ava.UI.Views.User
public UserEditorView() public UserEditorView()
{ {
InitializeComponent(); InitializeComponent();
AddHandler(Frame.NavigatedToEvent, (_, e) => AddHandler(FAFrame.NavigatedToEvent, (_, e) =>
{ {
NavigatedTo(e); NavigatedTo(e);
}, RoutingStrategies.Direct); }, RoutingStrategies.Direct);
@@ -38,7 +39,7 @@ namespace Ryujinx.Ava.UI.Views.User
{ {
switch (arg.NavigationMode) switch (arg.NavigationMode)
{ {
case NavigationMode.New: case FANavigationMode.New:
(NavigationDialogHost parent, UserProfile profile, bool isNewUser) = ((NavigationDialogHost parent, UserProfile profile, bool isNewUser))arg.Parameter; (NavigationDialogHost parent, UserProfile profile, bool isNewUser) = ((NavigationDialogHost parent, UserProfile profile, bool isNewUser))arg.Parameter;
_isNewUser = isNewUser; _isNewUser = isNewUser;
_profile = profile; _profile = profile;
@@ -48,7 +49,7 @@ namespace Ryujinx.Ava.UI.Views.User
break; break;
} }
((ContentDialog)_parent.Parent)?.Title = $"{LocaleManager.Instance[LocaleKeys.UserProfileWindowTitle]} - " + ((FAContentDialog)_parent.Parent)?.Title = $"{LocaleManager.Instance[LocaleKeys.UserProfileWindowTitle]} - " +
$"{(_isNewUser ? LocaleManager.Instance[LocaleKeys.UserEditorTitleCreate] : LocaleManager.Instance[LocaleKeys.UserEditorTitle])}"; $"{(_isNewUser ? LocaleManager.Instance[LocaleKeys.UserEditorTitleCreate] : LocaleManager.Instance[LocaleKeys.UserEditorTitle])}";
DataContext = TempProfile; DataContext = TempProfile;
@@ -73,7 +73,7 @@
MinWidth="50" MinWidth="50"
Height="35" Height="35"
Click="GoBack"> Click="GoBack">
<ui:SymbolIcon Symbol="Back" /> <ui:FASymbolIcon Symbol="Back" />
</Button> </Button>
</StackPanel> </StackPanel>
<StackPanel <StackPanel
@@ -8,6 +8,7 @@ using Ryujinx.Ava.UI.ViewModels;
using Ryujinx.HLE.FileSystem; using Ryujinx.HLE.FileSystem;
using SkiaSharp; using SkiaSharp;
using System.IO; using System.IO;
using NavigationEventArgs = FluentAvalonia.UI.Navigation.FANavigationEventArgs;
namespace Ryujinx.Ava.UI.Views.User namespace Ryujinx.Ava.UI.Views.User
{ {
@@ -29,7 +30,7 @@ namespace Ryujinx.Ava.UI.Views.User
{ {
InitializeComponent(); InitializeComponent();
AddHandler(Frame.NavigatedToEvent, (_, e) => AddHandler(FAFrame.NavigatedToEvent, (_, e) =>
{ {
NavigatedTo(e); NavigatedTo(e);
}, RoutingStrategies.Direct); }, RoutingStrategies.Direct);
@@ -39,7 +40,7 @@ namespace Ryujinx.Ava.UI.Views.User
{ {
if (Program.PreviewerDetached) if (Program.PreviewerDetached)
{ {
if (arg.NavigationMode == NavigationMode.New) if (arg.NavigationMode == FANavigationMode.New)
{ {
(_parent, _profile) = ((NavigationDialogHost, TempProfile))arg.Parameter; (_parent, _profile) = ((NavigationDialogHost, TempProfile))arg.Parameter;
ContentManager = _parent.ContentManager; ContentManager = _parent.ContentManager;
@@ -34,7 +34,7 @@
Width="50" Width="50"
MinWidth="50" MinWidth="50"
Click="GoBack"> Click="GoBack">
<ui:SymbolIcon Symbol="Back" /> <ui:FASymbolIcon Symbol="Back" />
</Button> </Button>
</StackPanel> </StackPanel>
<StackPanel <StackPanel
@@ -1,7 +1,7 @@
using Avalonia;
using Avalonia.Controls; using Avalonia.Controls;
using Avalonia.Interactivity; using Avalonia.Interactivity;
using Avalonia.Platform.Storage; using Avalonia.Platform.Storage;
using Avalonia.VisualTree;
using FluentAvalonia.UI.Controls; using FluentAvalonia.UI.Controls;
using FluentAvalonia.UI.Navigation; using FluentAvalonia.UI.Navigation;
using Ryujinx.Ava.Common.Locale; using Ryujinx.Ava.Common.Locale;
@@ -13,6 +13,7 @@ using Ryujinx.HLE.FileSystem;
using SkiaSharp; using SkiaSharp;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using NavigationEventArgs = FluentAvalonia.UI.Navigation.FANavigationEventArgs;
namespace Ryujinx.Ava.UI.Views.User namespace Ryujinx.Ava.UI.Views.User
{ {
@@ -27,7 +28,7 @@ namespace Ryujinx.Ava.UI.Views.User
public UserProfileImageSelectorView() public UserProfileImageSelectorView()
{ {
InitializeComponent(); InitializeComponent();
AddHandler(Frame.NavigatedToEvent, (_, e) => AddHandler(FAFrame.NavigatedToEvent, (_, e) =>
{ {
NavigatedTo(e); NavigatedTo(e);
}, RoutingStrategies.Direct); }, RoutingStrategies.Direct);
@@ -39,11 +40,11 @@ namespace Ryujinx.Ava.UI.Views.User
{ {
switch (arg.NavigationMode) switch (arg.NavigationMode)
{ {
case NavigationMode.New: case FANavigationMode.New:
(_parent, _profile) = ((NavigationDialogHost, TempProfile))arg.Parameter; (_parent, _profile) = ((NavigationDialogHost, TempProfile))arg.Parameter;
_contentManager = _parent.ContentManager; _contentManager = _parent.ContentManager;
((ContentDialog)_parent.Parent)?.Title = $"{LocaleManager.Instance[LocaleKeys.UserProfileWindowTitle]} - {LocaleManager.Instance[LocaleKeys.ProfileImageSelectionHeader]}"; ((FAContentDialog)_parent.Parent)?.Title = $"{LocaleManager.Instance[LocaleKeys.UserProfileWindowTitle]} - {LocaleManager.Instance[LocaleKeys.ProfileImageSelectionHeader]}";
if (Program.PreviewerDetached) if (Program.PreviewerDetached)
{ {
@@ -52,7 +53,7 @@ namespace Ryujinx.Ava.UI.Views.User
} }
break; break;
case NavigationMode.Back: case FANavigationMode.Back:
if (_profile.Image != null) if (_profile.Image != null)
{ {
_parent.GoBack(); _parent.GoBack();
@@ -65,8 +66,8 @@ namespace Ryujinx.Ava.UI.Views.User
private async void Import_OnClick(object sender, RoutedEventArgs e) private async void Import_OnClick(object sender, RoutedEventArgs e)
{ {
OsUtils.SetCoreDumpable(true); OsUtils.SetCoreDumpable(true);
if (this.GetVisualRoot() is Window window) if (TopLevel.GetTopLevel(this) is Window window)
{ {
IReadOnlyList<IStorageFile> result = await window.StorageProvider.OpenFilePickerAsync(new FilePickerOpenOptions IReadOnlyList<IStorageFile> result = await window.StorageProvider.OpenFilePickerAsync(new FilePickerOpenOptions
{ {
@@ -69,7 +69,7 @@
Width="50" Width="50"
MinWidth="50" MinWidth="50"
Click="GoBack"> Click="GoBack">
<ui:SymbolIcon Symbol="Back"/> <ui:FASymbolIcon Symbol="Back"/>
</Button> </Button>
</StackPanel> </StackPanel>
</Grid> </Grid>
@@ -4,6 +4,7 @@ using FluentAvalonia.UI.Controls;
using FluentAvalonia.UI.Navigation; using FluentAvalonia.UI.Navigation;
using Ryujinx.Ava.Common.Locale; using Ryujinx.Ava.Common.Locale;
using Ryujinx.Ava.UI.Controls; using Ryujinx.Ava.UI.Controls;
using NavigationEventArgs = FluentAvalonia.UI.Navigation.FANavigationEventArgs;
namespace Ryujinx.Ava.UI.Views.User namespace Ryujinx.Ava.UI.Views.User
{ {
@@ -14,7 +15,7 @@ namespace Ryujinx.Ava.UI.Views.User
public UserRecovererView() public UserRecovererView()
{ {
InitializeComponent(); InitializeComponent();
AddHandler(Frame.NavigatedToEvent, (_, e) => AddHandler(FAFrame.NavigatedToEvent, (_, e) =>
{ {
NavigatedTo(e); NavigatedTo(e);
}, RoutingStrategies.Direct); }, RoutingStrategies.Direct);
@@ -26,12 +27,12 @@ namespace Ryujinx.Ava.UI.Views.User
{ {
switch (arg.NavigationMode) switch (arg.NavigationMode)
{ {
case NavigationMode.New: case FANavigationMode.New:
NavigationDialogHost parent = (NavigationDialogHost)arg.Parameter; NavigationDialogHost parent = (NavigationDialogHost)arg.Parameter;
_parent = parent; _parent = parent;
((ContentDialog)_parent.Parent)?.Title = $"{LocaleManager.Instance[LocaleKeys.UserProfileWindowTitle]} - {LocaleManager.Instance[LocaleKeys.UserProfilesRecoverHeading]}"; ((FAContentDialog)_parent.Parent)?.Title = $"{LocaleManager.Instance[LocaleKeys.UserProfileWindowTitle]} - {LocaleManager.Instance[LocaleKeys.UserProfilesRecoverHeading]}";
break; break;
} }
@@ -114,7 +114,7 @@
BorderBrush="{DynamicResource AppListHoverBackgroundColor}" BorderBrush="{DynamicResource AppListHoverBackgroundColor}"
BorderThickness="1" BorderThickness="1"
IsVisible="{Binding !InGameList}"> IsVisible="{Binding !InGameList}">
<ui:SymbolIcon <ui:FASymbolIcon
Symbol="Help" Symbol="Help"
FontSize="30" FontSize="30"
HorizontalAlignment="Center" HorizontalAlignment="Center"
@@ -151,7 +151,7 @@
MinHeight="0" MinHeight="0"
Name="OpenLocation" Name="OpenLocation"
Click="OpenLocation"> Click="OpenLocation">
<ui:SymbolIcon <ui:FASymbolIcon
Symbol="OpenFolder" Symbol="OpenFolder"
HorizontalAlignment="Center" HorizontalAlignment="Center"
VerticalAlignment="Center" /> VerticalAlignment="Center" />
@@ -164,7 +164,7 @@
MinHeight="0" MinHeight="0"
Name="Delete" Name="Delete"
Click="Delete"> Click="Delete">
<ui:SymbolIcon <ui:FASymbolIcon
Symbol="Delete" Symbol="Delete"
HorizontalAlignment="Center" HorizontalAlignment="Center"
VerticalAlignment="Center" /> VerticalAlignment="Center" />
@@ -183,7 +183,7 @@
Width="50" Width="50"
MinWidth="50" MinWidth="50"
Click="GoBack"> Click="GoBack">
<ui:SymbolIcon Symbol="Back" /> <ui:FASymbolIcon Symbol="Back" />
</Button> </Button>
</StackPanel> </StackPanel>
</Grid> </Grid>
@@ -19,6 +19,7 @@ using System;
using System.Collections.ObjectModel; using System.Collections.ObjectModel;
using System.Threading.Tasks; using System.Threading.Tasks;
using Button = Avalonia.Controls.Button; using Button = Avalonia.Controls.Button;
using NavigationEventArgs = FluentAvalonia.UI.Navigation.FANavigationEventArgs;
using UserId = LibHac.Fs.UserId; using UserId = LibHac.Fs.UserId;
namespace Ryujinx.Ava.UI.Views.User namespace Ryujinx.Ava.UI.Views.User
@@ -35,7 +36,7 @@ namespace Ryujinx.Ava.UI.Views.User
public UserSaveManagerView() public UserSaveManagerView()
{ {
InitializeComponent(); InitializeComponent();
AddHandler(Frame.NavigatedToEvent, (_, e) => AddHandler(FAFrame.NavigatedToEvent, (_, e) =>
{ {
NavigatedTo(e); NavigatedTo(e);
}, RoutingStrategies.Direct); }, RoutingStrategies.Direct);
@@ -47,7 +48,7 @@ namespace Ryujinx.Ava.UI.Views.User
{ {
switch (arg.NavigationMode) switch (arg.NavigationMode)
{ {
case NavigationMode.New: case FANavigationMode.New:
(NavigationDialogHost parent, AccountManager accountManager, HorizonClient client, VirtualFileSystem virtualFileSystem) = ((NavigationDialogHost parent, AccountManager accountManager, HorizonClient client, VirtualFileSystem virtualFileSystem))arg.Parameter; (NavigationDialogHost parent, AccountManager accountManager, HorizonClient client, VirtualFileSystem virtualFileSystem) = ((NavigationDialogHost parent, AccountManager accountManager, HorizonClient client, VirtualFileSystem virtualFileSystem))arg.Parameter;
_accountManager = accountManager; _accountManager = accountManager;
_horizonClient = client; _horizonClient = client;
@@ -58,7 +59,7 @@ namespace Ryujinx.Ava.UI.Views.User
} }
DataContext = ViewModel = new UserSaveManagerViewModel(_accountManager); DataContext = ViewModel = new UserSaveManagerViewModel(_accountManager);
((ContentDialog)_parent.Parent)?.Title = $"{LocaleManager.Instance[LocaleKeys.UserProfileWindowTitle]} - {ViewModel.SaveManagerHeading}"; ((FAContentDialog)_parent.Parent)?.Title = $"{LocaleManager.Instance[LocaleKeys.UserProfileWindowTitle]} - {ViewModel.SaveManagerHeading}";
Task.Run(LoadSaves); Task.Run(LoadSaves);
} }
@@ -102,7 +102,7 @@
CornerRadius="12" CornerRadius="12"
Padding="0" Padding="0"
Click="EditUser"> Click="EditUser">
<ui:SymbolIcon Symbol="Edit" /> <ui:FASymbolIcon Symbol="Edit" />
</Button> </Button>
</Border> </Border>
</Grid> </Grid>
@@ -123,7 +123,7 @@
HorizontalAlignment="Center" HorizontalAlignment="Center"
VerticalAlignment="Center" VerticalAlignment="Center"
Click="AddUser"> Click="AddUser">
<ui:SymbolIcon Symbol="Add" /> <ui:FASymbolIcon Symbol="Add" />
</Button> </Button>
<Panel.Styles> <Panel.Styles>
<Style Selector="Panel"> <Style Selector="Panel">
@@ -8,6 +8,7 @@ using Ryujinx.Ava.UI.Controls;
using Ryujinx.Ava.UI.Models; using Ryujinx.Ava.UI.Models;
using Ryujinx.Ava.UI.ViewModels; using Ryujinx.Ava.UI.ViewModels;
using Button = Avalonia.Controls.Button; using Button = Avalonia.Controls.Button;
using NavigationEventArgs = FluentAvalonia.UI.Navigation.FANavigationEventArgs;
namespace Ryujinx.Ava.UI.Views.User namespace Ryujinx.Ava.UI.Views.User
{ {
@@ -23,7 +24,7 @@ namespace Ryujinx.Ava.UI.Views.User
if (Program.PreviewerDetached) if (Program.PreviewerDetached)
{ {
AddHandler(Frame.NavigatedToEvent, (_, e) => AddHandler(FAFrame.NavigatedToEvent, (_, e) =>
{ {
NavigatedTo(e); NavigatedTo(e);
}, RoutingStrategies.Direct); }, RoutingStrategies.Direct);
@@ -34,15 +35,15 @@ namespace Ryujinx.Ava.UI.Views.User
{ {
if (Program.PreviewerDetached) if (Program.PreviewerDetached)
{ {
if (arg.NavigationMode == NavigationMode.New) if (arg.NavigationMode == FANavigationMode.New)
{ {
_parent = (NavigationDialogHost)arg.Parameter; _parent = (NavigationDialogHost)arg.Parameter;
ViewModel = _parent.ViewModel; ViewModel = _parent.ViewModel;
} }
if (arg.NavigationMode == NavigationMode.Back) if (arg.NavigationMode == FANavigationMode.Back)
{ {
((ContentDialog)_parent.Parent)?.Title = LocaleManager.Instance[LocaleKeys.UserProfileWindowTitle]; ((FAContentDialog)_parent.Parent)?.Title = LocaleManager.Instance[LocaleKeys.UserProfileWindowTitle];
} }
DataContext = ViewModel; DataContext = ViewModel;
@@ -123,7 +124,7 @@ namespace Ryujinx.Ava.UI.Views.User
private void Close(object sender, RoutedEventArgs e) private void Close(object sender, RoutedEventArgs e)
{ {
((ContentDialog)_parent.Parent)?.Hide(); ((FAContentDialog)_parent.Parent)?.Hide();
} }
} }
} }
+1 -1
View File
@@ -24,7 +24,7 @@ namespace Ryujinx.Ava.UI.Windows
public static async Task Show() public static async Task Show()
{ {
ContentDialog contentDialog = new() FAContentDialog contentDialog = new()
{ {
PrimaryButtonText = "", PrimaryButtonText = "",
SecondaryButtonText = "", SecondaryButtonText = "",
@@ -12,12 +12,12 @@
Title="ContentDialogOverlayWindow" Title="ContentDialogOverlayWindow"
Focusable="False"> Focusable="False">
<window:StyleableWindow.Styles> <window:StyleableWindow.Styles>
<Style Selector="ui|ContentDialog /template/ Panel#LayoutRoot"> <Style Selector="ui|FAContentDialog /template/ Panel#LayoutRoot">
<Setter Property="Background" <Setter Property="Background"
Value="Transparent" /> Value="Transparent" />
</Style> </Style>
</window:StyleableWindow.Styles> </window:StyleableWindow.Styles>
<ui:ContentDialog Name="ContentDialog" <ui:FAContentDialog Name="ContentDialog"
IsPrimaryButtonEnabled="True" IsPrimaryButtonEnabled="True"
IsSecondaryButtonEnabled="True" IsSecondaryButtonEnabled="True"
IsVisible="False" IsVisible="False"
@@ -11,7 +11,7 @@ namespace Ryujinx.Ava.UI.Windows
TransparencyLevelHint = [WindowTransparencyLevel.Transparent]; TransparencyLevelHint = [WindowTransparencyLevel.Transparent];
WindowStartupLocation = WindowStartupLocation.Manual; WindowStartupLocation = WindowStartupLocation.Manual;
SystemDecorations = SystemDecorations.None; WindowDecorations = WindowDecorations.None;
ExtendClientAreaTitleBarHeightHint = 0; ExtendClientAreaTitleBarHeightHint = 0;
Background = Brushes.Transparent; Background = Brushes.Transparent;
CanResize = false; CanResize = false;
@@ -21,7 +21,7 @@
Spacing="5" Spacing="5"
Orientation="Horizontal" Orientation="Horizontal"
IsVisible="{Binding ShowBundledContentNotice}"> IsVisible="{Binding ShowBundledContentNotice}">
<ui:FontIcon <ui:FAFontIcon
Margin="0" Margin="0"
HorizontalAlignment="Stretch" HorizontalAlignment="Stretch"
FontFamily="avares://FluentAvalonia/Fonts#Symbols" FontFamily="avares://FluentAvalonia/Fonts#Symbols"
@@ -63,7 +63,7 @@
MinHeight="29" MinHeight="29"
MaxHeight="29" MaxHeight="29"
HorizontalAlignment="Stretch" HorizontalAlignment="Stretch"
Watermark="{locale:Locale Search}" PlaceholderText="{locale:Locale Search}"
Text="{Binding Search}" /> Text="{Binding Search}" />
</Grid> </Grid>
</Panel> </Panel>
@@ -124,7 +124,7 @@
MinWidth="0" MinWidth="0"
MinHeight="0" MinHeight="0"
Click="OpenLocation"> Click="OpenLocation">
<ui:SymbolIcon <ui:FASymbolIcon
Symbol="OpenFolder" Symbol="OpenFolder"
HorizontalAlignment="Center" HorizontalAlignment="Center"
VerticalAlignment="Center" /> VerticalAlignment="Center" />
@@ -136,7 +136,7 @@
MinWidth="0" MinWidth="0"
MinHeight="0" MinHeight="0"
Click="RemoveDLC"> Click="RemoveDLC">
<ui:SymbolIcon <ui:FASymbolIcon
Symbol="Cancel" Symbol="Cancel"
HorizontalAlignment="Center" HorizontalAlignment="Center"
VerticalAlignment="Center" /> VerticalAlignment="Center" />
@@ -31,7 +31,7 @@ namespace Ryujinx.Ava.UI.Windows
public static async Task Show(ApplicationLibrary applicationLibrary, ApplicationData applicationData) public static async Task Show(ApplicationLibrary applicationLibrary, ApplicationData applicationData)
{ {
ContentDialog contentDialog = new() FAContentDialog contentDialog = new()
{ {
PrimaryButtonText = "", PrimaryButtonText = "",
SecondaryButtonText = "", SecondaryButtonText = "",
@@ -51,12 +51,12 @@ namespace Ryujinx.Ava.UI.Windows
private void SaveAndClose(object sender, RoutedEventArgs routedEventArgs) private void SaveAndClose(object sender, RoutedEventArgs routedEventArgs)
{ {
ViewModel.Save(); ViewModel.Save();
((ContentDialog)Parent)?.Hide(); ((FAContentDialog)Parent)?.Hide();
} }
private void Close(object sender, RoutedEventArgs e) private void Close(object sender, RoutedEventArgs e)
{ {
((ContentDialog)Parent)?.Hide(); ((FAContentDialog)Parent)?.Hide();
} }
private void RemoveDLC(object sender, RoutedEventArgs e) private void RemoveDLC(object sender, RoutedEventArgs e)
+1 -1
View File
@@ -23,7 +23,7 @@
WindowStartupLocation="Manual" WindowStartupLocation="Manual"
Focusable="True"> Focusable="True">
<Window.Styles> <Window.Styles>
<Style Selector="TitleBar:fullscreen"> <Style Selector="WindowDrawnDecorations:fullscreen /template/ Border">
<Setter Property="Background" Value="#000000" /> <Setter Property="Background" Value="#000000" />
</Style> </Style>
</Window.Styles> </Window.Styles>
+10 -8
View File
@@ -125,17 +125,15 @@ namespace Ryujinx.Ava.UI.Windows
} }
} }
protected override void OnClosed(EventArgs e) /* protected override void OnClosed(EventArgs e)
{ {
base.OnClosed(e); base.OnClosed(e);
if (PlatformSettings != null) if (PlatformSettings != null)
{ {
/// <summary> // Unsubscribe to the ColorValuesChanged event
/// Unsubscribe to the ColorValuesChanged event
/// </summary>
PlatformSettings.ColorValuesChanged -= OnPlatformColorValuesChanged; PlatformSettings.ColorValuesChanged -= OnPlatformColorValuesChanged;
} }
} } */
protected override void OnApplyTemplate(TemplateAppliedEventArgs e) protected override void OnApplyTemplate(TemplateAppliedEventArgs e)
{ {
@@ -309,7 +307,7 @@ namespace Ryujinx.Ava.UI.Windows
LocaleManager.Instance[LocaleKeys.LinuxVmMaxMapCountDialogButtonUntilRestart], LocaleManager.Instance[LocaleKeys.LinuxVmMaxMapCountDialogButtonUntilRestart],
LocaleManager.Instance[LocaleKeys.LinuxVmMaxMapCountDialogButtonPersistent], LocaleManager.Instance[LocaleKeys.LinuxVmMaxMapCountDialogButtonPersistent],
LocaleManager.Instance[LocaleKeys.InputDialogNo], LocaleManager.Instance[LocaleKeys.InputDialogNo],
(int)Symbol.Help (int)FASymbol.Help
); );
int rc; int rc;
@@ -494,7 +492,11 @@ namespace Ryujinx.Ava.UI.Windows
_windowStartupWidthDelta = Math.Max(0, Width - ViewModel.WindowWidth); _windowStartupWidthDelta = Math.Max(0, Width - ViewModel.WindowWidth);
_windowStartupHeightDelta = Math.Max(0, Height - ViewModel.WindowHeight); _windowStartupHeightDelta = Math.Max(0, Height - ViewModel.WindowHeight);
PlatformSettings?.ColorValuesChanged += OnPlatformColorValuesChanged; // Subscribe to the ColorValuesChanged event
/* if (PlatformSettings != null)
{
PlatformSettings.ColorValuesChanged += OnPlatformColorValuesChanged;
} */
ViewModel.Initialize( ViewModel.Initialize(
ContentManager, ContentManager,
@@ -744,7 +746,7 @@ namespace Ryujinx.Ava.UI.Windows
Dispatcher.UIThread.InvokeAsync(async () => Dispatcher.UIThread.InvokeAsync(async () =>
{ {
await ContentDialogHelper.ShowTextDialog(LocaleManager.Instance[LocaleKeys.DialogConfirmationTitle], await ContentDialogHelper.ShowTextDialog(LocaleManager.Instance[LocaleKeys.DialogConfirmationTitle],
msg, "", "", "", LocaleManager.Instance[LocaleKeys.InputDialogOk], (int)Symbol.Checkmark); msg, "", "", "", LocaleManager.Instance[LocaleKeys.InputDialogOk], (int)FASymbol.Checkmark);
}); });
} }
} }
@@ -46,7 +46,7 @@
MinHeight="27" MinHeight="27"
MaxHeight="27" MaxHeight="27"
HorizontalAlignment="Stretch" HorizontalAlignment="Stretch"
Watermark="{locale:Locale Search}" PlaceholderText="{locale:Locale Search}"
Text="{Binding Search}" /> Text="{Binding Search}" />
</Grid> </Grid>
</Panel> </Panel>
@@ -91,7 +91,7 @@
MinHeight="0" MinHeight="0"
ToolTip.Tip="{Binding Path}" ToolTip.Tip="{Binding Path}"
Click="OpenLocation"> Click="OpenLocation">
<ui:SymbolIcon <ui:FASymbolIcon
Symbol="OpenFolder" Symbol="OpenFolder"
HorizontalAlignment="Center" HorizontalAlignment="Center"
VerticalAlignment="Center" /> VerticalAlignment="Center" />
@@ -103,7 +103,7 @@
MinWidth="0" MinWidth="0"
MinHeight="0" MinHeight="0"
Click="DeleteMod"> Click="DeleteMod">
<ui:SymbolIcon <ui:FASymbolIcon
Symbol="Cancel" Symbol="Cancel"
HorizontalAlignment="Center" HorizontalAlignment="Center"
VerticalAlignment="Center" /> VerticalAlignment="Center" />
@@ -33,7 +33,7 @@ namespace Ryujinx.Ava.UI.Windows
public static async Task Show(ulong titleId, ulong titleIdBase, ApplicationLibrary appLibrary, string titleName) public static async Task Show(ulong titleId, ulong titleIdBase, ApplicationLibrary appLibrary, string titleName)
{ {
ContentDialog contentDialog = new() FAContentDialog contentDialog = new()
{ {
PrimaryButtonText = "", PrimaryButtonText = "",
SecondaryButtonText = "", SecondaryButtonText = "",
@@ -53,12 +53,12 @@ namespace Ryujinx.Ava.UI.Windows
private void SaveAndClose(object sender, RoutedEventArgs e) private void SaveAndClose(object sender, RoutedEventArgs e)
{ {
ViewModel.Save(); ViewModel.Save();
((ContentDialog)Parent)?.Hide(); ((FAContentDialog)Parent)?.Hide();
} }
private void Close(object sender, RoutedEventArgs e) private void Close(object sender, RoutedEventArgs e)
{ {
((ContentDialog)Parent)?.Hide(); ((FAContentDialog)Parent)?.Hide();
} }
private async void DeleteMod(object sender, RoutedEventArgs e) private async void DeleteMod(object sender, RoutedEventArgs e)
+21 -21
View File
@@ -40,7 +40,7 @@
<settings:SettingsLoggingView Name="LoggingPage" /> <settings:SettingsLoggingView Name="LoggingPage" />
<settings:SettingsDebugView Name="DebugPage" /> <settings:SettingsDebugView Name="DebugPage" />
</Grid> </Grid>
<ui:NavigationView <ui:FANavigationView
Grid.Row="1" Grid.Row="1"
IsSettingsVisible="False" IsSettingsVisible="False"
Name="NavPanel" Name="NavPanel"
@@ -50,63 +50,63 @@
VerticalAlignment="Stretch" VerticalAlignment="Stretch"
HorizontalAlignment="Stretch" HorizontalAlignment="Stretch"
OpenPaneLength="200"> OpenPaneLength="200">
<ui:NavigationView.MenuItems> <ui:FANavigationView.MenuItems>
<ui:NavigationViewItem <ui:FANavigationViewItem
IsSelected="True" IsSelected="True"
Content="{locale:Locale SettingsTabGeneral}" Content="{locale:Locale SettingsTabGeneral}"
Tag="UiPage" Tag="UiPage"
IconSource="New" /> IconSource="New" />
<ui:NavigationViewItem <ui:FANavigationViewItem
Content="{locale:Locale SettingsTabInput}" Content="{locale:Locale SettingsTabInput}"
Tag="InputPage" Tag="InputPage"
IconSource="Games" /> IconSource="Games" />
<ui:NavigationViewItem <ui:FANavigationViewItem
Content="{locale:Locale SettingsTabHotkeys}" Content="{locale:Locale SettingsTabHotkeys}"
Tag="HotkeysPage" Tag="HotkeysPage"
IconSource="Keyboard" /> IconSource="Keyboard" />
<ui:NavigationViewItem <ui:FANavigationViewItem
Content="{locale:Locale SettingsTabSystem}" Content="{locale:Locale SettingsTabSystem}"
Tag="SystemPage" Tag="SystemPage"
IconSource="Settings" /> IconSource="Settings" />
<ui:NavigationViewItem <ui:FANavigationViewItem
Content="{locale:Locale SettingsTabCpu}" Content="{locale:Locale SettingsTabCpu}"
Tag="CpuPage"> Tag="CpuPage">
<ui:NavigationViewItem.IconSource> <ui:FANavigationViewItem.IconSource>
<ui:FontIconSource <ui:FAFontIconSource
FontFamily="avares://Ryujinx/Assets/Fonts#Segoe Fluent Icons" FontFamily="avares://Ryujinx/Assets/Fonts#Segoe Fluent Icons"
Glyph="{helpers:GlyphValueConverter Chip}" /> Glyph="{helpers:GlyphValueConverter Chip}" />
</ui:NavigationViewItem.IconSource> </ui:FANavigationViewItem.IconSource>
</ui:NavigationViewItem> </ui:FANavigationViewItem>
<ui:NavigationViewItem <ui:FANavigationViewItem
Content="{locale:Locale SettingsTabGraphics}" Content="{locale:Locale SettingsTabGraphics}"
Tag="GraphicsPage" Tag="GraphicsPage"
IconSource="Image" /> IconSource="Image" />
<ui:NavigationViewItem <ui:FANavigationViewItem
Content="{locale:Locale SettingsTabAudio}" Content="{locale:Locale SettingsTabAudio}"
IconSource="Audio" IconSource="Audio"
Tag="AudioPage" /> Tag="AudioPage" />
<ui:NavigationViewItem <ui:FANavigationViewItem
Content="{locale:Locale SettingsTabNetwork}" Content="{locale:Locale SettingsTabNetwork}"
Tag="NetworkPage" Tag="NetworkPage"
IconSource="Globe" /> IconSource="Globe" />
<ui:NavigationViewItem <ui:FANavigationViewItem
Content="{locale:Locale SettingsTabLogging}" Content="{locale:Locale SettingsTabLogging}"
Tag="LoggingPage" Tag="LoggingPage"
IconSource="Document" /> IconSource="Document" />
<ui:NavigationViewItem <ui:FANavigationViewItem
Content="{locale:Locale SettingsTabDebug}" Content="{locale:Locale SettingsTabDebug}"
Tag="DebugPage" Tag="DebugPage"
IconSource="Star" /> IconSource="Star" />
</ui:NavigationView.MenuItems> </ui:FANavigationView.MenuItems>
<ui:NavigationView.Styles> <ui:FANavigationView.Styles>
<Style Selector="Grid#PlaceholderGrid"> <Style Selector="Grid#PlaceholderGrid">
<Setter Property="Height" Value="40" /> <Setter Property="Height" Value="40" />
</Style> </Style>
<Style Selector="ui|NavigationViewItem ui|SymbolIcon"> <Style Selector="ui|FANavigationViewItem ui|FASymbolIcon">
<Setter Property="FlowDirection" Value="LeftToRight" /> <Setter Property="FlowDirection" Value="LeftToRight" />
</Style> </Style>
</ui:NavigationView.Styles> </ui:FANavigationView.Styles>
</ui:NavigationView> </ui:FANavigationView>
<ReversibleStackPanel <ReversibleStackPanel
Grid.Row="2" Grid.Row="2"
Margin="10" Margin="10"
@@ -1,10 +1,10 @@
using Avalonia.Controls; using Avalonia.Controls;
using FluentAvalonia.Core;
using FluentAvalonia.UI.Controls; using FluentAvalonia.UI.Controls;
using Ryujinx.Ava.Common.Locale; using Ryujinx.Ava.Common.Locale;
using Ryujinx.Ava.UI.ViewModels; using Ryujinx.Ava.UI.ViewModels;
using Ryujinx.HLE.FileSystem; using Ryujinx.HLE.FileSystem;
using System; using System;
using System.Linq;
namespace Ryujinx.Ava.UI.Windows namespace Ryujinx.Ava.UI.Windows
{ {
@@ -50,9 +50,9 @@ namespace Ryujinx.Ava.UI.Windows
NavPanel.SelectedItem = NavPanel.MenuItems.ElementAt(0); NavPanel.SelectedItem = NavPanel.MenuItems.ElementAt(0);
} }
private void NavPanelOnSelectionChanged(object sender, NavigationViewSelectionChangedEventArgs e) private void NavPanelOnSelectionChanged(object sender, FANavigationViewSelectionChangedEventArgs e)
{ {
if (e.SelectedItem is NavigationViewItem navItem && navItem.Tag is not null) if (e.SelectedItem is FANavigationViewItem navItem && navItem.Tag is not null)
{ {
switch (navItem.Tag.ToString()) switch (navItem.Tag.ToString())
{ {
+2 -2
View File
@@ -34,11 +34,11 @@ namespace Ryujinx.Ava.UI.Windows
FlowDirection = LocaleManager.Instance.IsRTL() ? FlowDirection.RightToLeft : FlowDirection.LeftToRight; FlowDirection = LocaleManager.Instance.IsRTL() ? FlowDirection.RightToLeft : FlowDirection.LeftToRight;
} }
protected override void OnApplyTemplate(TemplateAppliedEventArgs e) /* protected override void OnApplyTemplate(TemplateAppliedEventArgs e)
{ {
base.OnApplyTemplate(e); base.OnApplyTemplate(e);
ExtendClientAreaChromeHints = ExtendClientAreaChromeHints.SystemChrome | ExtendClientAreaChromeHints.OSXThickTitleBar; ExtendClientAreaChromeHints = ExtendClientAreaChromeHints.SystemChrome | ExtendClientAreaChromeHints.OSXThickTitleBar;
} } */
} }
} }
@@ -24,7 +24,7 @@
Spacing="5" Spacing="5"
Orientation="Horizontal" Orientation="Horizontal"
IsVisible="{Binding ShowBundledContentNotice}"> IsVisible="{Binding ShowBundledContentNotice}">
<ui:FontIcon <ui:FAFontIcon
Margin="0" Margin="0"
HorizontalAlignment="Stretch" HorizontalAlignment="Stretch"
FontFamily="avares://FluentAvalonia/Fonts#Symbols" FontFamily="avares://FluentAvalonia/Fonts#Symbols"
@@ -74,7 +74,7 @@
MinWidth="0" MinWidth="0"
MinHeight="0" MinHeight="0"
Click="OpenLocation"> Click="OpenLocation">
<ui:SymbolIcon <ui:FASymbolIcon
Symbol="OpenFolder" Symbol="OpenFolder"
HorizontalAlignment="Center" HorizontalAlignment="Center"
VerticalAlignment="Center" /> VerticalAlignment="Center" />
@@ -86,7 +86,7 @@
MinWidth="0" MinWidth="0"
MinHeight="0" MinHeight="0"
Click="RemoveUpdate"> Click="RemoveUpdate">
<ui:SymbolIcon <ui:FASymbolIcon
Symbol="Cancel" Symbol="Cancel"
HorizontalAlignment="Center" HorizontalAlignment="Center"
VerticalAlignment="Center" /> VerticalAlignment="Center" />
@@ -31,7 +31,7 @@ namespace Ryujinx.Ava.UI.Windows
public static async Task Show(ApplicationLibrary applicationLibrary, ApplicationData applicationData) public static async Task Show(ApplicationLibrary applicationLibrary, ApplicationData applicationData)
{ {
ContentDialog contentDialog = new() FAContentDialog contentDialog = new()
{ {
PrimaryButtonText = "", PrimaryButtonText = "",
SecondaryButtonText = "", SecondaryButtonText = "",
@@ -50,14 +50,14 @@ namespace Ryujinx.Ava.UI.Windows
private void Close(object sender, RoutedEventArgs e) private void Close(object sender, RoutedEventArgs e)
{ {
((ContentDialog)Parent)?.Hide(); ((FAContentDialog)Parent)?.Hide();
} }
public void Save(object sender, RoutedEventArgs e) public void Save(object sender, RoutedEventArgs e)
{ {
ViewModel.Save(); ViewModel.Save();
((ContentDialog)Parent)?.Hide(); ((FAContentDialog)Parent)?.Hide();
} }
private void OpenLocation(object sender, RoutedEventArgs e) private void OpenLocation(object sender, RoutedEventArgs e)
@@ -96,7 +96,7 @@
MaxHeight="29" MaxHeight="29"
Margin="5 0 5 0" Margin="5 0 5 0"
HorizontalAlignment="Stretch" HorizontalAlignment="Stretch"
Watermark="{locale:Locale Search}" PlaceholderText="{locale:Locale Search}"
Text="{Binding Search}" /> Text="{Binding Search}" />
<StackPanel <StackPanel
Grid.Column="2" Grid.Column="2"
@@ -30,7 +30,7 @@ namespace Ryujinx.Ava.UI.Windows
public static async Task Show(MainWindowViewModel mainWindowViewModel) public static async Task Show(MainWindowViewModel mainWindowViewModel)
{ {
ContentDialog contentDialog = new() FAContentDialog contentDialog = new()
{ {
PrimaryButtonText = "", PrimaryButtonText = "",
SecondaryButtonText = "", SecondaryButtonText = "",
@@ -59,7 +59,7 @@ namespace Ryujinx.Ava.UI.Windows
private void Close(object sender, RoutedEventArgs e) private void Close(object sender, RoutedEventArgs e)
{ {
((ContentDialog)Parent)?.Hide(); ((FAContentDialog)Parent)?.Hide();
} }
private void Cancel(Object sender, RoutedEventArgs e) private void Cancel(Object sender, RoutedEventArgs e)