UI: Update Avalonia to 12.0.2, FluentAvalonia to 3.0.0-preview2

- Update SkiaSharp to 3.119.4-preview.1.1

- Move DevTools Ctrl+F12 keybind to app initialization

- Use newer Optris.Icons.Avalonia for Avalonia 12
This commit is contained in:
KeatonTheBot 2026-05-08 22:10:43 -05:00
parent 81468c1d25
commit 51c92f5b48
80 changed files with 491 additions and 364 deletions

View file

@ -3,27 +3,27 @@
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="Avalonia" Version="11.3.15" />
<PackageVersion Include="Avalonia.Controls.DataGrid" Version="11.3.13" />
<PackageVersion Include="Avalonia.Desktop" Version="11.3.15" />
<PackageVersion Include="Avalonia.Diagnostics" Version="11.3.15" />
<PackageVersion Include="Avalonia.Markup.Xaml.Loader" Version="11.3.15" />
<PackageVersion Include="Avalonia" Version="12.0.2" />
<PackageVersion Include="Avalonia.Controls.DataGrid" Version="12.0.0" />
<PackageVersion Include="Avalonia.Desktop" Version="12.0.2" />
<PackageVersion Include="AvaloniaUI.DiagnosticsSupport" Version="2.2.1" />
<PackageVersion Include="Avalonia.Markup.Xaml.Loader" Version="12.0.2" />
<PackageVersion Include="SharpCompress" Version="0.48.1" />
<PackageVersion Include="Svg.Controls.Avalonia" Version="11.3.9.5" />
<PackageVersion Include="Svg.Controls.Skia.Avalonia" Version="11.3.9.5" />
<PackageVersion Include="Svg.Controls.Avalonia" Version="12.0.0.6" />
<PackageVersion Include="Svg.Controls.Skia.Avalonia" Version="12.0.0.6" />
<PackageVersion Include="Microsoft.Build.Framework" Version="17.11.4" />
<PackageVersion Include="Microsoft.Build.Utilities.Core" Version="17.12.50" />
<PackageVersion Include="Newtonsoft.Json" Version="13.0.4" />
<PackageVersion Include="Projektanker.Icons.Avalonia" Version="9.6.2" />
<PackageVersion Include="Projektanker.Icons.Avalonia.FontAwesome" Version="9.6.2" />
<PackageVersion Include="Projektanker.Icons.Avalonia.MaterialDesign" Version="9.6.2" />
<PackageVersion Include="Optris.Icons.Avalonia" Version="12.0.6" />
<PackageVersion Include="Optris.Icons.Avalonia.FontAwesome" Version="12.0.6" />
<PackageVersion Include="Optris.Icons.Avalonia.MaterialDesign" Version="12.0.6" />
<PackageVersion Include="Ryujinx.SDL3-CS" Version="2026.501.0" />
<PackageVersion Include="CommandLineParser" Version="2.9.1" />
<PackageVersion Include="CommunityToolkit.Mvvm" Version="8.4.2" />
<PackageVersion Include="Concentus" Version="2.2.2" />
<PackageVersion Include="DiscordRichPresence" Version="1.6.1.70" />
<PackageVersion Include="DynamicData" Version="9.4.31" />
<PackageVersion Include="FluentAvaloniaUI" Version="2.5.1" />
<PackageVersion Include="FluentAvaloniaUI" Version="3.0.0-preview2" />
<PackageVersion Include="Humanizer" Version="2.14.1" />
<PackageVersion Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.9.2" />
@ -57,10 +57,10 @@
<PackageVersion Include="Silk.NET.Vulkan" Version="2.23.0" />
<PackageVersion Include="Silk.NET.Vulkan.Extensions.EXT" Version="2.23.0" />
<PackageVersion Include="Silk.NET.Vulkan.Extensions.KHR" Version="2.23.0" />
<PackageVersion Include="SkiaSharp" Version="2.88.9" />
<PackageVersion Include="SkiaSharp.NativeAssets.Win32" Version="2.88.9" />
<PackageVersion Include="SkiaSharp.NativeAssets.macOS" Version="2.88.9" />
<PackageVersion Include="SkiaSharp.NativeAssets.Linux.NoDependencies" Version="2.88.9" />
<PackageVersion Include="SkiaSharp" Version="3.119.4-preview.1.1" />
<PackageVersion Include="SkiaSharp.NativeAssets.Win32" Version="3.119.4-preview.1.1" />
<PackageVersion Include="SkiaSharp.NativeAssets.macOS" Version="3.119.4-preview.1.1" />
<PackageVersion Include="SkiaSharp.NativeAssets.Linux.NoDependencies" Version="3.119.4-preview.1.1" />
<PackageVersion Include="SPB" Version="0.0.4-build32" />
<PackageVersion Include="System.IO.Hashing" Version="9.0.15" />
<PackageVersion Include="UnicornEngine.Unicorn" Version="2.1.3" />

View file

