aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.Ava/UI/Windows
diff options
context:
space:
mode:
authorIsaac Marovitz <42140194+IsaacMarovitz@users.noreply.github.com>2023-08-12 01:47:22 +0100
committerGitHub <noreply@github.com>2023-08-12 02:47:22 +0200
commit7b2225c6b0939b9720c56a89cb0c91311b2e19e5 (patch)
treeb4f44692dc843b720ae73c94688d51f7dc9a0ae4 /src/Ryujinx.Ava/UI/Windows
parentfe15c77d30b94a8b720b520dcacf39a0c832d58f (diff)
Ava UI: Avalonia 11 & FluentAvalonia 2 Support (#4362)
* It builds (Doesn’t run waiting on FluentAvalonia Preview 5 Release) * Enable CompiledBindings by default * Ignore `PointerPressedEventArgs` Init warning * Define MIME and UTI Types * Update `UserProfileImageSelectorView` to StorageProvider API * PFS0 Magic * Update `MainWindowViewModel` to StorageProvider API * Update `SettingsUIView` to StorageProvider API * Update `ApplicationHelper` to StorageProvider API * Use `IsCheckChanged` * Rename events * Update Fluent Avalonia to Preivew 5 * More package updates * Fix long selection bar * return glyph value directly, instead of using a binding * fix menu item checkboxes * Fix build * Update to Preview 6 Unicorn conflict Fix remaining package oopsie * Fix issues from merge * Fix some warnings * Warnings * Squashed commit of the following: commit 79d1c190dba48e405a833f654691e47509a29792 Author: Mary <mary@mary.zone> Date: Sun Apr 16 11:38:07 2023 +0200 chore: Update Silk.NET to 2.17.1 (#4686) commit 2bc88467eb377a0ca1a8b51700300422422c8c37 Author: Ac_K <Acoustik666@gmail.com> Date: Sun Apr 16 09:37:31 2023 +0000 Update README.md commit baf8752e74488a419074ae1d484e54a00bc01973 Author: Vincenzo Nizza <vincenzonizzaufficio@gmail.com> Date: Sun Apr 16 11:19:33 2023 +0200 Ensure the updater doesn't delete hidden or system files (#4626) * Copy desktop.ini to update directory if it exists in HomeDir * EnumerateFilesToDelete() exclude files with "Hidden" and "System" attributes commit d5e4378aea086d9219f890e33cf81d566d96b9ae Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun Apr 16 09:02:06 2023 +0000 nuget: bump DynamicData from 7.13.1 to 7.13.5 (#4654) Bumps [DynamicData](https://github.com/reactiveui/DynamicData) from 7.13.1 to 7.13.5. - [Release notes](https://github.com/reactiveui/DynamicData/releases) - [Changelog](https://github.com/reactivemarbles/DynamicData/blob/main/ReleaseNotes.md) - [Commits](https://github.com/reactiveui/DynamicData/compare/7.13.1...7.13.5) --- updated-dependencies: - dependency-name: DynamicData dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> commit 6dbcdfea47e60aadefd59a75e43549793481f853 Author: TSRBerry <20988865+TSRBerry@users.noreply.github.com> Date: Sun Apr 16 09:09:02 2023 +0200 Ava: Fix nca extraction window never closing & minor cleanup (#4569) * ava: Remove unused doWhileDeferred parameters * ava: Minimally improve swkbd dialog It's currently impossible to get the dialog to redirect focus to the InputBox. * ava: Fix nca extraction dialog never closing Also contains some minor cleanup commit c5258cf082b10f335f81487f22b7eeb86075e09e Author: NitroTears <73270647+NitroTears@users.noreply.github.com> Date: Sun Apr 16 11:03:35 2023 +1000 Ability to hide file types in Game List (#4555) * Added HiddenFileTypes to config state, and check to file enumeration * Added hiddenfiletypes checkboxes to the UI * Added Ava version of HiddenFileTypes * Inverted Hide to Show with file types, minor formatting * all variables with a reference to 'hidden' is now 'shown' * one more variable name changed * review feedback * added FileTypes extension methof to get the correlating config value * moved extension method to new folder and file in Ryujinx.Ui.Common * added default case for ToggleFileType * changed exception type to OutOfRangeException commit 5c89e22bb98072adc240c2eb2d26d25fa119fe7d Author: Daniel Shala <daniel.shala08@gmail.com> Date: Sat Apr 15 18:11:24 2023 +0200 Added check for eventual symlink when displaying game files. (#4526) * Added check for eventual symlink when displaying game files. * Moved symlink check logic * Moved symlink check logic * Fixed prev commit --------- Co-authored-by: Daniel Shala <danielshala00@gmail.com> commit 11ecff2ff04633d261b9a43db792f6438df63f40 Author: Alex Barney <thealexbarney@gmail.com> Date: Fri Apr 14 16:00:34 2023 -0700 Rename Hipc to Cmif where appropriate (#3880) commit 4c3f09644a033dbf70258c4c0e5a848263b16bbd Author: MutantAura <44103205+MutantAura@users.noreply.github.com> Date: Wed Apr 12 20:18:40 2023 +0100 Move swkbd message null check into constructor (#4671) commit e187a8870a6f19ac0a85b08aece3c1a1e196e379 Author: TSRBerry <20988865+TSRBerry@users.noreply.github.com> Date: Wed Apr 12 03:09:47 2023 +0200 HLE: Deal with empty title names properly (#4643) * hle: Deal with empty titleNames in some languages * gui: Fix displaying the wrong title name * Remove unnecessary bounds check * Fix a NRE when getting the version string * Restore empty string logic commit a64fee29dc6b8e523d61abb7e79ceaa95a558c6c Author: riperiperi <rhy3756547@hotmail.com> Date: Tue Apr 11 08:23:41 2023 +0100 Vulkan: add situational "Fast Flush" mode (#4667) * Flush in the middle of long command buffers. * Vulkan: add situational "Fast Flush" mode The AutoFlushCounter class was added to periodically flush Vulkan command buffers throughout a frame, which reduces latency to the GPU as commands are submitted and processed much sooner. This was done by allowing command buffers to flush when framebuffer attachments changed. However, some games have incredibly long render passes with a large number of draws, and really aggressive data access that forces GPU sync. The Vulkan backend could potentially end up building a single command buffer for 4-5ms if a pass has enough draws, such as in BOTW. In the scenario where sync is waited on immediately after submission, this would have to wait for the completion of a much longer command buffer than usual. The solution is to force command buffer submission periodically in a "fast flush" mode. This will end up splitting render passes, but it will only enable if sync is aggressive enough. This should improve performance in GPU limited scenarios, or in games that aggressively wait on synchronization. In some games, it may only kick in when res scaling. It won't trigger in games like SMO where sync is not an issue. Improves performance in Pokemon Scarlet/Violet (res scaled) and BOTW (in general). * Add conversions in milliseconds next to flush timers. commit 9ef94c8292beda825fa76e05ad2e561c6d571c95 Author: riperiperi <rhy3756547@hotmail.com> Date: Tue Apr 11 07:55:04 2023 +0100 ARMeilleure: Move TPIDR_EL0 and TPIDRRO_EL0 to NativeContext (#4661) * ARMeilleure: Move TPIDR_EL0 and TPIDRRO_EL0 to NativeContext Some games access these system registers several tens of thousands of times in a second from many different threads. While this isn't really crippling, it is a lot of wasted time spent in a reverse pinvoke transition. Example games are Pokemon Scarlet/Violet and BOTW. These games have a lot of different potential bottlenecks so it's unlikely you will see a consistent improvement, but it definitely disappears from the cpu profile. * Remove unreachable code. * Add ulong conversion for offsets * Nit commit 915d6d044cbf8c89935f14b8c7e085ad729f0e28 Author: riperiperi <rhy3756547@hotmail.com> Date: Tue Apr 11 07:32:31 2023 +0100 OpenGL: Fix OBS/Overlays again by binding FB before present (#4668) This seems to have been removed by the Post-Processing PR, but it is required for the display in OBS to be the right way up and properly scaled. I've tested this with AA and FSR on MK8D and it seems to behave properly. Testing is welcome. commit a4780ab33b9ca6b698917ded3ef6db6e6716cad1 Author: MutantAura <44103205+MutantAura@users.noreply.github.com> Date: Mon Apr 10 23:04:31 2023 +0100 Force activate parent window before dialog is shown (#4663) * Fix build Extraction dialogue not working * Avalonia Preview 7 Needs Fluent Avalonia update still… * Fix Render Scaling * Update Fluent Avalonia * Remove `pfs0` as runnable file type * Restore Info.plist formatting * Plist Format * Update Avalonia.Svg.Skia * Update theme code (TODO) * swtich to using theme variants for light dark * Fix crashes * Text centering issues * Update `TitleUpdateViewModel` to StorageProvider API * Fixed for new PR (Will crash on launch) * Fixes… * UI: Fix sections extraction (#4820) * UI: Fix sections extraction There is currently an issue when the update NCA doesn't contains the section we want to extract, this is fixed by adding a check. I have fixed the inverted handler of ExeFs/Logo introduced in #4755. Fixes #4521 * Addresses feedback * Fix issues… * Preview 8 * Fix fuck ups * Fixes * More cleanup * Ava 11 RC Maybe there is a god * Update FluentAvalonia * update svg * Second RC (kill me) * It builds * Ava 11 * Remove unnecessary usings * Fix build * Formatting * GAS GAS GAS!!!! * Fix DLC Window Crash * Linux runner try not to crash challenge (impossible) * Add app.manifest * Fix accidental Silk.NET.Vulkan bump * Try fix truncation * Linux fix popup Windows * Fix cutoff text on windows * Status bar styling fixes * Volume Toggle Split Button Fixes * Fix load bar color * Fix shortcuts * Best we're gonna get * Fix spacing Co-authored-by: Exhigh <exhigh01@gmail.com> * Formatting * Fix Profile Dropdown * Fix Window Startup Position * Format Fixes * Fix stupid mistake * Fix accidental change * Scaling Handler (peri pls make sure is working) * Remove Locale Reflection Binding Use + Unsued Usings * Fix formatting Code styling Ughhhh Fix interface Make TimeZoneConverter internal * Remove bell workaround (no longer needed) * Disable accent menu * Update to Ava 11.0.2 * Peri suggestions * Formatting * Cleanup a bunch of jank * Dependency update * Berry fixes and suggestions * Final suggestions * Rename assemblyIdentity to Ryujinx.Emulator.Avalonia --------- Co-authored-by: Emmanuel Hansen <emmausssss@gmail.com> Co-authored-by: Ac_K <Acoustik666@gmail.com> Co-authored-by: Exhigh <exhigh01@gmail.com> Co-authored-by: TSR Berry <20988865+TSRBerry@users.noreply.github.com>
Diffstat (limited to 'src/Ryujinx.Ava/UI/Windows')
-rw-r--r--src/Ryujinx.Ava/UI/Windows/AboutWindow.axaml7
-rw-r--r--src/Ryujinx.Ava/UI/Windows/AmiiboWindow.axaml15
-rw-r--r--src/Ryujinx.Ava/UI/Windows/CheatWindow.axaml12
-rw-r--r--src/Ryujinx.Ava/UI/Windows/ContentDialogOverlayWindow.axaml.cs9
-rw-r--r--src/Ryujinx.Ava/UI/Windows/DownloadableContentManagerWindow.axaml8
-rw-r--r--src/Ryujinx.Ava/UI/Windows/MainWindow.axaml20
-rw-r--r--src/Ryujinx.Ava/UI/Windows/MainWindow.axaml.cs65
-rw-r--r--src/Ryujinx.Ava/UI/Windows/SettingsWindow.axaml29
-rw-r--r--src/Ryujinx.Ava/UI/Windows/SettingsWindow.axaml.cs6
-rw-r--r--src/Ryujinx.Ava/UI/Windows/StyleableWindow.cs4
-rw-r--r--src/Ryujinx.Ava/UI/Windows/TitleUpdateWindow.axaml6
-rw-r--r--src/Ryujinx.Ava/UI/Windows/TitleUpdateWindow.axaml.cs2
12 files changed, 87 insertions, 96 deletions
diff --git a/src/Ryujinx.Ava/UI/Windows/AboutWindow.axaml b/src/Ryujinx.Ava/UI/Windows/AboutWindow.axaml
index cc7556a6..a8fd11b2 100644
--- a/src/Ryujinx.Ava/UI/Windows/AboutWindow.axaml
+++ b/src/Ryujinx.Ava/UI/Windows/AboutWindow.axaml
@@ -13,7 +13,6 @@
Margin="0,-12,0,0"
d:DesignHeight="260"
d:DesignWidth="550"
- x:CompileBindings="True"
x:DataType="viewModel:AboutWindowViewModel"
Focusable="True"
mc:Ignorable="d">
@@ -64,14 +63,14 @@
FontWeight="Bold"
Text="Ryujinx"
TextAlignment="Center"
- Width="100" />
+ Width="110" />
<TextBlock
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontSize="11"
Text="(REE-YOU-JINX)"
TextAlignment="Center"
- Width="100" />
+ Width="110" />
</flex:FlexPanel>
</Grid>
<TextBlock
@@ -265,4 +264,4 @@
</StackPanel>
</Grid>
</Grid>
-</UserControl> \ No newline at end of file
+</UserControl>
diff --git a/src/Ryujinx.Ava/UI/Windows/AmiiboWindow.axaml b/src/Ryujinx.Ava/UI/Windows/AmiiboWindow.axaml
index 90d47b8e..caf7c1f3 100644
--- a/src/Ryujinx.Ava/UI/Windows/AmiiboWindow.axaml
+++ b/src/Ryujinx.Ava/UI/Windows/AmiiboWindow.axaml
@@ -1,4 +1,4 @@
-<window:StyleableWindow
+<window:StyleableWindow
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
@@ -6,14 +6,15 @@
xmlns:window="clr-namespace:Ryujinx.Ava.UI.Windows"
xmlns:viewModels="clr-namespace:Ryujinx.Ava.UI.ViewModels"
xmlns:locale="clr-namespace:Ryujinx.Ava.Common.Locale"
- mc:Ignorable="d"
- d:DesignWidth="400"
+ mc:Ignorable="d"
+ d:DesignWidth="400"
d:DesignHeight="350"
x:Class="Ryujinx.Ava.UI.Windows.AmiiboWindow"
+ x:DataType="viewModels:AmiiboWindowViewModel"
CanResize="False"
WindowStartupLocation="CenterOwner"
- Width="800"
- MinHeight="650"
+ Width="800"
+ MinHeight="650"
Height="650"
SizeToContent="Manual"
MinWidth="600"
@@ -35,11 +36,11 @@
</Grid.ColumnDefinitions>
<StackPanel Spacing="10" Orientation="Horizontal" HorizontalAlignment="Left">
<TextBlock VerticalAlignment="Center" Text="{locale:Locale AmiiboSeriesLabel}" />
- <ComboBox SelectedIndex="{Binding SeriesSelectedIndex}" Items="{Binding AmiiboSeries}" MinWidth="100" />
+ <ComboBox SelectedIndex="{Binding SeriesSelectedIndex}" ItemsSource="{Binding AmiiboSeries}" MinWidth="100" />
</StackPanel>
<StackPanel Spacing="10" Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Right">
<TextBlock VerticalAlignment="Center" Text="{locale:Locale AmiiboCharacterLabel}" />
- <ComboBox SelectedIndex="{Binding AmiiboSelectedIndex}" MinWidth="100" Items="{Binding AmiiboList}" />
+ <ComboBox SelectedIndex="{Binding AmiiboSelectedIndex}" MinWidth="100" ItemsSource="{Binding AmiiboList}" />
</StackPanel>
</Grid>
<StackPanel Margin="20" Grid.Row="2">
diff --git a/src/Ryujinx.Ava/UI/Windows/CheatWindow.axaml b/src/Ryujinx.Ava/UI/Windows/CheatWindow.axaml
index 11e86211..b9cbcb9c 100644
--- a/src/Ryujinx.Ava/UI/Windows/CheatWindow.axaml
+++ b/src/Ryujinx.Ava/UI/Windows/CheatWindow.axaml
@@ -40,7 +40,7 @@
HorizontalAlignment="Center"
VerticalAlignment="Center"
LineHeight="18"
- Text="{Binding Heading}"
+ Text="{ReflectionBinding Heading}"
TextAlignment="Center"
TextWrapping="Wrap" />
<TextBlock
@@ -61,7 +61,7 @@
MinWidth="160"
HorizontalAlignment="Center"
VerticalAlignment="Center"
- Text="{Binding BuildId}"
+ Text="{ReflectionBinding BuildId}"
IsReadOnly="True" />
<Border
Grid.Row="3"
@@ -77,7 +77,7 @@
MinHeight="300"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
- Items="{Binding LoadedCheats}">
+ ItemsSource="{ReflectionBinding LoadedCheats}">
<TreeView.Styles>
<Styles>
<Style Selector="TreeViewItem:empty /template/ ItemsPresenter">
@@ -120,15 +120,15 @@
Name="SaveButton"
MinWidth="90"
Margin="5"
- Command="{Binding Save}"
- IsVisible="{Binding !NoCheatsFound}">
+ Command="{ReflectionBinding Save}"
+ IsVisible="{ReflectionBinding !NoCheatsFound}">
<TextBlock Text="{locale:Locale SettingsButtonSave}" />
</Button>
<Button
Name="CancelButton"
MinWidth="90"
Margin="5"
- Command="{Binding Close}">
+ Command="{ReflectionBinding Close}">
<TextBlock Text="{locale:Locale InputDialogCancel}" />
</Button>
</DockPanel>
diff --git a/src/Ryujinx.Ava/UI/Windows/ContentDialogOverlayWindow.axaml.cs b/src/Ryujinx.Ava/UI/Windows/ContentDialogOverlayWindow.axaml.cs
index a33ee518..2b12d72f 100644
--- a/src/Ryujinx.Ava/UI/Windows/ContentDialogOverlayWindow.axaml.cs
+++ b/src/Ryujinx.Ava/UI/Windows/ContentDialogOverlayWindow.axaml.cs
@@ -1,8 +1,5 @@
using Avalonia.Controls;
using Avalonia.Media;
-#if DEBUG
-using Avalonia;
-#endif
namespace Ryujinx.Ava.UI.Windows
{
@@ -11,11 +8,9 @@ namespace Ryujinx.Ava.UI.Windows
public ContentDialogOverlayWindow()
{
InitializeComponent();
-#if DEBUG
- this.AttachDevTools();
-#endif
+
ExtendClientAreaToDecorationsHint = true;
- TransparencyLevelHint = WindowTransparencyLevel.Transparent;
+ TransparencyLevelHint = new[] { WindowTransparencyLevel.Transparent };
WindowStartupLocation = WindowStartupLocation.Manual;
SystemDecorations = SystemDecorations.None;
ExtendClientAreaTitleBarHeightHint = 0;
diff --git a/src/Ryujinx.Ava/UI/Windows/DownloadableContentManagerWindow.axaml b/src/Ryujinx.Ava/UI/Windows/DownloadableContentManagerWindow.axaml
index f4ba4f9c..1f57f34c 100644
--- a/src/Ryujinx.Ava/UI/Windows/DownloadableContentManagerWindow.axaml
+++ b/src/Ryujinx.Ava/UI/Windows/DownloadableContentManagerWindow.axaml
@@ -11,7 +11,6 @@
Width="500"
Height="380"
mc:Ignorable="d"
- x:CompileBindings="True"
x:DataType="viewModels:DownloadableContentManagerViewModel"
Focusable="True">
<Grid>
@@ -53,8 +52,8 @@
</StackPanel>
<TextBox
Grid.Column="2"
- MinHeight="27"
- MaxHeight="27"
+ MinHeight="29"
+ MaxHeight="29"
HorizontalAlignment="Stretch"
Watermark="{locale:Locale Search}"
Text="{Binding Search}" />
@@ -71,12 +70,11 @@
Padding="2.5">
<ListBox
AutoScrollToSelectedItem="False"
- VirtualizationMode="None"
SelectionMode="Multiple, Toggle"
Background="Transparent"
SelectionChanged="OnSelectionChanged"
SelectedItems="{Binding SelectedDownloadableContents, Mode=TwoWay}"
- Items="{Binding Views}">
+ ItemsSource="{Binding Views}">
<ListBox.DataTemplates>
<DataTemplate
DataType="models:DownloadableContentModel">
diff --git a/src/Ryujinx.Ava/UI/Windows/MainWindow.axaml b/src/Ryujinx.Ava/UI/Windows/MainWindow.axaml
index fa07d977..0d9a5949 100644
--- a/src/Ryujinx.Ava/UI/Windows/MainWindow.axaml
+++ b/src/Ryujinx.Ava/UI/Windows/MainWindow.axaml
@@ -18,9 +18,9 @@
MinHeight="672"
d:DesignHeight="720"
d:DesignWidth="1280"
- x:CompileBindings="True"
x:DataType="viewModels:MainWindowViewModel"
mc:Ignorable="d"
+ WindowStartupLocation="Manual"
Focusable="True">
<Window.Styles>
<Style Selector="TitleBar:fullscreen">
@@ -33,19 +33,19 @@
<Window.Resources>
<helpers:BitmapArrayValueConverter x:Key="ByteImage" />
</Window.Resources>
+ <Window.KeyBindings>
+ <KeyBinding Gesture="Alt+Return" Command="{Binding ToggleFullscreen}" />
+ <KeyBinding Gesture="F11" Command="{Binding ToggleFullscreen}" />
+ <KeyBinding Gesture="Ctrl+Cmd+F" Command="{Binding ToggleFullscreen}" />
+ <KeyBinding Gesture="F9" Command="{Binding ToggleDockMode}" />
+ <KeyBinding Gesture="Escape" Command="{Binding ExitCurrentState}" />
+ </Window.KeyBindings>
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<helpers:OffscreenTextBox Name="HiddenTextBox" Grid.Row="0" />
- <StackPanel Grid.Row="0" IsVisible="False">
- <helpers:HotKeyControl Name="FullscreenHotKey" Command="{ReflectionBinding ToggleFullscreen}" />
- <helpers:HotKeyControl Name="FullscreenHotKey2" Command="{ReflectionBinding ToggleFullscreen}" />
- <helpers:HotKeyControl Name="FullscreenHotKeyMacOS" Command="{ReflectionBinding ToggleFullscreen}" />
- <helpers:HotKeyControl Name="DockToggleHotKey" Command="{ReflectionBinding ToggleDockMode}" />
- <helpers:HotKeyControl Name="ExitHotKey" Command="{ReflectionBinding ExitCurrentState}" />
- </StackPanel>
<Grid
Grid.Row="1"
HorizontalAlignment="Stretch"
@@ -67,7 +67,7 @@
VerticalAlignment="Stretch"
IsVisible="{Binding ShowMenuAndStatusBar}"
Orientation="Vertical">
- <main:MainMenuBarView
+ <main:MainMenuBarView
Name="MenuBarView" />
</StackPanel>
<ContentControl
@@ -197,7 +197,7 @@
</Grid>
</Grid>
</Grid>
- <main:MainStatusBarView
+ <main:MainStatusBarView
Name="StatusBarView"
Grid.Row="2" />
</Grid>
diff --git a/src/Ryujinx.Ava/UI/Windows/MainWindow.axaml.cs b/src/Ryujinx.Ava/UI/Windows/MainWindow.axaml.cs
index d79bdc56..d32360e0 100644
--- a/src/Ryujinx.Ava/UI/Windows/MainWindow.axaml.cs
+++ b/src/Ryujinx.Ava/UI/Windows/MainWindow.axaml.cs
@@ -1,6 +1,7 @@
using Avalonia;
using Avalonia.Controls;
-using Avalonia.Input;
+using Avalonia.Controls.Primitives;
+using Avalonia.Interactivity;
using Avalonia.Threading;
using FluentAvalonia.UI.Controls;
using Ryujinx.Ava.Common;
@@ -21,7 +22,6 @@ using Ryujinx.Ui.Common;
using Ryujinx.Ui.Common.Configuration;
using Ryujinx.Ui.Common.Helper;
using System;
-using System.ComponentModel;
using System.IO;
using System.Runtime.Versioning;
using System.Threading.Tasks;
@@ -85,6 +85,7 @@ namespace Ryujinx.Ava.UI.Windows
ViewModel.Initialize(
ContentManager,
+ StorageProvider,
ApplicationLibrary,
VirtualFileSystem,
AccountManager,
@@ -102,11 +103,16 @@ namespace Ryujinx.Ava.UI.Windows
LoadGameList();
this.GetObservable(IsActiveProperty).Subscribe(IsActiveChanged);
+ this.ScalingChanged += OnScalingChanged;
}
ApplicationLibrary.ApplicationCountUpdated += ApplicationLibrary_ApplicationCountUpdated;
ApplicationLibrary.ApplicationAdded += ApplicationLibrary_ApplicationAdded;
- ViewModel.ReloadGameList += ReloadGameList;
+ }
+
+ protected override void OnApplyTemplate(TemplateAppliedEventArgs e)
+ {
+ base.OnApplyTemplate(e);
NotificationHelper.SetNotificationManager(this);
}
@@ -130,10 +136,9 @@ namespace Ryujinx.Ava.UI.Windows
_isLoading = false;
}
- protected override void HandleScalingChanged(double scale)
+ private void OnScalingChanged(object sender, EventArgs e)
{
- Program.DesktopScaleFactor = scale;
- base.HandleScalingChanged(scale);
+ Program.DesktopScaleFactor = this.RenderScaling;
}
public void AddApplication(ApplicationData applicationData)
@@ -221,16 +226,6 @@ namespace Ryujinx.Ava.UI.Windows
});
}
- protected override void HandleWindowStateChanged(WindowState state)
- {
- ViewModel.WindowState = state;
-
- if (state != WindowState.Minimized)
- {
- Renderer.Start();
- }
- }
-
private void Initialize()
{
_userChannelPersistence = new UserChannelPersistence();
@@ -367,14 +362,12 @@ namespace Ryujinx.Ava.UI.Windows
ApplicationList.ApplicationOpened += Application_Opened;
ApplicationList.DataContext = ViewModel;
-
- LoadHotKeys();
}
private void SetWindowSizePosition()
{
PixelPoint savedPoint = new(ConfigurationState.Instance.Ui.WindowStartup.WindowPositionX,
- ConfigurationState.Instance.Ui.WindowStartup.WindowPositionY);
+ ConfigurationState.Instance.Ui.WindowStartup.WindowPositionY);
ViewModel.WindowHeight = ConfigurationState.Instance.Ui.WindowStartup.WindowSizeHeight * Program.WindowScaleFactor;
ViewModel.WindowWidth = ConfigurationState.Instance.Ui.WindowStartup.WindowSizeWidth * Program.WindowScaleFactor;
@@ -447,18 +440,7 @@ namespace Ryujinx.Ava.UI.Windows
#pragma warning restore IDE0055
}
- public void LoadHotKeys()
- {
-#pragma warning disable IDE0055 // Disable formatting
- HotKeyManager.SetHotKey(FullscreenHotKey, new KeyGesture(Key.Enter, KeyModifiers.Alt));
- HotKeyManager.SetHotKey(FullscreenHotKey2, new KeyGesture(Key.F11));
- HotKeyManager.SetHotKey(FullscreenHotKeyMacOS, new KeyGesture(Key.F, KeyModifiers.Control | KeyModifiers.Meta));
- HotKeyManager.SetHotKey(DockToggleHotKey, new KeyGesture(Key.F9));
- HotKeyManager.SetHotKey(ExitHotKey, new KeyGesture(Key.Escape));
-#pragma warning restore IDE0055
- }
-
- private void VolumeStatus_CheckedChanged(object sender, SplitButtonClickEventArgs e)
+ private void VolumeStatus_CheckedChanged(object sender, RoutedEventArgs e)
{
var volumeSplitButton = sender as ToggleSplitButton;
if (ViewModel.IsGameRunning)
@@ -476,7 +458,7 @@ namespace Ryujinx.Ava.UI.Windows
}
}
- protected override void OnClosing(CancelEventArgs e)
+ protected override void OnClosing(WindowClosingEventArgs e)
{
if (!ViewModel.IsClosing && ViewModel.AppHost != null && ConfigurationState.Instance.ShowConfirmExit)
{
@@ -548,6 +530,25 @@ namespace Ryujinx.Ava.UI.Windows
ReloadGameList();
}
+ public void ToggleFileType(string fileType)
+ {
+ _ = fileType switch
+ {
+#pragma warning disable IDE0055 // Disable formatting
+ "NSP" => ConfigurationState.Instance.Ui.ShownFileTypes.NSP.Value = !ConfigurationState.Instance.Ui.ShownFileTypes.NSP,
+ "PFS0" => ConfigurationState.Instance.Ui.ShownFileTypes.PFS0.Value = !ConfigurationState.Instance.Ui.ShownFileTypes.PFS0,
+ "XCI" => ConfigurationState.Instance.Ui.ShownFileTypes.XCI.Value = !ConfigurationState.Instance.Ui.ShownFileTypes.XCI,
+ "NCA" => ConfigurationState.Instance.Ui.ShownFileTypes.NCA.Value = !ConfigurationState.Instance.Ui.ShownFileTypes.NCA,
+ "NRO" => ConfigurationState.Instance.Ui.ShownFileTypes.NRO.Value = !ConfigurationState.Instance.Ui.ShownFileTypes.NRO,
+ "NSO" => ConfigurationState.Instance.Ui.ShownFileTypes.NSO.Value = !ConfigurationState.Instance.Ui.ShownFileTypes.NSO,
+ _ => throw new ArgumentOutOfRangeException(fileType),
+#pragma warning restore IDE0055
+ };
+
+ ConfigurationState.Instance.ToFileFormat().SaveConfig(Program.ConfigurationPath);
+ LoadApplications();
+ }
+
private void ReloadGameList()
{
if (_isLoading)
diff --git a/src/Ryujinx.Ava/UI/Windows/SettingsWindow.axaml b/src/Ryujinx.Ava/UI/Windows/SettingsWindow.axaml
index 4b248db7..a0a75f61 100644
--- a/src/Ryujinx.Ava/UI/Windows/SettingsWindow.axaml
+++ b/src/Ryujinx.Ava/UI/Windows/SettingsWindow.axaml
@@ -15,7 +15,6 @@
MinWidth="800"
MinHeight="480"
WindowStartupLocation="CenterOwner"
- x:CompileBindings="True"
x:DataType="viewModels:SettingsViewModel"
mc:Ignorable="d"
Focusable="True">
@@ -59,44 +58,44 @@
IsSelected="True"
Content="{locale:Locale SettingsTabGeneral}"
Tag="UiPage"
- Icon="New" />
+ IconSource="New" />
<ui:NavigationViewItem
Content="{locale:Locale SettingsTabInput}"
Tag="InputPage"
- Icon="Games" />
+ IconSource="Games" />
<ui:NavigationViewItem
Content="{locale:Locale SettingsTabHotkeys}"
Tag="HotkeysPage"
- Icon="Keyboard" />
+ IconSource="Keyboard" />
<ui:NavigationViewItem
Content="{locale:Locale SettingsTabSystem}"
Tag="SystemPage"
- Icon="Settings" />
+ IconSource="Settings" />
<ui:NavigationViewItem
Content="{locale:Locale SettingsTabCpu}"
Tag="CpuPage">
- <ui:NavigationViewItem.Icon>
- <ui:FontIcon
+ <ui:NavigationViewItem.IconSource>
+ <ui:FontIconSource
FontFamily="avares://Ryujinx.Ava/Assets/Fonts#Segoe Fluent Icons"
Glyph="{helpers:GlyphValueConverter Chip}" />
- </ui:NavigationViewItem.Icon>
+ </ui:NavigationViewItem.IconSource>
</ui:NavigationViewItem>
<ui:NavigationViewItem
Content="{locale:Locale SettingsTabGraphics}"
Tag="GraphicsPage"
- Icon="Image" />
+ IconSource="Image" />
<ui:NavigationViewItem
Content="{locale:Locale SettingsTabAudio}"
- Icon="Audio"
+ IconSource="Audio"
Tag="AudioPage" />
<ui:NavigationViewItem
Content="{locale:Locale SettingsTabNetwork}"
Tag="NetworkPage"
- Icon="Globe" />
+ IconSource="Globe" />
<ui:NavigationViewItem
Content="{locale:Locale SettingsTabLogging}"
Tag="LoggingPage"
- Icon="Document" />
+ IconSource="Document" />
</ui:NavigationView.MenuItems>
<ui:NavigationView.Styles>
<Style Selector="Grid#PlaceholderGrid">
@@ -115,14 +114,14 @@
HotKey="Enter"
Classes="accent"
Content="{locale:Locale SettingsButtonOk}"
- Command="{ReflectionBinding OkButton}" />
+ Command="{Binding OkButton}" />
<Button
HotKey="Escape"
Content="{locale:Locale SettingsButtonCancel}"
- Command="{ReflectionBinding CancelButton}" />
+ Command="{Binding CancelButton}" />
<Button
Content="{locale:Locale SettingsButtonApply}"
- Command="{ReflectionBinding ApplyButton}" />
+ Command="{Binding ApplyButton}" />
</ReversibleStackPanel>
</Grid>
</window:StyleableWindow>
diff --git a/src/Ryujinx.Ava/UI/Windows/SettingsWindow.axaml.cs b/src/Ryujinx.Ava/UI/Windows/SettingsWindow.axaml.cs
index 518c2d32..d7bb0b88 100644
--- a/src/Ryujinx.Ava/UI/Windows/SettingsWindow.axaml.cs
+++ b/src/Ryujinx.Ava/UI/Windows/SettingsWindow.axaml.cs
@@ -1,10 +1,10 @@
+using Avalonia.Controls;
using FluentAvalonia.Core;
using FluentAvalonia.UI.Controls;
using Ryujinx.Ava.Common.Locale;
using Ryujinx.Ava.UI.ViewModels;
using Ryujinx.HLE.FileSystem;
using System;
-using System.ComponentModel;
namespace Ryujinx.Ava.UI.Windows
{
@@ -41,7 +41,7 @@ namespace Ryujinx.Ava.UI.Windows
if (Owner is MainWindow window && ViewModel.DirectoryChanged)
{
- window.ViewModel.LoadApplications();
+ window.LoadApplications();
}
}
@@ -93,7 +93,7 @@ namespace Ryujinx.Ava.UI.Windows
}
}
- protected override void OnClosing(CancelEventArgs e)
+ protected override void OnClosing(WindowClosingEventArgs e)
{
HotkeysPage.Dispose();
InputPage.Dispose();
diff --git a/src/Ryujinx.Ava/UI/Windows/StyleableWindow.cs b/src/Ryujinx.Ava/UI/Windows/StyleableWindow.cs
index ca23a5ba..43e42804 100644
--- a/src/Ryujinx.Ava/UI/Windows/StyleableWindow.cs
+++ b/src/Ryujinx.Ava/UI/Windows/StyleableWindow.cs
@@ -11,12 +11,12 @@ namespace Ryujinx.Ava.UI.Windows
{
public class StyleableWindow : Window
{
- public IBitmap IconImage { get; set; }
+ public Bitmap IconImage { get; set; }
public StyleableWindow()
{
WindowStartupLocation = WindowStartupLocation.CenterOwner;
- TransparencyLevelHint = WindowTransparencyLevel.None;
+ TransparencyLevelHint = new[] { WindowTransparencyLevel.None };
using Stream stream = Assembly.GetAssembly(typeof(ConfigurationState)).GetManifestResourceStream("Ryujinx.Ui.Common.Resources.Logo_Ryujinx.png");
diff --git a/src/Ryujinx.Ava/UI/Windows/TitleUpdateWindow.axaml b/src/Ryujinx.Ava/UI/Windows/TitleUpdateWindow.axaml
index e9858038..78fc6b28 100644
--- a/src/Ryujinx.Ava/UI/Windows/TitleUpdateWindow.axaml
+++ b/src/Ryujinx.Ava/UI/Windows/TitleUpdateWindow.axaml
@@ -11,7 +11,6 @@
Width="500"
Height="300"
mc:Ignorable="d"
- x:CompileBindings="True"
x:DataType="viewModels:TitleUpdateViewModel"
Focusable="True">
<Grid>
@@ -29,10 +28,9 @@
CornerRadius="5"
Padding="2.5">
<ListBox
- VirtualizationMode="None"
Background="Transparent"
SelectedItem="{Binding SelectedUpdate, Mode=TwoWay}"
- Items="{Binding Views}">
+ ItemsSource="{Binding Views}">
<ListBox.DataTemplates>
<DataTemplate
DataType="models:TitleUpdateModel">
@@ -103,7 +101,7 @@
<Button
Name="AddButton"
MinWidth="90"
- Command="{ReflectionBinding Add}">
+ Command="{Binding Add}">
<TextBlock Text="{locale:Locale SettingsTabGeneralAdd}" />
</Button>
<Button
diff --git a/src/Ryujinx.Ava/UI/Windows/TitleUpdateWindow.axaml.cs b/src/Ryujinx.Ava/UI/Windows/TitleUpdateWindow.axaml.cs
index f4fcad31..7ece6335 100644
--- a/src/Ryujinx.Ava/UI/Windows/TitleUpdateWindow.axaml.cs
+++ b/src/Ryujinx.Ava/UI/Windows/TitleUpdateWindow.axaml.cs
@@ -61,7 +61,7 @@ namespace Ryujinx.Ava.UI.Windows
if (VisualRoot is MainWindow window)
{
- window.ViewModel.LoadApplications();
+ window.LoadApplications();
}
((ContentDialog)Parent).Hide();