@ -23,15 +23,15 @@ namespace Ryujinx.HLE.HOS.Applets.SoftwareKeyboard
private readonly Lock _bufferLock = new();
private RenderingSurfaceInfo _surfaceInfo = null;
private RenderingSurfaceInfo _surfaceInfo;
private SKImageInfo _imageInfo;
private SKSurface _surface = null;
private byte[] _bufferData = null;
private SKSurface _surface;
private byte[] _bufferData;
private readonly SKBitmap _ryujinxLogo = null;
private readonly SKBitmap _padAcceptIcon = null;
private readonly SKBitmap _padCancelIcon = null;
private readonly SKBitmap _keyModeIcon = null;
private readonly SKBitmap _ryujinxLogo;
private readonly SKBitmap _padAcceptIcon;
private readonly SKBitmap _padCancelIcon;
private readonly SKBitmap _keyModeIcon;
private readonly float _textBoxOutlineWidth;
private readonly float _padPressedPenWidth;
@ -181,7 +181,7 @@ namespace Ryujinx.HLE.HOS.Applets.SoftwareKeyboard
if (newHeight != 0 && newWidth != 0)
{
SKBitmap resized = bitmap.Resize(new SKImageInfo(newWidth, newHeight), SKFilterQuality.High);
SKBitmap resized = bitmap.Resize(new SKImageInfo(newWidth, newHeight), new SKSamplingOptions(SKFilterMode.Linear));
if (resized != null)
{
bitmap.Dispose();
@ -220,14 +220,16 @@ namespace Ryujinx.HLE.HOS.Applets.SoftwareKeyboard
return;
}
using SKPaint paint = new(_messageFont)
{
Color = _textNormalColor,
IsAntialias = true
};
using SKFont font = new();
font.Edging = SKFontEdging.Alias;
font.Typeface = SKTypeface.Default;
using SKPaint paint = new();
paint.Color = _textNormalColor;
paint.IsAntialias = true;
SKCanvas canvas = _surface.Canvas;
SKRect messageRectangle = MeasureString(MessageText, paint);
SKRect messageRectangle = MeasureString(MessageText, font);
float messagePositionX = (_panelRectangle.Width - messageRectangle.Width) / 2 - messageRectangle.Left;
float messagePositionY = _messagePositionY - messageRectangle.Top;
SKPoint messagePosition = new(messagePositionX, messagePositionY);
@ -235,7 +237,7 @@ namespace Ryujinx.HLE.HOS.Applets.SoftwareKeyboard
canvas.DrawRect(messageBoundRectangle, _panelBrush);
canvas.DrawText(MessageText, messagePosition.X, messagePosition.Y + _messageFont.Metrics.XHeight + _messageFont.Metrics.Descent, paint);
canvas.DrawText(MessageText, messagePosition.X, messagePosition.Y + _messageFont.Metrics.XHeight + _messageFont.Metrics.Descent, SKTextAlign.Left, _messageFont, paint);
if (!state.TypingEnabled)
{
@ -303,33 +305,34 @@ namespace Ryujinx.HLE.HOS.Applets.SoftwareKeyboard
_logoPosition = new SKPoint(logoPositionX, logoPositionY);
}
private static SKRect MeasureString(string text, SKPaint paint)
private static SKRect MeasureString(string text, SKFont font)
{
SKRect bounds = SKRect.Empty;
SKRect bounds;
if (text == string.Empty)
{
paint.MeasureText(" ", ref bounds);
font.MeasureText(" ", out bounds);
}
else
{
paint.MeasureText(text, ref bounds);
font.MeasureText(text, out bounds);
}
return bounds;
}
private static SKRect MeasureString(ReadOnlySpan<char> text, SKPaint paint)
private static SKRect MeasureString(ReadOnlySpan<char> text, SKFont font)
{
SKRect bounds = SKRect.Empty;
SKRect bounds;
if (text == string.Empty)
{
paint.MeasureText(" ", ref bounds);
font.MeasureText(" ", out bounds);
}
else
{
paint.MeasureText(text, ref bounds);
font.MeasureText(text, out bounds);
}
return bounds;
@ -337,12 +340,14 @@ namespace Ryujinx.HLE.HOS.Applets.SoftwareKeyboard
private void DrawTextBox(SKCanvas canvas, SoftwareKeyboardUIState state)
{
using SKPaint textPaint = new(_labelsTextFont)
{
IsAntialias = true,
Color = _textNormalColor
};
SKRect inputTextRectangle = MeasureString(state.InputText, textPaint);
using SKFont textFont = new();
textFont.Edging = SKFontEdging.Alias;
textFont.Typeface = SKTypeface.Default;
using SKPaint textPaint = new();
textPaint.IsAntialias = true;
textPaint.Color = _textNormalColor;
SKRect inputTextRectangle = MeasureString(state.InputText, textFont);
float boxWidth = (int)(Math.Max(300, inputTextRectangle.Width + inputTextRectangle.Left + 8));
float boxHeight = 32;
@ -362,7 +367,7 @@ namespace Ryujinx.HLE.HOS.Applets.SoftwareKeyboard
float inputTextY = boxY + 5;
SKPoint inputTextPosition = new(inputTextX, inputTextY);
canvas.DrawText(state.InputText, inputTextPosition.X, inputTextPosition.Y + (_labelsTextFont.Metrics.XHeight + _labelsTextFont.Metrics.Descent), textPaint);
canvas.DrawText(state.InputText, inputTextPosition.X, inputTextPosition.Y + (_labelsTextFont.Metrics.XHeight + _labelsTextFont.Metrics.Descent), SKTextAlign.Left, _labelsTextFont, textPaint);
// Draw the cursor on top of the text and redraw the text with a different color if necessary.
@ -388,8 +393,8 @@ namespace Ryujinx.HLE.HOS.Applets.SoftwareKeyboard
ReadOnlySpan<char> textUntilBegin = state.InputText.AsSpan(0, state.CursorBegin);
ReadOnlySpan<char> textUntilEnd = state.InputText.AsSpan(0, state.CursorEnd);
SKRect selectionBeginRectangle = MeasureString(textUntilBegin, textPaint);
SKRect selectionEndRectangle = MeasureString(textUntilEnd, textPaint);
SKRect selectionBeginRectangle = MeasureString(textUntilBegin, textFont);
SKRect selectionEndRectangle = MeasureString(textUntilEnd, textFont);
cursorVisible = true;
cursorPositionXLeft = inputTextX + selectionBeginRectangle.Width + selectionBeginRectangle.Left;
@ -407,7 +412,7 @@ namespace Ryujinx.HLE.HOS.Applets.SoftwareKeyboard
int cursorBegin = Math.Min(state.InputText.Length, state.CursorBegin);
ReadOnlySpan<char> textUntilCursor = state.InputText.AsSpan(0, cursorBegin);
SKRect cursorTextRectangle = MeasureString(textUntilCursor, textPaint);
SKRect cursorTextRectangle = MeasureString(textUntilCursor, textFont);
cursorVisible = true;
cursorPositionXLeft = inputTextX + cursorTextRectangle.Width + cursorTextRectangle.Left;
@ -419,7 +424,7 @@ namespace Ryujinx.HLE.HOS.Applets.SoftwareKeyboard
if (state.CursorBegin < state.InputText.Length)
{
textUntilCursor = state.InputText.AsSpan(0, cursorBegin + 1);
cursorTextRectangle = MeasureString(textUntilCursor, textPaint);
cursorTextRectangle = MeasureString(textUntilCursor, textFont);
cursorPositionXRight = inputTextX + cursorTextRectangle.Width + cursorTextRectangle.Left;
}
else
@ -462,13 +467,11 @@ namespace Ryujinx.HLE.HOS.Applets.SoftwareKeyboard
SKCanvas textOverCanvas = textOverCursor.Canvas;
SKPoint textRelativePosition = new(inputTextPosition.X - cursorRectangle.Left, inputTextPosition.Y - cursorRectangle.Top);
using SKPaint cursorPaint = new(_inputTextFont)
{
Color = cursorTextColor,
IsAntialias = true
};
using SKPaint cursorPaint = new();
cursorPaint.Color = cursorTextColor;
cursorPaint.IsAntialias = true;
textOverCanvas.DrawText(state.InputText, textRelativePosition.X, textRelativePosition.Y + _inputTextFont.Metrics.XHeight + _inputTextFont.Metrics.Descent, cursorPaint);
textOverCanvas.DrawText(state.InputText, textRelativePosition.X, textRelativePosition.Y + _inputTextFont.Metrics.XHeight + _inputTextFont.Metrics.Descent, SKTextAlign.Left, _inputTextFont, cursorPaint);
SKPoint cursorPosition = new((int)cursorRectangle.Left, (int)cursorRectangle.Top);
textOverCursor.Flush();
@ -493,13 +496,15 @@ namespace Ryujinx.HLE.HOS.Applets.SoftwareKeyboard
float iconWidth = icon.Width;
float iconHeight = icon.Height;
using SKPaint paint = new(_labelsTextFont)
{
Color = _textNormalColor,
IsAntialias = true
};
using SKFont font = new();
font.Edging = SKFontEdging.Alias;
font.Typeface = SKTypeface.Default;
SKRect labelRectangle = MeasureString(label, paint);
using SKPaint paint = new();
paint.Color = _textNormalColor;
paint.IsAntialias = true;
SKRect labelRectangle = MeasureString(label, font);
float labelPositionX = iconWidth + 8 - labelRectangle.Left;
float labelPositionY = 3;
@ -526,7 +531,7 @@ namespace Ryujinx.HLE.HOS.Applets.SoftwareKeyboard
canvas.DrawRect(boundRectangle, _panelBrush);
canvas.DrawBitmap(icon, iconPosition);
canvas.DrawText(label, labelPosition.X, labelPosition.Y + _labelsTextFont.Metrics.XHeight + _labelsTextFont.Metrics.Descent, paint);
canvas.DrawText(label, labelPosition.X, labelPosition.Y + _labelsTextFont.Metrics.XHeight + _labelsTextFont.Metrics.Descent, SKTextAlign.Left, _labelsTextFont, paint);
if (enabled)
{
@ -546,12 +551,14 @@ namespace Ryujinx.HLE.HOS.Applets.SoftwareKeyboard
private void DrawControllerToggle(SKCanvas canvas, SKPoint point)
{
using SKPaint paint = new(_labelsTextFont)
{
IsAntialias = true,
Color = _textNormalColor
};
SKRect labelRectangle = MeasureString(ControllerToggleText, paint);
using SKFont font = new();
font.Edging = SKFontEdging.Alias;
font.Typeface = SKTypeface.Default;
using SKPaint paint = new();
paint.IsAntialias = true;
paint.Color = _textNormalColor;
SKRect labelRectangle = MeasureString(ControllerToggleText, font);
// Use relative positions so we can center the entire drawing later.
@ -579,7 +586,7 @@ namespace Ryujinx.HLE.HOS.Applets.SoftwareKeyboard
SKPoint overlayPosition = new((int)keyX, (int)keyY);
canvas.DrawBitmap(_keyModeIcon, overlayPosition);
canvas.DrawText(ControllerToggleText, labelPosition.X, labelPosition.Y + _labelsTextFont.Metrics.XHeight, paint);
canvas.DrawText(ControllerToggleText, labelPosition.X, labelPosition.Y + _labelsTextFont.Metrics.XHeight, SKTextAlign.Left, _labelsTextFont, paint);
}
public unsafe void CopyImageToBuffer()

View file

@ -37,12 +37,12 @@
Width="100"
VerticalAlignment="Center"
Text="Rrrrr"
UseFloatingWatermark="True"
Watermark="Hello" />
UseFloatingPlaceholder="True"
PlaceholderText="Hello" />
<CheckBox>Test Check</CheckBox>
</StackPanel>
</Grid>
<ui:NumberBox Value="1" />
<ui:FANumberBox Value="1" />
<MenuItem
Header="123 0000"
ToolTip.Tip="What this"/>
@ -248,7 +248,7 @@
<Setter Property="BorderBrush"
Value="{DynamicResource HighlightBrush}" />
</Style>
<Style Selector="Button:not(windowing|MinMaxCloseControl Button)">
<Style Selector="Button:not(windowing|FAMinMaxCloseControl Button)">
<Setter Property="MinWidth"
Value="80" />
</Style>

View file

@ -1,3 +1,4 @@
using Avalonia.Data;
using Avalonia.Data.Core;
using Avalonia.Markup.Xaml;
using Avalonia.Markup.Xaml.MarkupExtensions;

View file

@ -1,5 +1,5 @@
using Avalonia.Markup.Xaml.MarkupExtensions;
using Projektanker.Icons.Avalonia;
using Optris.Icons.Avalonia;
using Ryujinx.Ava.Common.Locale;
namespace Ryujinx.Ava.Common.Markup

View file

@ -2,9 +2,9 @@ using Avalonia;
using Avalonia.Threading;
using DiscordRPC;
using Gommon;
using Projektanker.Icons.Avalonia;
using Projektanker.Icons.Avalonia.FontAwesome;
using Projektanker.Icons.Avalonia.MaterialDesign;
using Optris.Icons.Avalonia;
using Optris.Icons.Avalonia.FontAwesome;
using Optris.Icons.Avalonia.MaterialDesign;
using Ryujinx.Ava.Systems;
using Ryujinx.Ava.Systems.Configuration;
using Ryujinx.Ava.Systems.Configuration.System;

View file

@ -43,7 +43,7 @@
<ItemGroup>
<PackageReference Include="Avalonia" />
<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.Markup.Xaml.Loader" />
<PackageReference Include="SharpCompress" />
@ -57,9 +57,9 @@
<PackageReference Include="CommandLineParser" />
<PackageReference Include="CommunityToolkit.Mvvm" />
<PackageReference Include="DiscordRichPresence" />
<PackageReference Include="Projektanker.Icons.Avalonia" />
<PackageReference Include="Projektanker.Icons.Avalonia.FontAwesome" />
<PackageReference Include="Projektanker.Icons.Avalonia.MaterialDesign" />
<PackageReference Include="Optris.Icons.Avalonia" />
<PackageReference Include="Optris.Icons.Avalonia.FontAwesome" />
<PackageReference Include="Optris.Icons.Avalonia.MaterialDesign" />
<PackageReference Include="OpenTK.Core" />
<PackageReference Include="Ryujinx.Audio.OpenAL" Condition="'$(RuntimeIdentifier)' != 'linux-x64' AND '$(RuntimeIdentifier)' != 'linux-arm64' AND '$(RuntimeIdentifier)' != 'osx-x64' AND '$(RuntimeIdentifier)' != 'osx-arm64'" />
<PackageReference Include="Ryujinx.Graphics.Nvdec.Dependencies.AllArch" />

View file

@ -24,11 +24,11 @@ namespace Ryujinx.Ava.Systems
bool shouldRestart = true;
TaskDialog taskDialog = new()
FATaskDialog taskDialog = new()
{
Header = LocaleManager.Instance[LocaleKeys.RyujinxRebooter],
SubHeader = LocaleManager.Instance[LocaleKeys.DialogRebooterMessage],
IconSource = new SymbolIconSource { Symbol = Symbol.Games },
IconSource = new FASymbolIconSource { Symbol = FASymbol.Games },
XamlRoot = RyujinxApp.MainWindow,
};

View file

@ -132,11 +132,11 @@ namespace Ryujinx.Ava.Systems
string updateFile = Path.Combine(_updateDir, "update.bin");
TaskDialog taskDialog = new()
FATaskDialog taskDialog = new()
{
Header = LocaleManager.Instance[LocaleKeys.RyujinxUpdater],
SubHeader = LocaleManager.Instance[LocaleKeys.UpdaterDownloading],
IconSource = new SymbolIconSource { Symbol = Symbol.Download },
IconSource = new FASymbolIconSource { Symbol = FASymbol.Download },
ShowProgressBar = true,
XamlRoot = RyujinxApp.MainWindow,
};
@ -239,7 +239,7 @@ namespace Ryujinx.Ava.Systems
}
}
private static void DoUpdateWithMultipleThreads(TaskDialog taskDialog, string downloadUrl, string updateFile)
private static void DoUpdateWithMultipleThreads(FATaskDialog taskDialog, string downloadUrl, string updateFile)
{
// Multi-Threaded Updater
long chunkSize = _buildSize / _connectionCount;
@ -283,7 +283,7 @@ namespace Ryujinx.Ava.Systems
Interlocked.Exchange(ref progressPercentage[index], args.ProgressPercentage);
Interlocked.Add(ref totalProgressPercentage, args.ProgressPercentage);
taskDialog.SetProgressBarState(totalProgressPercentage / _connectionCount, TaskDialogProgressState.Normal);
taskDialog.SetProgressBarState(totalProgressPercentage / _connectionCount, FATaskDialogProgressState.Normal);
};
client.DownloadDataCompleted += (_, args) =>
@ -357,7 +357,7 @@ namespace Ryujinx.Ava.Systems
}
}
private static void DoUpdateWithSingleThreadWorker(TaskDialog taskDialog, string downloadUrl, string updateFile)
private static void DoUpdateWithSingleThreadWorker(FATaskDialog taskDialog, string downloadUrl, string updateFile)
{
using HttpClient client = new();
// We do not want to timeout while downloading
@ -383,7 +383,7 @@ namespace Ryujinx.Ava.Systems
bytesWritten += readSize;
taskDialog.SetProgressBarState(GetPercentage(bytesWritten, totalBytes), TaskDialogProgressState.Normal);
taskDialog.SetProgressBarState(GetPercentage(bytesWritten, totalBytes), FATaskDialogProgressState.Normal);
RyujinxApp.SetTaskbarProgressValue(bytesWritten, totalBytes);
updateFileStream.Write(buffer, 0, readSize);
@ -398,7 +398,7 @@ namespace Ryujinx.Ava.Systems
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))
{
@ -439,11 +439,11 @@ namespace Ryujinx.Ava.Systems
archive.WriteToDirectory(outputDirectoryPath);
}
private static void InstallUpdate(TaskDialog taskDialog, string updateFile)
private static void InstallUpdate(FATaskDialog taskDialog, string updateFile)
{
// Extract Update
taskDialog.SubHeader = LocaleManager.Instance[LocaleKeys.UpdaterExtracting];
taskDialog.SetProgressBarState(0, TaskDialogProgressState.Normal);
taskDialog.SetProgressBarState(0, FATaskDialogProgressState.Normal);
if (OperatingSystem.IsLinux() || OperatingSystem.IsMacOS())
{
@ -460,7 +460,7 @@ namespace Ryujinx.Ava.Systems
// The new decompression implementations don't have a way to show progress
// so the progressbar is just set to 100% after the decompression is done
taskDialog.SetProgressBarState(100, TaskDialogProgressState.Normal);
taskDialog.SetProgressBarState(100, FATaskDialogProgressState.Normal);
// Delete downloaded zip
File.Delete(updateFile);
@ -468,7 +468,7 @@ namespace Ryujinx.Ava.Systems
List<string> allFiles = EnumerateFilesToDelete().ToList();
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.
if (!OperatingSystem.IsMacOS())
@ -484,7 +484,7 @@ namespace Ryujinx.Ava.Systems
Dispatcher.UIThread.InvokeAsync(() =>
{
taskDialog.SetProgressBarState(GetPercentage(count, allFiles.Count), TaskDialogProgressState.Normal);
taskDialog.SetProgressBarState(GetPercentage(count, allFiles.Count), FATaskDialogProgressState.Normal);
});
}
catch
@ -496,7 +496,7 @@ namespace Ryujinx.Ava.Systems
Dispatcher.UIThread.InvokeAsync(() =>
{
taskDialog.SubHeader = LocaleManager.Instance[LocaleKeys.UpdaterAddingFiles];
taskDialog.SetProgressBarState(0, TaskDialogProgressState.Normal);
taskDialog.SetProgressBarState(0, FATaskDialogProgressState.Normal);
});
MoveAllFilesOver(_updatePublishDir, _homeDir, taskDialog);
@ -587,7 +587,7 @@ namespace Ryujinx.Ava.Systems
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;
foreach (string directory in Directory.GetDirectories(root))
@ -611,7 +611,7 @@ namespace Ryujinx.Ava.Systems
Dispatcher.UIThread.InvokeAsync(() =>
{
taskDialog.SetProgressBarState(GetPercentage(count, total), TaskDialogProgressState.Normal);
taskDialog.SetProgressBarState(GetPercentage(count, total), FATaskDialogProgressState.Normal);
});
}
}

View file

@ -81,7 +81,7 @@ namespace Ryujinx.Ava.UI.Applet
LocaleManager.Instance[LocaleKeys.DialogOpenSettingsWindowLabel],
string.Empty,
LocaleManager.Instance[LocaleKeys.SettingsButtonClose],
(int)Symbol.Important,
(int)FASymbol.Important,
deferEvent,
async window =>
{

View file

@ -65,16 +65,16 @@ namespace Ryujinx.Ava.UI.Applet
public static async Task<UserResult> ShowControllerAppletDialog(MainWindow window, ControllerAppletUIArgs args)
{
ContentDialog contentDialog = new();
FAContentDialog contentDialog = new();
UserResult result = UserResult.Cancel;
ControllerAppletDialog content = new(window, args);
contentDialog.Title = LocaleManager.Instance[LocaleKeys.DialogControllerAppletTitle];
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;
}
@ -125,7 +125,7 @@ namespace Ryujinx.Ava.UI.Applet
public void Close()
{
((ContentDialog)Parent)?.Hide();
((FAContentDialog)Parent)?.Hide();
}
}
}

View file

@ -92,7 +92,7 @@ namespace Ryujinx.Ava.UI.Applet
return (defaultId, true);
}
ContentDialog contentDialog = new()
FAContentDialog contentDialog = new()
{
Title = LocaleManager.Instance[LocaleKeys.UserProfileWindowTitle],
PrimaryButtonText = LocaleManager.Instance[LocaleKeys.Continue],
@ -111,9 +111,9 @@ namespace Ryujinx.Ava.UI.Applet
return (result, input);
void Handler(ContentDialog sender, ContentDialogClosedEventArgs eventArgs)
void Handler(FAContentDialog sender, FAContentDialogClosedEventArgs eventArgs)
{
if (eventArgs.Result == ContentDialogResult.Primary)
if (eventArgs.Result == FAContentDialogResult.Primary)
{
result = viewModel.SelectedUserId;
input = true;

View file

@ -44,7 +44,7 @@
Text="{Binding Message}"
TextInput="Message_TextInput"
TextWrapping="Wrap"
UseFloatingWatermark="True" />
UseFloatingPlaceholder="True" />
<TextBlock
Name="Error"
Grid.Row="4"

View file

@ -21,7 +21,7 @@ namespace Ryujinx.Ava.UI.Controls
private int _inputMin;
private readonly string _placeholder;
private ContentDialog _host;
private FAContentDialog _host;
public SwkbdAppletDialog(string mainText, string secondaryText, string placeholder, string message)
{
@ -32,11 +32,11 @@ namespace Ryujinx.Ava.UI.Controls
_placeholder = placeholder;
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);
@ -48,7 +48,7 @@ namespace Ryujinx.Ava.UI.Controls
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
// 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)
{
ContentDialog contentDialog = new();
FAContentDialog contentDialog = new();
UserResult result = UserResult.Cancel;
@ -80,9 +80,9 @@ namespace Ryujinx.Ava.UI.Controls
contentDialog.CloseButtonText = LocaleManager.Instance[LocaleKeys.InputDialogCancel];
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;
input = content.Input.Text;
@ -174,7 +174,7 @@ namespace Ryujinx.Ava.UI.Controls
{
if (e.Key == Key.Enter && _host.IsPrimaryButtonEnabled)
{
_host.Hide(ContentDialogResult.Primary);
_host.Hide(FAContentDialogResult.Primary);
}
else
{

View file

@ -9,9 +9,9 @@
d:DesignHeight="450"
x:Class="Ryujinx.Ava.UI.Controls.NavigationDialogHost"
Focusable="True">
<ui:Frame
<ui:FAFrame
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
x:Name="ContentFrame">
</ui:Frame>
</UserControl>
</ui:FAFrame>
</UserControl>

View file

@ -69,7 +69,7 @@ namespace Ryujinx.Ava.UI.Controls
HorizonClient ownerHorizonClient)
{
NavigationDialogHost content = new(ownerAccountManager, ownerContentManager, ownerVirtualFileSystem, ownerHorizonClient);
ContentDialog contentDialog = new()
FAContentDialog contentDialog = new()
{
Title = LocaleManager.Instance[LocaleKeys.UserProfileWindowTitle],
PrimaryButtonText = string.Empty,

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);
}
}

View file

@ -23,8 +23,8 @@ namespace Ryujinx.Ava.UI.Helpers
private static bool _isChoiceDialogOpen;
private static ContentDialogOverlayWindow _contentDialogOverlayWindow;
public static ContentDialog ApplyStyles(
this ContentDialog contentDialog,
public static FAContentDialog ApplyStyles(
this FAContentDialog contentDialog,
double closeButtonWidth = 80,
HorizontalAlignment buttonSpaceAlignment = HorizontalAlignment.Right)
{
@ -48,11 +48,11 @@ namespace Ryujinx.Ava.UI.Helpers
string closeButton,
UserResult primaryButtonResult = UserResult.Ok,
ManualResetEvent deferResetEvent = null,
TypedEventHandler<ContentDialog, ContentDialogButtonClickEventArgs> deferCloseAction = null)
TypedEventHandler<FAContentDialog, FAContentDialogButtonClickEventArgs> deferCloseAction = null)
{
UserResult result = UserResult.None;
ContentDialog contentDialog = new()
FAContentDialog contentDialog = new()
{
Title = title,
PrimaryButtonText = primaryButton,
@ -97,7 +97,7 @@ namespace Ryujinx.Ava.UI.Helpers
int iconSymbol,
UserResult primaryButtonResult = UserResult.Ok,
ManualResetEvent deferResetEvent = null,
TypedEventHandler<ContentDialog, ContentDialogButtonClickEventArgs> deferCloseAction = null)
TypedEventHandler<FAContentDialog, FAContentDialogButtonClickEventArgs> deferCloseAction = null)
{
Grid content = CreateTextDialogContent(primaryText, secondaryText, iconSymbol);
@ -116,7 +116,7 @@ namespace Ryujinx.Ava.UI.Helpers
Action onClick,
UserResult primaryButtonResult = UserResult.Ok,
ManualResetEvent deferResetEvent = null,
TypedEventHandler<ContentDialog, ContentDialogButtonClickEventArgs> deferCloseAction = null)
TypedEventHandler<FAContentDialog, FAContentDialogButtonClickEventArgs> deferCloseAction = null)
{
Grid content = CreateTextDialogContentWithButton(primaryText, secondaryText, iconSymbol, buttonText, onClick);
@ -149,7 +149,7 @@ namespace Ryujinx.Ava.UI.Helpers
deferResetEvent,
DeferClose);
async void DeferClose(ContentDialog sender, ContentDialogButtonClickEventArgs args)
async void DeferClose(FAContentDialog sender, FAContentDialogButtonClickEventArgs args)
{
if (startedDeferring)
{
@ -160,7 +160,7 @@ namespace Ryujinx.Ava.UI.Helpers
startedDeferring = true;
Deferral deferral = args.GetDeferral();
FADeferral deferral = args.GetDeferral();
sender.PrimaryButtonClick -= DeferClose;
@ -193,9 +193,9 @@ namespace Ryujinx.Ava.UI.Helpers
MinHeight = 80,
};
content.Children.Add(new SymbolIcon
content.Children.Add(new FASymbolIcon
{
Symbol = (Symbol)symbol,
Symbol = (FASymbol)symbol,
Margin = new Thickness(10),
FontSize = 40,
FlowDirection = FlowDirection.LeftToRight,
@ -238,9 +238,9 @@ namespace Ryujinx.Ava.UI.Helpers
MinHeight = 80,
};
content.Children.Add(new SymbolIcon
content.Children.Add(new FASymbolIcon
{
Symbol = (Symbol)symbol,
Symbol = (FASymbol)symbol,
Margin = new Thickness(10),
FontSize = 40,
FlowDirection = FlowDirection.LeftToRight,
@ -262,10 +262,10 @@ namespace Ryujinx.Ava.UI.Helpers
Margin = new Thickness(2)
});
buttonContent.Children.Add(new SymbolIcon
buttonContent.Children.Add(new FASymbolIcon
{
FlowDirection = FlowDirection.LeftToRight,
Symbol = Symbol.Open
Symbol = FASymbol.Open
});
content.Children.Add(new TextBlock
@ -313,7 +313,7 @@ namespace Ryujinx.Ava.UI.Helpers
acceptButton,
string.Empty,
closeButton,
(int)Symbol.Important);
(int)FASymbol.Important);
internal static async Task<UserResult> CreateConfirmationDialog(
string primaryText,
@ -329,7 +329,7 @@ namespace Ryujinx.Ava.UI.Helpers
acceptButtonText,
string.Empty,
cancelButtonText,
(int)Symbol.Help,
(int)FASymbol.Help,
primaryButtonResult);
internal static async Task<UserResult> CreateDeniableConfirmationDialog(
@ -347,7 +347,7 @@ namespace Ryujinx.Ava.UI.Helpers
acceptButtonText,
noAcceptButtonText,
cancelButtonText,
(int)Symbol.Help,
(int)FASymbol.Help,
primaryButtonResult);
internal static async Task<UserResult> CreateLocalizedConfirmationDialog(string primaryText, string secondaryText)
@ -366,7 +366,7 @@ namespace Ryujinx.Ava.UI.Helpers
string.Empty,
string.Empty,
LocaleManager.Instance[LocaleKeys.InputDialogOk],
(int)Symbol.Important);
(int)FASymbol.Important);
internal static async Task CreateUpdaterUpToDateInfoDialog(string primary, string secondaryText,
string changelogUrl)
@ -378,7 +378,7 @@ namespace Ryujinx.Ava.UI.Helpers
string.Empty,
string.Empty,
LocaleManager.Instance[LocaleKeys.InputDialogOk],
(int)Symbol.Important,
(int)FASymbol.Important,
LocaleManager.Instance[LocaleKeys.DialogUpdaterShowChangelogMessage],
() => OpenHelper.OpenUrl(changelogUrl));
}
@ -391,7 +391,7 @@ namespace Ryujinx.Ava.UI.Helpers
string.Empty,
string.Empty,
LocaleManager.Instance[LocaleKeys.InputDialogOk],
(int)Symbol.Important);
(int)FASymbol.Important);
internal static async Task CreateErrorDialog(string errorMessage, string secondaryErrorMessage = "")
{
@ -404,7 +404,7 @@ namespace Ryujinx.Ava.UI.Helpers
secondaryErrorMessage,
string.Empty,
LocaleManager.Instance[LocaleKeys.InputDialogOk],
(int)Symbol.Dismiss);
(int)FASymbol.Dismiss);
}
internal static async Task<bool> CreateChoiceDialog(string title, string primary, string secondaryText)
@ -423,7 +423,7 @@ namespace Ryujinx.Ava.UI.Helpers
LocaleManager.Instance[LocaleKeys.InputDialogYes],
string.Empty,
LocaleManager.Instance[LocaleKeys.InputDialogNo],
(int)Symbol.Help,
(int)FASymbol.Help,
UserResult.Yes);
_isChoiceDialogOpen = false;
@ -447,7 +447,7 @@ namespace Ryujinx.Ava.UI.Helpers
LocaleManager.Instance[LocaleKeys.InputDialogYes],
string.Empty,
LocaleManager.Instance[LocaleKeys.InputDialogNo],
(int)Symbol.Help,
(int)FASymbol.Help,
LocaleManager.Instance[LocaleKeys.DialogUpdaterShowChangelogMessage],
() => OpenHelper.OpenUrl(changelogUrl),
UserResult.Yes);
@ -473,9 +473,9 @@ namespace Ryujinx.Ava.UI.Helpers
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;
Window parent = GetMainWindow();
@ -497,9 +497,11 @@ namespace Ryujinx.Ava.UI.Helpers
ShowInTaskbar = false,
};
/*
#if DEBUG
_contentDialogOverlayWindow.AttachDevTools(new KeyGesture(Key.F12, KeyModifiers.Control));
#endif
*/
parent.PositionChanged += OverlayOnPositionChanged;
@ -533,14 +535,14 @@ namespace Ryujinx.Ava.UI.Helpers
result = await ShowDialog();
}
result = await _contentDialogOverlayWindow.ShowDialog<ContentDialogResult>(parent);
result = await _contentDialogOverlayWindow.ShowDialog<FAContentDialogResult>(parent);
}
else
{
result = await ShowDialog();
}
async Task<ContentDialogResult> ShowDialog()
async Task<FAContentDialogResult> ShowDialog()
{
if (_contentDialogOverlayWindow is not null)
{
@ -550,7 +552,7 @@ namespace Ryujinx.Ava.UI.Helpers
}
else
{
result = ContentDialogResult.None;
result = FAContentDialogResult.None;
Logger.Warning?.Print(LogClass.UI, "Content dialog overlay failed to populate. Default value has been returned.");
}

View file

@ -11,12 +11,12 @@ namespace Ryujinx.Ava.UI.Helpers
private static readonly Dictionary<Glyph, string> _glyphs = new()
{
{ Glyph.List, char.ConvertFromUtf32((int)Symbol.List) },
{ Glyph.Grid, char.ConvertFromUtf32((int)Symbol.ViewAll) },
{ Glyph.List, char.ConvertFromUtf32((int)FASymbol.List) },
{ Glyph.Grid, char.ConvertFromUtf32((int)FASymbol.ViewAll) },
{ Glyph.Chip, char.ConvertFromUtf32(59748) },
{ Glyph.Device, char.ConvertFromUtf32(0xE7F7) },
{ Glyph.Bug, char.ConvertFromUtf32(0xEBE8) },
{ Glyph.Important, char.ConvertFromUtf32((int)Symbol.Important) },
{ Glyph.Important, char.ConvertFromUtf32((int)FASymbol.Important) },
};
public GlyphValueConverter(string key)

View file

@ -1,5 +1,6 @@
using Avalonia;
using Avalonia.Controls.ApplicationLifetimes;
using Avalonia.Input;
using Avalonia.Input.Platform;
using Avalonia.Markup.Xaml;
using Avalonia.Platform;
@ -46,7 +47,7 @@ namespace Ryujinx.Ava
return clipboard != null;
}
public static void SetTaskbarProgress(TaskBarProgressBarState state) => MainWindow.PlatformFeatures.SetTaskBarProgressBarState(state);
public static void SetTaskbarProgress(FATaskBarProgressBarState state) => MainWindow.PlatformFeatures.SetTaskBarProgressBarState(state);
public static void SetTaskbarProgressValue(ulong current, ulong total) => MainWindow.PlatformFeatures.SetTaskBarProgressBarValue(current, total);
public static void SetTaskbarProgressValue(long current, long total) => SetTaskbarProgressValue(Convert.ToUInt64(current), Convert.ToUInt64(total));
@ -59,6 +60,10 @@ namespace Ryujinx.Ava
AvaloniaXamlLoader.Load(this);
#if DEBUG
this.AttachDeveloperTools(options => options.Gesture = new KeyGesture(Key.F12, KeyModifiers.Control));
#endif
if (OperatingSystem.IsMacOS())
{
// Switches macOS key held behavior to repeat the input key instead of showing the character accents menu (like doing on an iOS keyboard would).

View file

@ -260,7 +260,7 @@ namespace Ryujinx.Ava.UI.ViewModels
string.Empty,
string.Empty,
LocaleManager.Instance[LocaleKeys.InputDialogOk],
(int)Symbol.Checkmark);
(int)FASymbol.Checkmark);
});
}
}

View file

@ -275,9 +275,11 @@ namespace Ryujinx.Ava.UI.ViewModels
SetMainContent = setMainContent;
TopLevel = topLevel;
/*
#if DEBUG
topLevel.AttachDevTools(new KeyGesture(Avalonia.Input.Key.F12, KeyModifiers.Control));
#endif
*/
Window.ApplicationLibrary.TotalTimePlayedRecalculated += TotalTimePlayed_Recalculated;
}
@ -1357,7 +1359,7 @@ namespace Ryujinx.Ava.UI.ViewModels
string.Empty,
string.Empty,
LocaleManager.Instance[LocaleKeys.InputDialogOk],
(int)Symbol.Checkmark);
(int)FASymbol.Checkmark);
});
}
}
@ -2652,7 +2654,7 @@ namespace Ryujinx.Ava.UI.ViewModels
await using Stream fileStream = await iconFile.OpenWriteAsync();
using SKBitmap bitmap = SKBitmap.Decode(viewModel.SelectedApplication.Icon)
.Resize(new SKSizeI(512, 512), SKFilterQuality.High);
.Resize(new SKSizeI(512, 512), new SKSamplingOptions(SKFilterMode.Linear));
using SKData png = bitmap.Encode(SKEncodedImageFormat.Png, 100);

View file

@ -196,7 +196,7 @@ namespace Ryujinx.Ava.UI.ViewModels
string.Empty,
string.Empty,
LocaleManager.Instance[LocaleKeys.InputDialogOk],
(int)Symbol.Checkmark
(int)FASymbol.Checkmark
));
}
}

View file

@ -23,7 +23,7 @@ namespace Ryujinx.Ava.UI.Views.Dialog
{
using AboutWindowViewModel viewModel = new();
ContentDialog contentDialog = new()
FAContentDialog contentDialog = new()
{
PrimaryButtonText = string.Empty,
SecondaryButtonText = string.Empty,

View file

@ -100,7 +100,7 @@
<Separator Margin="0, 10, 0, 10" Height="1" BorderBrush="Gray" Background="Gray" />
<StackPanel Orientation="Vertical" Spacing="5">
<StackPanel Orientation="Horizontal" Spacing="5">
<ui:SymbolIcon Foreground="ForestGreen" Symbol="Checkmark" IsVisible="{Binding AppData.HasRichPresenceAsset}"/>
<ui:FASymbolIcon Foreground="ForestGreen" Symbol="Checkmark" IsVisible="{Binding AppData.HasRichPresenceAsset}"/>
<TextBlock
Foreground="ForestGreen"
HorizontalAlignment="Stretch"
@ -109,7 +109,7 @@
TextAlignment="Start"
TextWrapping="Wrap" >
</TextBlock>
<ui:SymbolIcon Foreground="Red" Symbol="Cancel" IsVisible="{Binding !AppData.HasRichPresenceAsset}"/>
<ui:FASymbolIcon Foreground="Red" Symbol="Cancel" IsVisible="{Binding !AppData.HasRichPresenceAsset}"/>
<TextBlock
Foreground="Red"
HorizontalAlignment="Stretch"
@ -120,7 +120,7 @@
</TextBlock>
</StackPanel>
<StackPanel Orientation="Horizontal" Spacing="5" ToolTip.Tip="{Binding DynamicRichPresenceDescription}">
<ui:SymbolIcon
<ui:FASymbolIcon
Foreground="ForestGreen"
Symbol="Checkmark"
IsVisible="{Binding AppData.HasDynamicRichPresenceSupport}"/>
@ -132,7 +132,7 @@
TextAlignment="Start"
TextWrapping="Wrap">
</TextBlock>
<ui:SymbolIcon
<ui:FASymbolIcon
Foreground="Red"
Symbol="Cancel"
IsVisible="{Binding !AppData.HasDynamicRichPresenceSupport}"/>

View file

@ -18,7 +18,7 @@ namespace Ryujinx.Ava.UI.Views.Dialog
{
public static async Task Show(ApplicationData appData)
{
ContentDialog contentDialog = new()
FAContentDialog contentDialog = new()
{
Title = appData.Name,
PrimaryButtonText = string.Empty,
@ -42,7 +42,7 @@ namespace Ryujinx.Ava.UI.Views.Dialog
return;
if (RyujinxApp.AppLifetime.Windows.TryGetFirst(x => x is ContentDialogOverlayWindow, out Window window))
window.Close(ContentDialogResult.None);
window.Close(FAContentDialogResult.None);
await CompatibilityListWindow.Show((string)playabilityLabel.Tag);
}

View file

@ -22,7 +22,7 @@ namespace Ryujinx.Ava.UI.Views.Dialog
{
DlcSelectViewModel viewModel = new(selectedTitleId, appLibrary);
ContentDialog contentDialog = new()
FAContentDialog contentDialog = new()
{
PrimaryButtonText = LocaleManager.Instance[LocaleKeys.Continue],
SecondaryButtonText = string.Empty,

View file

@ -21,7 +21,7 @@
Spacing="5"
Orientation="Horizontal"
IsVisible="{Binding ShowBundledContentNotice}">
<ui:FontIcon
<ui:FAFontIcon
Margin="0"
HorizontalAlignment="Stretch"
FontFamily="avares://FluentAvalonia/Fonts#Symbols"
@ -63,7 +63,7 @@
MinHeight="29"
MaxHeight="29"
HorizontalAlignment="Stretch"
Watermark="{ext:Locale Search}"
PlaceholderText="{ext:Locale Search}"
Text="{Binding Search}" />
</Grid>
</Panel>
@ -123,7 +123,7 @@
MinWidth="0"
MinHeight="0"
Click="OpenLocation">
<ui:SymbolIcon
<ui:FASymbolIcon
Symbol="OpenFolder"
HorizontalAlignment="Center"
VerticalAlignment="Center" />
@ -135,7 +135,7 @@
MinWidth="0"
MinHeight="0"
Click="RemoveDLC">
<ui:SymbolIcon
<ui:FASymbolIcon
Symbol="Cancel"
HorizontalAlignment="Center"
VerticalAlignment="Center" />

View file

@ -21,7 +21,7 @@ namespace Ryujinx.Ava.UI.Views.Dialog
public static async Task Show(ApplicationLibrary applicationLibrary, ApplicationData applicationData)
{
ContentDialog contentDialog = new()
FAContentDialog contentDialog = new()
{
PrimaryButtonText = string.Empty,
SecondaryButtonText = string.Empty,
@ -44,12 +44,12 @@ namespace Ryujinx.Ava.UI.Views.Dialog
private void SaveAndClose(object sender, RoutedEventArgs routedEventArgs)
{
ViewModel.Save();
((ContentDialog)Parent).Hide();
((FAContentDialog)Parent).Hide();
}
private void Close(object sender, RoutedEventArgs e)
{
((ContentDialog)Parent).Hide();
((FAContentDialog)Parent).Hide();
}
private void RemoveDLC(object sender, RoutedEventArgs e)

View file

@ -46,7 +46,7 @@
MinHeight="27"
MaxHeight="27"
HorizontalAlignment="Stretch"
Watermark="{ext:Locale Search}"
PlaceholderText="{ext:Locale Search}"
Text="{Binding Search}" />
</Grid>
</Panel>
@ -91,7 +91,7 @@
MinHeight="0"
ToolTip.Tip="{Binding Path}"
Click="OpenLocation">
<ui:SymbolIcon
<ui:FASymbolIcon
Symbol="OpenFolder"
HorizontalAlignment="Center"
VerticalAlignment="Center" />
@ -103,7 +103,7 @@
MinWidth="0"
MinHeight="0"
Click="DeleteMod">
<ui:SymbolIcon
<ui:FASymbolIcon
Symbol="Cancel"
HorizontalAlignment="Center"
VerticalAlignment="Center" />

View file

@ -23,7 +23,7 @@ namespace Ryujinx.Ava.UI.Views.Dialog
public static async Task Show(ulong titleId, ulong titleIdBase, ApplicationLibrary appLibrary, string titleName)
{
ContentDialog contentDialog = new()
FAContentDialog contentDialog = new()
{
PrimaryButtonText = string.Empty,
SecondaryButtonText = string.Empty,
@ -46,12 +46,12 @@ namespace Ryujinx.Ava.UI.Views.Dialog
private void SaveAndClose(object sender, RoutedEventArgs e)
{
ViewModel.Save();
((ContentDialog)Parent).Hide();
((FAContentDialog)Parent).Hide();
}
private void Close(object sender, RoutedEventArgs e)
{
((ContentDialog)Parent).Hide();
((FAContentDialog)Parent).Hide();
}
private async void DeleteMod(object sender, RoutedEventArgs e)

View file

@ -21,7 +21,7 @@
Spacing="5"
Orientation="Horizontal"
IsVisible="{Binding ShowBundledContentNotice}">
<ui:FontIcon
<ui:FAFontIcon
Margin="0"
HorizontalAlignment="Stretch"
FontFamily="avares://FluentAvalonia/Fonts#Symbols"
@ -71,7 +71,7 @@
MinWidth="0"
MinHeight="0"
Click="OpenLocation">
<ui:SymbolIcon
<ui:FASymbolIcon
Symbol="OpenFolder"
HorizontalAlignment="Center"
VerticalAlignment="Center" />
@ -83,7 +83,7 @@
MinWidth="0"
MinHeight="0"
Click="RemoveUpdate">
<ui:SymbolIcon
<ui:FASymbolIcon
Symbol="Cancel"
HorizontalAlignment="Center"
VerticalAlignment="Center" />

View file

@ -21,7 +21,7 @@ namespace Ryujinx.Ava.UI.Views.Dialog
public static async Task Show(ApplicationLibrary applicationLibrary, ApplicationData applicationData)
{
ContentDialog contentDialog = new()
FAContentDialog contentDialog = new()
{
PrimaryButtonText = string.Empty,
SecondaryButtonText = string.Empty,
@ -43,14 +43,14 @@ namespace Ryujinx.Ava.UI.Views.Dialog
private void Close(object sender, RoutedEventArgs e)
{
((ContentDialog)Parent).Hide();
((FAContentDialog)Parent).Hide();
}
public void Save(object sender, RoutedEventArgs e)
{
ViewModel.Save();
((ContentDialog)Parent).Hide();
((FAContentDialog)Parent).Hide();
}
private void OpenLocation(object sender, RoutedEventArgs e)

View file

@ -40,13 +40,13 @@
Orientation="Vertical">
<StackPanel>
<RadioButton
Checked="Sort_Checked"
IsCheckedChanged="Sort_Checked"
Content="{ext:Locale XCITrimmerSortName}"
GroupName="Sort"
IsChecked="{Binding IsSortedByName, Mode=OneTime}"
Tag="Name" />
<RadioButton
Checked="Sort_Checked"
IsCheckedChanged="Sort_Checked"
Content="{ext:Locale XCITrimmerSortSaved}"
GroupName="Sort"
IsChecked="{Binding IsSortedBySaved, Mode=OneTime}"
@ -62,13 +62,13 @@
<Separator Height="0" HorizontalAlignment="Stretch" />
</Border>
<RadioButton
Checked="Order_Checked"
IsCheckedChanged="Order_Checked"
Content="{ext:Locale OrderAscending}"
GroupName="Order"
IsChecked="{Binding SortingAscending, Mode=OneTime}"
Tag="Ascending" />
<RadioButton
Checked="Order_Checked"
IsCheckedChanged="Order_Checked"
Content="{ext:Locale OrderDescending}"
GroupName="Order"
IsChecked="{Binding !SortingAscending, Mode=OneTime}"
@ -84,7 +84,7 @@
MaxHeight="29"
Margin="5 0 5 0"
HorizontalAlignment="Stretch"
Watermark="{ext:Locale Search}"
PlaceholderText="{ext:Locale Search}"
Text="{Binding Search}" />
<StackPanel
Grid.Column="2"

View file

@ -20,7 +20,7 @@ namespace Ryujinx.Ava.UI.Views.Dialog
public static async Task Show()
{
ContentDialog contentDialog = new()
FAContentDialog contentDialog = new()
{
PrimaryButtonText = string.Empty,
SecondaryButtonText = string.Empty,
@ -52,7 +52,7 @@ namespace Ryujinx.Ava.UI.Views.Dialog
private void Close(object sender, RoutedEventArgs e)
{
((ContentDialog)Parent).Hide();
((FAContentDialog)Parent).Hide();
}
private void Cancel(Object sender, RoutedEventArgs e)

View file

@ -7,7 +7,7 @@
xmlns:controls="clr-namespace:Ryujinx.Ava.UI.Controls"
xmlns:viewModels="clr-namespace:Ryujinx.Ava.UI.ViewModels.Input"
xmlns:helpers="clr-namespace:Ryujinx.Ava.UI.Helpers"
xmlns:pt="using:Projektanker.Icons.Avalonia"
xmlns:pt="using:Optris.Icons.Avalonia"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
d:DesignHeight="800"

View file

@ -76,7 +76,7 @@
VerticalAlignment="Center"
ToolTip.Tip="{ext:Locale ControllerSettingsCancelCurrentChangesToolTip}"
Command="{Binding RevertChanges}">
<ui:SymbolIcon
<ui:FASymbolIcon
Symbol="Undo"
FontSize="15"
Height="20" />
@ -111,7 +111,7 @@
VerticalAlignment="Center"
ToolTip.Tip="{ext:Locale ControllerSettingsLoadProfileToolTip}"
Command="{Binding LoadProfileButton}">
<ui:SymbolIcon
<ui:FASymbolIcon
Symbol="View"
FontSize="15"
Height="20" />
@ -123,7 +123,7 @@
VerticalAlignment="Center"
ToolTip.Tip="{ext:Locale ControllerSettingsSaveProfileToolTip}"
Command="{Binding SaveProfile}">
<ui:SymbolIcon
<ui:FASymbolIcon
Symbol="Save"
FontSize="15"
Height="20" />
@ -135,7 +135,7 @@
VerticalAlignment="Center"
ToolTip.Tip="{ext:Locale ControllerSettingsRemoveProfileToolTip}"
Command="{Binding RemoveProfile}">
<ui:SymbolIcon
<ui:FASymbolIcon
Symbol="Delete"
FontSize="15"
Height="20" />
@ -169,7 +169,7 @@
Margin="5,0,0,0"
VerticalAlignment="Center"
Command="{Binding LoadDevice}">
<ui:SymbolIcon
<ui:FASymbolIcon
Symbol="Refresh"
FontSize="15"
Height="20"/>

View file

@ -55,7 +55,7 @@ namespace Ryujinx.UI.Views.Input
{
LedInputView content = new(viewModel);
ContentDialog contentDialog = new()
FAContentDialog contentDialog = new()
{
Title = LocaleManager.Instance[LocaleKeys.ControllerLedTitle],
PrimaryButtonText = LocaleManager.Instance[LocaleKeys.ControllerSettingsSave],

View file

@ -115,7 +115,7 @@
Margin="0,10,0,0"
VerticalAlignment="Center"
Text="{ext:Locale ControllerSettingsMotionControllerSlot}" />
<ui:NumberBox
<ui:FANumberBox
Grid.Row="0"
Grid.Column="1"
Name="CemuHookSlotUpDown"
@ -130,7 +130,7 @@
Grid.Column="0"
VerticalAlignment="Center"
Text="{ext:Locale ControllerSettingsMotionRightJoyConSlot}" />
<ui:NumberBox
<ui:FANumberBox
Grid.Row="1"
Grid.Column="1"
Name="CemuHookRightJoyConSlotUpDown"

View file

@ -37,7 +37,7 @@ namespace Ryujinx.Ava.UI.Views.Input
{
MotionInputView content = new(viewModel);
ContentDialog contentDialog = new()
FAContentDialog contentDialog = new()
{
Title = LocaleManager.Instance[LocaleKeys.ControllerMotionTitle],
PrimaryButtonText = LocaleManager.Instance[LocaleKeys.ControllerSettingsSave],

View file

@ -32,7 +32,7 @@ namespace Ryujinx.Ava.UI.Views.Input
{
RumbleInputView content = new(viewModel);
ContentDialog contentDialog = new()
FAContentDialog contentDialog = new()
{
Title = LocaleManager.Instance[LocaleKeys.ControllerRumbleTitle],
PrimaryButtonText = LocaleManager.Instance[LocaleKeys.ControllerSettingsSave],

View file

@ -114,7 +114,7 @@ namespace Ryujinx.Ava.UI.Views.Main
{
base.OnAttachedToVisualTree(e);
if (VisualRoot is MainWindow window)
if (TopLevel.GetTopLevel(this) is MainWindow window)
{
Window = window;
DataContext = ViewModel = window.ViewModel;

View file

@ -38,7 +38,7 @@
VerticalAlignment="Center"
Background="Transparent"
Click="Refresh_OnClick">
<ui:SymbolIcon
<ui:FASymbolIcon
Width="50"
Height="100"
Symbol="Refresh" />
@ -103,7 +103,7 @@
Margin="-5,0,5,0"
Background="Transparent"
BorderThickness="0">
<ui:SymbolIcon Symbol="Settings"
<ui:FASymbolIcon Symbol="Settings"
HorizontalAlignment="Stretch"
VerticalAlignment="Center"
Width="14"

View file

@ -1,4 +1,5 @@
using Avalonia;
using Avalonia.Controls;
using Avalonia.Input;
using Avalonia.Interactivity;
using Avalonia.Threading;
@ -27,7 +28,7 @@ namespace Ryujinx.Ava.UI.Views.Main
{
base.OnAttachedToVisualTree(e);
if (VisualRoot is MainWindow window)
if (TopLevel.GetTopLevel(this) is MainWindow window)
{
Window = window;
ViewModel = window.ViewModel;

View file

@ -25,7 +25,7 @@
VerticalAlignment="Stretch"
Command="{Binding SetListMode}"
IsEnabled="{Binding IsGrid}">
<ui:FontIcon
<ui:FAFontIcon
Margin="0"
HorizontalAlignment="Stretch"
VerticalAlignment="Center"
@ -39,7 +39,7 @@
VerticalAlignment="Stretch"
Command="{Binding SetGridMode}"
IsEnabled="{Binding IsList}">
<ui:FontIcon
<ui:FAFontIcon
Margin="0"
HorizontalAlignment="Stretch"
VerticalAlignment="Center"
@ -73,7 +73,7 @@
DockPanel.Dock="Right"
KeyUp="SearchBox_OnKeyUp"
Text="{Binding SearchText}"
Watermark="{ext:Locale MenuSearch}" />
PlaceholderText="{ext:Locale MenuSearch}" />
<DropDownButton
Width="150"
HorizontalAlignment="Right"
@ -88,55 +88,55 @@
Orientation="Vertical">
<StackPanel>
<RadioButton
Checked="Sort_Checked"
IsCheckedChanged="Sort_Checked"
Content="{ext:Locale CommonFavorite}"
GroupName="Sort"
IsChecked="{Binding IsSortedByFavorite, Mode=OneTime}"
Tag="Favorite" />
<RadioButton
Checked="Sort_Checked"
IsCheckedChanged="Sort_Checked"
Content="{ext:Locale GameListHeaderApplication}"
GroupName="Sort"
IsChecked="{Binding IsSortedByTitle, Mode=OneTime}"
Tag="Title" />
<RadioButton
Checked="Sort_Checked"
IsCheckedChanged="Sort_Checked"
Content="{ext:Locale DlcManagerTableHeadingTitleIdLabel}"
GroupName="Sort"
IsChecked="{Binding IsSortedByTitleId, Mode=OneTime}"
Tag="TitleId" />
<RadioButton
Checked="Sort_Checked"
IsCheckedChanged="Sort_Checked"
Content="{ext:Locale GameListSortDeveloper}"
GroupName="Sort"
IsChecked="{Binding IsSortedByDeveloper, Mode=OneTime}"
Tag="Developer" />
<RadioButton
Checked="Sort_Checked"
IsCheckedChanged="Sort_Checked"
Content="{ext:Locale GameListSortTimePlayed}"
GroupName="Sort"
IsChecked="{Binding IsSortedByTimePlayed, Mode=OneTime}"
Tag="TotalTimePlayed" />
<RadioButton
Checked="Sort_Checked"
IsCheckedChanged="Sort_Checked"
Content="{ext:Locale GameListSortLastPlayed}"
GroupName="Sort"
IsChecked="{Binding IsSortedByLastPlayed, Mode=OneTime}"
Tag="LastPlayed" />
<RadioButton
Checked="Sort_Checked"
IsCheckedChanged="Sort_Checked"
Content="{ext:Locale GameListSortFileExtension}"
GroupName="Sort"
IsChecked="{Binding IsSortedByType, Mode=OneTime}"
Tag="FileType" />
<RadioButton
Checked="Sort_Checked"
IsCheckedChanged="Sort_Checked"
Content="{ext:Locale GameListSortFileSize}"
GroupName="Sort"
IsChecked="{Binding IsSortedBySize, Mode=OneTime}"
Tag="FileSize" />
<RadioButton
Checked="Sort_Checked"
IsCheckedChanged="Sort_Checked"
Content="{ext:Locale GameListSortPath}"
GroupName="Sort"
IsChecked="{Binding IsSortedByPath, Mode=OneTime}"
@ -152,13 +152,13 @@
<Separator Height="0" HorizontalAlignment="Stretch" />
</Border>
<RadioButton
Checked="Order_Checked"
IsCheckedChanged="Order_Checked"
Content="{ext:Locale OrderAscending}"
GroupName="Order"
IsChecked="{Binding IsAscending, Mode=OneTime}"
Tag="Ascending" />
<RadioButton
Checked="Order_Checked"
IsCheckedChanged="Order_Checked"
Content="{ext:Locale OrderDescending}"
GroupName="Order"
IsChecked="{Binding !IsAscending, Mode=OneTime}"

View file

@ -21,7 +21,7 @@ namespace Ryujinx.Ava.UI.Views.Main
{
base.OnAttachedToVisualTree(e);
if (VisualRoot is MainWindow window)
if (TopLevel.GetTopLevel(this) is MainWindow window)
{
ViewModel = window.ViewModel;
}

View file

@ -76,7 +76,7 @@
</Panel>
</Grid>
</Border>
<ui:SymbolIcon
<ui:FASymbolIcon
Margin="2.5,2.5,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Top"
@ -84,7 +84,7 @@
Foreground="{DynamicResource FavoriteApplicationIconColor}"
IsVisible="{Binding Favorite}"
Symbol="StarFilled" />
<ui:SymbolIcon
<ui:FASymbolIcon
Margin="0,2.5,2.5,0"
HorizontalAlignment="Right"
VerticalAlignment="Top"

View file

@ -201,7 +201,7 @@
TextAlignment="End"
TextWrapping="Wrap" />
</StackPanel>
<ui:SymbolIcon
<ui:FASymbolIcon
Grid.Row="0"
Grid.Column="0"
Margin="-7.5,-7.5,0,0"
@ -211,7 +211,7 @@
Foreground="{DynamicResource FavoriteApplicationIconColor}"
IsVisible="{Binding Favorite}"
Symbol="StarFilled" />
<ui:SymbolIcon
<ui:FASymbolIcon
Grid.Row="0"
Grid.Column="0"
Margin="0,-7.5,-7.5,0"

View file

@ -55,7 +55,7 @@
<TextBlock VerticalAlignment="Center"
Text="{ext:Locale SettingsTabSystemAudioVolume}"
Width="250" />
<ui:NumberBox Value="{Binding Volume}"
<ui:FANumberBox Value="{Binding Volume}"
Width="350"
SmallChange="1"
LargeChange="10"

View file

@ -96,7 +96,7 @@
Text="{ext:Locale SettingsTabSystemTurboMultiplier}"
ToolTip.Tip="{ext:Locale SettingsTabSystemTurboMultiplierToolTip}"
Width="250" />
<ui:NumberBox ToolTip.Tip="{ext:Locale SettingsTabSystemTurboMultiplierValueToolTip}"
<ui:FANumberBox ToolTip.Tip="{ext:Locale SettingsTabSystemTurboMultiplierValueToolTip}"
Value="{Binding TurboMultiplier}"
Width="165"
SmallChange="1.0"

View file

@ -42,7 +42,7 @@
<TextBlock VerticalAlignment="Center"
Text="{ext:Locale SettingsTabDebugGDBStubPort}"
Width="250" />
<ui:NumberBox Value="{Binding GDBStubPort}"
<ui:FANumberBox Value="{Binding GDBStubPort}"
Width="350"
SmallChange="1"
LargeChange="10"

View file

@ -116,7 +116,7 @@
<ComboBoxItem
Content="{ext:Locale SettingsTabGraphicsResolutionScaleCustom}" />
</ComboBox>
<ui:NumberBox
<ui:FANumberBox
Margin="10,0,0,0"
ToolTip.Tip="{ext:Locale ResolutionScaleEntryTooltip}"
MinWidth="150"

View file

@ -87,7 +87,7 @@
ToolTip.Tip="{ext:Locale FSAccessLogModeTooltip}"
Text="{ext:Locale SettingsTabLoggingFsGlobalAccessLogMode}"
Width="285" />
<ui:NumberBox
<ui:FANumberBox
Maximum="3"
Minimum="0"
Width="150"

View file

@ -55,7 +55,7 @@
Width="250"
MaxLength="16"
ToolTip.Tip="{ext:Locale LdnPassphraseInputTooltip}"
Watermark="{ext:Locale LdnPassphraseInputPublic}" />
PlaceholderText="{ext:Locale LdnPassphraseInputPublic}" />
<Button
Name="GenLdnPassButton"
Grid.Column="1"

View file

@ -182,7 +182,7 @@
<TextBox
Name="GameDirPathBox"
Margin="0"
Watermark="{ext:Locale AddGameDirBoxTooltip}"
PlaceholderText="{ext:Locale AddGameDirBoxTooltip}"
VerticalAlignment="Stretch" />
<Button
Name="AddGameDirButton"
@ -234,7 +234,7 @@
<TextBox
Name="AutoloadDirPathBox"
Margin="0"
Watermark="{ext:Locale AddGameDirBoxTooltip}"
PlaceholderText="{ext:Locale AddGameDirBoxTooltip}"
VerticalAlignment="Stretch" />
<Button
Name="AddAutoloadDirButton"

View file

@ -27,7 +27,7 @@
Width="300"
HorizontalAlignment="Stretch"
MaxLength="{Binding MaxProfileNameLength}"
Watermark="{ext:Locale ProfileNameSelectionWatermark}"
PlaceholderText="{ext:Locale ProfileNameSelectionWatermark}"
Text="{Binding Name}" />
<TextBlock Name="IdText" Text="{ext:Locale UserProfilesUserId}" />
<TextBox
@ -47,7 +47,7 @@
BorderBrush="{DynamicResource AppListHoverBackgroundColor}"
BorderThickness="1">
<Panel>
<ui:SymbolIcon
<ui:FASymbolIcon
FontSize="60"
Width="96"
Height="96"
@ -79,7 +79,7 @@
Width="50"
MinWidth="50"
Click="BackButton_Click">
<ui:SymbolIcon Symbol="Back" />
<ui:FASymbolIcon Symbol="Back" />
</Button>
</StackPanel>
<StackPanel

View file

@ -8,6 +8,7 @@ using Ryujinx.Ava.UI.Controls;
using Ryujinx.Ava.UI.Helpers;
using Ryujinx.Ava.UI.Models;
using Ryujinx.HLE.HOS.Services.Account.Acc;
using NavigationEventArgs = FluentAvalonia.UI.Navigation.FANavigationEventArgs;
using UserProfile = Ryujinx.Ava.UI.Models.UserProfile;
namespace Ryujinx.Ava.UI.Views.User
@ -24,7 +25,7 @@ namespace Ryujinx.Ava.UI.Views.User
public UserEditorView()
{
InitializeComponent();
AddHandler(Frame.NavigatedToEvent, (s, e) =>
AddHandler(FAFrame.NavigatedToEvent, (s, e) =>
{
NavigatedTo(e);
}, RoutingStrategies.Direct);
@ -36,7 +37,7 @@ namespace Ryujinx.Ava.UI.Views.User
{
switch (arg.NavigationMode)
{
case NavigationMode.New:
case FANavigationMode.New:
(NavigationDialogHost parent, UserProfile profile, bool isNewUser) = ((NavigationDialogHost parent, UserProfile profile, bool isNewUser))arg.Parameter;
_isNewUser = isNewUser;
_profile = profile;
@ -46,7 +47,7 @@ namespace Ryujinx.Ava.UI.Views.User
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])}";
AddPictureButton.IsVisible = _isNewUser;

View file

@ -69,7 +69,7 @@
MinWidth="50"
Height="35"
Click="GoBack">
<ui:SymbolIcon Symbol="Back" />
<ui:FASymbolIcon Symbol="Back" />
</Button>
</StackPanel>
<StackPanel

View file

@ -7,6 +7,7 @@ using Ryujinx.Ava.UI.ViewModels;
using Ryujinx.HLE.FileSystem;
using SkiaSharp;
using System.IO;
using NavigationEventArgs = FluentAvalonia.UI.Navigation.FANavigationEventArgs;
namespace Ryujinx.Ava.UI.Views.User
{
@ -26,7 +27,7 @@ namespace Ryujinx.Ava.UI.Views.User
{
InitializeComponent();
AddHandler(Frame.NavigatedToEvent, (s, e) =>
AddHandler(FAFrame.NavigatedToEvent, (s, e) =>
{
NavigatedTo(e);
}, RoutingStrategies.Direct);
@ -36,7 +37,7 @@ namespace Ryujinx.Ava.UI.Views.User
{
if (Program.PreviewerDetached)
{
if (arg.NavigationMode == NavigationMode.New)
if (arg.NavigationMode == FANavigationMode.New)
{
(_parent, _profile) = ((NavigationDialogHost, TempProfile))arg.Parameter;
ContentManager = _parent.ContentManager;

View file

@ -33,7 +33,7 @@
Width="50"
MinWidth="50"
Click="GoBack">
<ui:SymbolIcon Symbol="Back" />
<ui:FASymbolIcon Symbol="Back" />
</Button>
</StackPanel>
<StackPanel

View file

@ -1,17 +1,19 @@
using Avalonia.Controls;
using Avalonia.Interactivity;
using Avalonia.Platform.Storage;
using Avalonia.VisualTree;
using FluentAvalonia.UI.Controls;
using FluentAvalonia.UI.Navigation;
using Gommon;
using Ryujinx.Ava.Common.Locale;
using Ryujinx.Ava.UI.Controls;
using Ryujinx.Ava.UI.Models;
using Ryujinx.Ava.UI.ViewModels;
using Ryujinx.Ava.Utilities;
using Ryujinx.HLE.FileSystem;
using SkiaSharp;
using System.Collections.Generic;
using System.IO;
using NavigationEventArgs = FluentAvalonia.UI.Navigation.FANavigationEventArgs;
namespace Ryujinx.Ava.UI.Views.User
{
@ -24,7 +26,7 @@ namespace Ryujinx.Ava.UI.Views.User
public UserProfileImageSelectorView()
{
InitializeComponent();
AddHandler(Frame.NavigatedToEvent, (s, e) =>
AddHandler(FAFrame.NavigatedToEvent, (s, e) =>
{
NavigatedTo(e);
}, RoutingStrategies.Direct);
@ -36,11 +38,11 @@ namespace Ryujinx.Ava.UI.Views.User
{
switch (arg.NavigationMode)
{
case NavigationMode.New:
case FANavigationMode.New:
(_parent, _profile) = ((NavigationDialogHost, TempProfile))arg.Parameter;
_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)
{
@ -49,7 +51,7 @@ namespace Ryujinx.Ava.UI.Views.User
}
break;
case NavigationMode.Back:
case FANavigationMode.Back:
if (_profile.Image != null)
{
_parent.GoBack();
@ -62,9 +64,8 @@ namespace Ryujinx.Ava.UI.Views.User
private async void Import_OnClick(object sender, RoutedEventArgs e)
{
IReadOnlyList<IStorageFile> result = await ((Window)this.GetVisualRoot()!).StorageProvider.OpenFilePickerAsync(new FilePickerOpenOptions
Optional<IStorageFile> result = await ((Window)TopLevel.GetTopLevel(this))!.StorageProvider.OpenSingleFilePickerAsync(new FilePickerOpenOptions
{
AllowMultiple = false,
FileTypeFilter = new List<FilePickerFileType>
{
new(LocaleManager.Instance[LocaleKeys.AllSupportedFormats])
@ -76,9 +77,9 @@ namespace Ryujinx.Ava.UI.Views.User
},
});
if (result.Count > 0)
if (result.HasValue)
{
_profile.Image = ProcessProfileImage(File.ReadAllBytes(result[0].Path.LocalPath));
_profile.Image = ProcessProfileImage(await File.ReadAllBytesAsync(result.Value.Path.LocalPath));
_parent.GoBack();
}
}
@ -100,7 +101,7 @@ namespace Ryujinx.Ava.UI.Views.User
{
using SKBitmap bitmap = SKBitmap.Decode(buffer);
SKBitmap resizedBitmap = bitmap.Resize(new SKImageInfo(256, 256), SKFilterQuality.High);
SKBitmap resizedBitmap = bitmap.Resize(new SKImageInfo(256, 256), new SKSamplingOptions(SKFilterMode.Linear));
using MemoryStream streamJpg = new();

View file

@ -67,7 +67,7 @@
Width="50"
MinWidth="50"
Click="GoBack">
<ui:SymbolIcon Symbol="Back"/>
<ui:FASymbolIcon Symbol="Back"/>
</Button>
</StackPanel>
</Grid>

View file

@ -4,6 +4,7 @@ using FluentAvalonia.UI.Navigation;
using Ryujinx.Ava.Common.Locale;
using Ryujinx.Ava.UI.Controls;
using Ryujinx.Ava.UI.ViewModels;
using NavigationEventArgs = FluentAvalonia.UI.Navigation.FANavigationEventArgs;
namespace Ryujinx.Ava.UI.Views.User
{
@ -14,7 +15,7 @@ namespace Ryujinx.Ava.UI.Views.User
public UserRecovererView()
{
InitializeComponent();
AddHandler(Frame.NavigatedToEvent, (s, e) =>
AddHandler(FAFrame.NavigatedToEvent, (s, e) =>
{
NavigatedTo(e);
}, RoutingStrategies.Direct);
@ -26,12 +27,12 @@ namespace Ryujinx.Ava.UI.Views.User
{
switch (arg.NavigationMode)
{
case NavigationMode.New:
case FANavigationMode.New:
NavigationDialogHost parent = (NavigationDialogHost)arg.Parameter;
_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;
}

View file

@ -105,7 +105,7 @@
BorderBrush="{DynamicResource AppListHoverBackgroundColor}"
BorderThickness="1"
IsVisible="{Binding !InGameList}">
<ui:SymbolIcon
<ui:FASymbolIcon
Symbol="Help"
FontSize="30"
HorizontalAlignment="Center"
@ -142,7 +142,7 @@
MinHeight="0"
Name="OpenLocation"
Click="OpenLocation">
<ui:SymbolIcon
<ui:FASymbolIcon
Symbol="OpenFolder"
HorizontalAlignment="Center"
VerticalAlignment="Center" />
@ -155,7 +155,7 @@
MinHeight="0"
Name="Delete"
Click="Delete">
<ui:SymbolIcon
<ui:FASymbolIcon
Symbol="Delete"
HorizontalAlignment="Center"
VerticalAlignment="Center" />
@ -174,7 +174,7 @@
Width="50"
MinWidth="50"
Click="GoBack">
<ui:SymbolIcon Symbol="Back" />
<ui:FASymbolIcon Symbol="Back" />
</Button>
</StackPanel>
</Grid>

View file

@ -18,6 +18,7 @@ using System;
using System.Collections.ObjectModel;
using System.Threading.Tasks;
using Button = Avalonia.Controls.Button;
using NavigationEventArgs = FluentAvalonia.UI.Navigation.FANavigationEventArgs;
using UserId = LibHac.Fs.UserId;
namespace Ryujinx.Ava.UI.Views.User
@ -32,7 +33,7 @@ namespace Ryujinx.Ava.UI.Views.User
public UserSaveManagerView()
{
InitializeComponent();
AddHandler(Frame.NavigatedToEvent, (s, e) =>
AddHandler(FAFrame.NavigatedToEvent, (s, e) =>
{
NavigatedTo(e);
}, RoutingStrategies.Direct);
@ -44,7 +45,7 @@ namespace Ryujinx.Ava.UI.Views.User
{
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;
_accountManager = accountManager;
_horizonClient = client;
@ -55,7 +56,7 @@ namespace Ryujinx.Ava.UI.Views.User
}
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);
}

View file

@ -96,7 +96,7 @@
CornerRadius="12"
Padding="0"
Click="EditUser">
<ui:SymbolIcon Symbol="Edit" />
<ui:FASymbolIcon Symbol="Edit" />
</Button>
</Border>
</Grid>
@ -117,7 +117,7 @@
HorizontalAlignment="Center"
VerticalAlignment="Center"
Click="AddUser">
<ui:SymbolIcon Symbol="Add" />
<ui:FASymbolIcon Symbol="Add" />
</Button>
<Panel.Styles>
<Style Selector="Panel">

View file

@ -8,6 +8,7 @@ using Ryujinx.Ava.UI.Controls;
using Ryujinx.Ava.UI.Models;
using Ryujinx.Ava.UI.ViewModels;
using Button = Avalonia.Controls.Button;
using NavigationEventArgs = FluentAvalonia.UI.Navigation.FANavigationEventArgs;
namespace Ryujinx.Ava.UI.Views.User
{
@ -21,7 +22,7 @@ namespace Ryujinx.Ava.UI.Views.User
if (Program.PreviewerDetached)
{
AddHandler(Frame.NavigatedToEvent, (s, e) =>
AddHandler(FAFrame.NavigatedToEvent, (s, e) =>
{
NavigatedTo(e);
}, RoutingStrategies.Direct);
@ -32,15 +33,15 @@ namespace Ryujinx.Ava.UI.Views.User
{
if (Program.PreviewerDetached)
{
if (arg.NavigationMode == NavigationMode.New)
if (arg.NavigationMode == FANavigationMode.New)
{
_parent = (NavigationDialogHost)arg.Parameter;
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;
@ -121,7 +122,7 @@ namespace Ryujinx.Ava.UI.Views.User
private void Close(object sender, RoutedEventArgs e)
{
((ContentDialog)_parent.Parent).Hide();
((FAContentDialog)_parent.Parent).Hide();
}
}
}

View file

@ -29,7 +29,7 @@
Name="SearchBoxFlush"
Margin="0, 5, 0, 5"
HorizontalAlignment="Stretch"
Watermark="{ext:Locale CompatibilityListSearchBoxWatermarkWithCount}"
PlaceholderText="{ext:Locale CompatibilityListSearchBoxWatermarkWithCount}"
TextChanged="TextBox_OnTextChanged"/>
<StackPanel Grid.Column="2" Orientation="Horizontal" Margin="10, 5, 0, 5">
<DropDownButton
@ -46,13 +46,13 @@
Orientation="Vertical">
<StackPanel>
<RadioButton
Checked="Sort_Name_Checked"
IsCheckedChanged="Sort_Name_Checked"
Content="{ext:Locale GameListSortStatusNameAscending}"
GroupName="Sort"
IsChecked="{Binding IsSortedByTitle, Mode=OneTime}"
Tag="0" />
<RadioButton
Checked="Sort_Name_Checked"
IsCheckedChanged="Sort_Name_Checked"
Content="{ext:Locale GameListSortStatusNameDescending}"
GroupName="Sort"
Tag="1" />
@ -67,18 +67,18 @@
<Separator Height="0" HorizontalAlignment="Stretch" />
</Border>
<RadioButton
Checked="Sort_Status_Checked"
IsCheckedChanged="Sort_Status_Checked"
Content="{ext:Locale GameListSortStatusDisable}"
GroupName="Order"
IsChecked="{Binding IsSortedByStatus, Mode=OneTime}"
Tag="0" />
<RadioButton
Checked="Sort_Status_Checked"
IsCheckedChanged="Sort_Status_Checked"
Content="{ext:Locale GameListSortStatusAscending}"
GroupName="Order"
Tag="1" />
<RadioButton
Checked="Sort_Status_Checked"
IsCheckedChanged="Sort_Status_Checked"
Content="{ext:Locale GameListSortStatusDescending}"
GroupName="Order"
Tag="2" />
@ -94,7 +94,7 @@
<!-- UI NormalControls -->
<Grid Grid.Row="0" ColumnDefinitions="*,Auto,Auto,Auto" Name="NormalControls">
<TextBox Name="SearchBoxNormal" Grid.Column="0" Margin="15, 5, 0, 5" HorizontalAlignment="Stretch" Watermark="{ext:Locale CompatibilityListSearchBoxWatermarkWithCount}" TextChanged="TextBox_OnTextChanged" />
<TextBox Name="SearchBoxNormal" Grid.Column="0" Margin="15, 5, 0, 5" HorizontalAlignment="Stretch" PlaceholderText="{ext:Locale CompatibilityListSearchBoxWatermarkWithCount}" TextChanged="TextBox_OnTextChanged" />
<StackPanel Grid.Column="1" Orientation="Horizontal" Margin="10, 5, 5, 5">
<DropDownButton
Width="150"
@ -110,13 +110,13 @@
Orientation="Vertical">
<StackPanel>
<RadioButton
Checked="Sort_Name_Checked"
IsCheckedChanged="Sort_Name_Checked"
Content="{ext:Locale GameListSortStatusNameAscending}"
GroupName="Sort"
IsChecked="{Binding IsSortedByTitle, Mode=OneTime}"
Tag="0" />
<RadioButton
Checked="Sort_Name_Checked"
IsCheckedChanged="Sort_Name_Checked"
Content="{ext:Locale GameListSortStatusNameDescending}"
GroupName="Sort"
Tag="1" />
@ -131,18 +131,18 @@
<Separator Height="0" HorizontalAlignment="Stretch" />
</Border>
<RadioButton
Checked="Sort_Status_Checked"
IsCheckedChanged="Sort_Status_Checked"
Content="{ext:Locale GameListSortStatusDisable}"
GroupName="Order"
IsChecked="{Binding IsSortedByStatus, Mode=OneTime}"
Tag="0" />
<RadioButton
Checked="Sort_Status_Checked"
IsCheckedChanged="Sort_Status_Checked"
Content="{ext:Locale GameListSortStatusAscending}"
GroupName="Order"
Tag="1" />
<RadioButton
Checked="Sort_Status_Checked"
IsCheckedChanged="Sort_Status_Checked"
Content="{ext:Locale GameListSortStatusDescending}"
GroupName="Order"
Tag="2" />

View file

@ -12,12 +12,12 @@
Title="ContentDialogOverlayWindow"
Focusable="False">
<window:StyleableAppWindow.Styles>
<Style Selector="ui|ContentDialog /template/ Panel#LayoutRoot">
<Style Selector="ui|FAContentDialog /template/ Panel#LayoutRoot">
<Setter Property="Background"
Value="Transparent" />
</Style>
</window:StyleableAppWindow.Styles>
<ui:ContentDialog Name="ContentDialog"
<ui:FAContentDialog Name="ContentDialog"
IsPrimaryButtonEnabled="True"
IsSecondaryButtonEnabled="True"
IsVisible="False"

View file

@ -11,7 +11,7 @@ namespace Ryujinx.Ava.UI.Windows
TransparencyLevelHint = [WindowTransparencyLevel.Transparent];
WindowStartupLocation = WindowStartupLocation.Manual;
SystemDecorations = SystemDecorations.None;
WindowDecorations = WindowDecorations.None;
ExtendClientAreaTitleBarHeightHint = 0;
Background = Brushes.Transparent;
CanResize = false;

View file

@ -39,7 +39,7 @@
<settings:SettingsLoggingView Name="LoggingPage" />
<settings:SettingsHacksView Name="HacksPage" />
</Grid>
<ui:NavigationView
<ui:FANavigationView
Grid.Row="1"
IsSettingsVisible="False"
Name="NavPanel"
@ -52,7 +52,7 @@
IsPaneToggleButtonVisible="False">
<!-- For image -->
<ui:NavigationView.PaneHeader>
<ui:FANavigationView.PaneHeader>
<Grid HorizontalAlignment="Center" VerticalAlignment="Center" RowDefinitions="Auto,Auto,Auto,5">
<TextBlock Text="{Binding GameId}"
HorizontalAlignment="Center"
@ -72,54 +72,54 @@
TextAlignment="Center" Grid.Row="2" />
<Separator Height="1" Grid.Row="3" Margin="0,0,0,10" HorizontalAlignment="Stretch"/>
</Grid>
</ui:NavigationView.PaneHeader>
</ui:FANavigationView.PaneHeader>
<ui:NavigationView.MenuItems>
<ui:NavigationViewItem
<ui:FANavigationView.MenuItems>
<ui:FANavigationViewItem
IsSelected="True"
Content="{ext:Locale SettingsTabGeneral}"
Tag="UiPage"
IconSource="New" />
<ui:NavigationViewItem
<ui:FANavigationViewItem
Content="{ext:Locale SettingsTabInput}"
Tag="InputPage"
IconSource="Games" />
<ui:NavigationViewItem
<ui:FANavigationViewItem
Content="{ext:Locale SettingsTabSystem}"
Tag="SystemPage"
IconSource="Settings" />
<ui:NavigationViewItem
<ui:FANavigationViewItem
Content="{ext:Locale SettingsTabCpu}"
Tag="CpuPage">
<ui:NavigationViewItem.IconSource>
<ui:FontIconSource
<ui:FANavigationViewItem.IconSource>
<ui:FAFontIconSource
FontFamily="avares://Ryujinx/Assets/Fonts#Segoe Fluent Icons"
Glyph="{helpers:GlyphValueConverter Chip}" />
</ui:NavigationViewItem.IconSource>
</ui:NavigationViewItem>
<ui:NavigationViewItem
</ui:FANavigationViewItem.IconSource>
</ui:FANavigationViewItem>
<ui:FANavigationViewItem
Content="{ext:Locale SettingsTabGraphics}"
Tag="GraphicsPage"
IconSource="Image" />
<ui:NavigationViewItem
<ui:FANavigationViewItem
Content="{ext:Locale SettingsTabAudio}"
IconSource="Audio"
Tag="AudioPage" />
<ui:NavigationViewItem
<ui:FANavigationViewItem
Content="{ext:Locale SettingsTabNetwork}"
Tag="NetworkPage"
IconSource="Globe" />
<ui:NavigationViewItem
<ui:FANavigationViewItem
Content="{ext:Locale SettingsTabLogging}"
Tag="LoggingPage"
IconSource="Document" />
<ui:NavigationViewItem
<ui:FANavigationViewItem
IsVisible="{Binding ShowDirtyHacks}"
Content="Dirty Hacks"
Tag="HacksPage"
IconSource="Code" />
</ui:NavigationView.MenuItems>
</ui:NavigationView>
</ui:FANavigationView.MenuItems>
</ui:FANavigationView>
<Grid Grid.Row="3"
ColumnDefinitions="Auto,*,Auto">
<StackPanel Grid.Column="0" Orientation="Horizontal" Margin="10" Spacing="10">

View file

@ -57,10 +57,10 @@ namespace Ryujinx.Ava.UI.Windows
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())
{

View file

@ -29,7 +29,7 @@
Name="SearchBoxFlush"
Margin="0, 5, 0, 5"
HorizontalAlignment="Stretch"
Watermark="{ext:Locale LdnGameListSearchBoxWatermark}"
PlaceholderText="{ext:Locale LdnGameListSearchBoxWatermark}"
TextChanged="TextBox_OnTextChanged"/>
<Button
Grid.Column="2"
@ -53,7 +53,7 @@
VerticalAlignment="Stretch"
IsEnabled="{Binding !IsRefreshing}"
ToolTip.Tip="{ext:Locale LdnGameListRefreshToolTip}">
<facontrols:SymbolIcon Symbol="Refresh" />
<facontrols:FASymbolIcon Symbol="Refresh" />
</Button>
<StackPanel Grid.Column="4" Orientation="Horizontal" Margin="10, 5, 0, 5">
<DropDownButton
@ -138,7 +138,7 @@
<!-- UI NormalControls -->
<Grid Grid.Row="0" ColumnDefinitions="*,Auto,Auto,Auto,Auto,Auto" Name="NormalControls">
<TextBox Name="SearchBoxNormal" Grid.Column="0" Margin="20, 5, 0, 5" HorizontalAlignment="Stretch"
Watermark="{ext:Locale LdnGameListSearchBoxWatermark}" TextChanged="TextBox_OnTextChanged" />
PlaceholderText="{ext:Locale LdnGameListSearchBoxWatermark}" TextChanged="TextBox_OnTextChanged" />
<Button
Grid.Column="1"
Name="InfoNormal"
@ -151,7 +151,7 @@
Content="{ext:Icon fa-solid fa-info}"
ToolTip.Tip="{ext:Locale LdnGameListInfoButtonToolTip}"/>
<Button Grid.Column="2" Name="RefreshNormal" Margin="10, 5, 0, 5" MinWidth="32" MinHeight="32" ClipToBounds="False" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" IsEnabled="{Binding !IsRefreshing}">
<facontrols:SymbolIcon Symbol="Refresh" />
<facontrols:FASymbolIcon Symbol="Refresh" />
</Button>
<StackPanel Grid.Column="3" Orientation="Horizontal" Margin="10, 5, 0, 5">
<DropDownButton

View file

@ -26,7 +26,7 @@
GotFocus="AppWindow_OnGotFocus"
LostFocus="AppWindow_OnLostFocus">
<Window.Styles>
<Style Selector="TitleBar:fullscreen">
<Style Selector="WindowDrawnDecorations:fullscreen /template/ Border">
<Setter Property="Background" Value="#000000" />
</Style>
</Window.Styles>

View file

@ -121,14 +121,15 @@ namespace Ryujinx.Ava.UI.Windows
app.ApplyConfiguredTheme(ConfigurationState.Instance.UI.BaseStyle);
}
protected override void OnClosed(EventArgs e)
/* protected override void OnClosed(EventArgs e)
{
base.OnClosed(e);
if (PlatformSettings != null)
{
// Unsubscribe to the ColorValuesChanged event
PlatformSettings.ColorValuesChanged -= OnPlatformColorValuesChanged;
}
}
} */
protected override void OnApplyTemplate(TemplateAppliedEventArgs e)
{
@ -310,7 +311,7 @@ namespace Ryujinx.Ava.UI.Windows
LocaleManager.Instance[LocaleKeys.LinuxVmMaxMapCountDialogButtonUntilRestart],
LocaleManager.Instance[LocaleKeys.LinuxVmMaxMapCountDialogButtonPersistent],
LocaleManager.Instance[LocaleKeys.InputDialogNo],
(int)Symbol.Help
(int)FASymbol.Help
);
int rc;
@ -492,8 +493,12 @@ namespace Ryujinx.Ava.UI.Windows
base.OnOpened(e);
Initialize();
PlatformSettings!.ColorValuesChanged += OnPlatformColorValuesChanged;
// Subscribe to the ColorValuesChanged event
/* if (PlatformSettings != null)
{
PlatformSettings.ColorValuesChanged += OnPlatformColorValuesChanged;
} */
ViewModel.Initialize(
ContentManager,
@ -753,7 +758,7 @@ namespace Ryujinx.Ava.UI.Windows
string.Empty,
string.Empty,
LocaleManager.Instance[LocaleKeys.InputDialogOk],
(int)Symbol.Checkmark);
(int)FASymbol.Checkmark);
});
}
@ -771,7 +776,7 @@ namespace Ryujinx.Ava.UI.Windows
_intelMacWarningShown = true;
}
private void AppWindow_OnGotFocus(object sender, GotFocusEventArgs e)
private void AppWindow_OnGotFocus(object sender, FocusChangedEventArgs e)
{
if (ViewModel.AppHost is null)
return;

View file

@ -49,7 +49,7 @@
<settings:SettingsDebugView Name="DebugPage" />
<settings:SettingsHacksView Name="HacksPage" />
</Grid>
<ui:NavigationView
<ui:FANavigationView
Grid.Row="2"
IsSettingsVisible="False"
Name="NavPanel"
@ -58,78 +58,78 @@
VerticalAlignment="Stretch"
HorizontalAlignment="Stretch"
OpenPaneLength="200">
<ui:NavigationView.MenuItems>
<ui:NavigationViewItem
<ui:FANavigationView.MenuItems>
<ui:FANavigationViewItem
IsSelected="True"
Content="{ext:Locale SettingsTabGeneral}"
Tag="UiPage">
<ui:NavigationViewItem.IconSource>
<ui:FontIconSource
<ui:FANavigationViewItem.IconSource>
<ui:FAFontIconSource
FontFamily="avares://Ryujinx/Assets/Fonts#Segoe Fluent Icons"
Glyph="{helpers:GlyphValueConverter Device}" />
</ui:NavigationViewItem.IconSource>
</ui:NavigationViewItem>
<ui:NavigationViewItem
</ui:FANavigationViewItem.IconSource>
</ui:FANavigationViewItem>
<ui:FANavigationViewItem
Content="{ext:Locale SettingsTabInput}"
Tag="InputPage"
IconSource="Games" />
<ui:NavigationViewItem
<ui:FANavigationViewItem
Content="{ext:Locale SettingsTabSystem}"
Tag="SystemPage"
IconSource="Settings" />
<ui:NavigationViewItem
<ui:FANavigationViewItem
Content="{ext:Locale SettingsTabCpu}"
Tag="CpuPage">
<ui:NavigationViewItem.IconSource>
<ui:FontIconSource
<ui:FANavigationViewItem.IconSource>
<ui:FAFontIconSource
FontFamily="avares://Ryujinx/Assets/Fonts#Segoe Fluent Icons"
Glyph="{helpers:GlyphValueConverter Chip}" />
</ui:NavigationViewItem.IconSource>
</ui:NavigationViewItem>
<ui:NavigationViewItem
</ui:FANavigationViewItem.IconSource>
</ui:FANavigationViewItem>
<ui:FANavigationViewItem
Content="{ext:Locale SettingsTabGraphics}"
Tag="GraphicsPage"
IconSource="Image" />
<ui:NavigationViewItem
<ui:FANavigationViewItem
Content="{ext:Locale SettingsTabAudio}"
IconSource="Audio"
Tag="AudioPage" />
<ui:NavigationViewItem
<ui:FANavigationViewItem
Content="{ext:Locale SettingsTabHotkeys}"
Tag="HotkeysPage"
IconSource="Keyboard" />
<ui:NavigationViewItem
<ui:FANavigationViewItem
Content="{ext:Locale SettingsTabNetwork}"
Tag="NetworkPage"
IconSource="Globe" />
<ui:NavigationViewItem
<ui:FANavigationViewItem
Content="{ext:Locale SettingsTabLogging}"
Tag="LoggingPage"
IconSource="Document" />
<ui:NavigationViewItem
<ui:FANavigationViewItem
Content="{ext:Locale SettingsTabDebug}"
Tag="DebugPage">
<ui:NavigationViewItem.IconSource>
<ui:FontIconSource
<ui:FANavigationViewItem.IconSource>
<ui:FAFontIconSource
FontFamily="avares://Ryujinx/Assets/Fonts#Segoe Fluent Icons"
Glyph="{helpers:GlyphValueConverter Bug}" />
</ui:NavigationViewItem.IconSource>
</ui:NavigationViewItem>
<ui:NavigationViewItem
</ui:FANavigationViewItem.IconSource>
</ui:FANavigationViewItem>
<ui:FANavigationViewItem
IsVisible="{Binding ShowDirtyHacks}"
Content="Dirty Hacks"
Tag="HacksPage"
IconSource="Code" />
</ui:NavigationView.MenuItems>
<ui:NavigationView.Styles>
</ui:FANavigationView.MenuItems>
<ui:FANavigationView.Styles>
<Style Selector="Grid#PlaceholderGrid">
<Setter Property="Height" Value="40" />
</Style>
<Style Selector="ui|NavigationViewItem ui|SymbolIcon">
<Style Selector="ui|FANavigationViewItem ui|FASymbolIcon">
<Setter Property="FlowDirection" Value="LeftToRight" />
</Style>
</ui:NavigationView.Styles>
</ui:NavigationView>
</ui:FANavigationView.Styles>
</ui:FANavigationView>
<Grid Grid.Row="3"
ColumnDefinitions="Auto,*,Auto">
<StackPanel Grid.Column="0" Orientation="Horizontal">

View file

@ -27,8 +27,8 @@ namespace Ryujinx.Ava.UI.Windows
NavPanel.PaneDisplayMode =
ConfigurationState.Instance.ShowOldUI
? NavigationViewPaneDisplayMode.Left
: NavigationViewPaneDisplayMode.Top;
? FANavigationViewPaneDisplayMode.Left
: FANavigationViewPaneDisplayMode.Top;
Height = ConfigurationState.Instance.ShowOldUI
? 906
@ -62,9 +62,9 @@ namespace Ryujinx.Ava.UI.Windows
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())
{

View file

@ -12,15 +12,17 @@ using System.Threading.Tasks;
namespace Ryujinx.Ava.UI.Windows
{
public abstract class StyleableAppWindow : AppWindow
public abstract class StyleableAppWindow : FAAppWindow
{
public static async Task ShowAsync(StyleableAppWindow appWindow, Window owner = null)
{
/*
#if DEBUG
appWindow.AttachDevTools(new KeyGesture(Key.F12, KeyModifiers.Control));
appWindow.AttachDevTools(new KeyGesture(Key.F12, KeyModifiers.Control));
#endif
await appWindow.ShowDialog(owner ?? RyujinxApp.MainWindow);
}
*/
await appWindow.ShowDialog(owner ?? RyujinxApp.MainWindow);
}
protected StyleableAppWindow(bool useCustomTitleBar = false, double? titleBarHeight = null)
{
@ -33,7 +35,7 @@ namespace Ryujinx.Ava.UI.Windows
if (useCustomTitleBar)
{
TitleBar.ExtendsContentIntoTitleBar = !ConfigurationState.Instance.ShowOldUI;
TitleBar.TitleBarHitTestType = ConfigurationState.Instance.ShowOldUI ? TitleBarHitTestType.Simple : TitleBarHitTestType.Complex;
TitleBar.TitleBarHitTestType = ConfigurationState.Instance.ShowOldUI ? FATitleBarHitTestType.Simple : FATitleBarHitTestType.Complex;
if (TitleBar.ExtendsContentIntoTitleBar && titleBarHeight != null)
TitleBar.Height = titleBarHeight.Value;
@ -47,21 +49,23 @@ namespace Ryujinx.Ava.UI.Windows
FlowDirection = LocaleManager.Instance.IsRTL() ? FlowDirection.RightToLeft : FlowDirection.LeftToRight;
}
protected override void OnApplyTemplate(TemplateAppliedEventArgs e)
/* protected override void OnApplyTemplate(TemplateAppliedEventArgs e)
{
base.OnApplyTemplate(e);
ExtendClientAreaChromeHints = ExtendClientAreaChromeHints.SystemChrome | ExtendClientAreaChromeHints.OSXThickTitleBar;
}
} */
}
public abstract class StyleableWindow : Window
{
public static async Task ShowAsync(StyleableWindow window, Window owner = null)
{
/*
#if DEBUG
window.AttachDevTools(new KeyGesture(Key.F12, KeyModifiers.Control));
#endif
*/
await window.ShowDialog(owner ?? RyujinxApp.MainWindow);
}
@ -81,11 +85,11 @@ namespace Ryujinx.Ava.UI.Windows
FlowDirection = LocaleManager.Instance.IsRTL() ? FlowDirection.RightToLeft : FlowDirection.LeftToRight;
}
protected override void OnApplyTemplate(TemplateAppliedEventArgs e)
/* protected override void OnApplyTemplate(TemplateAppliedEventArgs e)
{
base.OnApplyTemplate(e);
ExtendClientAreaChromeHints = ExtendClientAreaChromeHints.SystemChrome | ExtendClientAreaChromeHints.OSXThickTitleBar;
}
} */
}
}

View file

@ -7,7 +7,7 @@ namespace Ryujinx.Ava.UI.Windows
{
public UpdateWaitWindow(string primaryText, string secondaryText, CancellationTokenSource cancellationToken) : this(primaryText, secondaryText)
{
SystemDecorations = SystemDecorations.Full;
WindowDecorations = WindowDecorations.Full;
ShowInTaskbar = true;
Closing += (_, _) => cancellationToken.Cancel();
@ -18,7 +18,7 @@ namespace Ryujinx.Ava.UI.Windows
PrimaryText.Text = primaryText;
SecondaryText.Text = secondaryText;
WindowStartupLocation = WindowStartupLocation.CenterOwner;
SystemDecorations = SystemDecorations.BorderOnly;
WindowDecorations = WindowDecorations.BorderOnly;
ShowInTaskbar = false;
}

View file

@ -19,7 +19,7 @@ namespace Ryujinx.Ava.Utilities
MemoryStream iconDataStream = new(iconData);
using SKBitmap image = SKBitmap.Decode(iconDataStream);
image.Resize(new SKImageInfo(128, 128), SKFilterQuality.High);
image.Resize(new SKImageInfo(128, 128), new SKSamplingOptions(SKFilterMode.Linear));
SaveBitmapAsIcon(image, iconPath);
Shortcut shortcut = Shortcut.CreateShortcut(basePath, GetArgsString(applicationFilePath, applicationId, args), iconPath, 0);