Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
a3dc295c5f | ||
|
2ef4f92b07 | ||
|
2b6cc4b353 | ||
|
075575200d |
@@ -36,8 +36,8 @@
|
|||||||
|
|
||||||
## Compatibility
|
## Compatibility
|
||||||
|
|
||||||
As of October 2023, Ryujinx has been tested on approximately 4,200 titles;
|
As of May 2024, Ryujinx has been tested on approximately 4,300 titles;
|
||||||
over 4,150 boot past menus and into gameplay, with roughly 3,500 of those being considered playable.
|
over 4,100 boot past menus and into gameplay, with roughly 3,550 of those being considered playable.
|
||||||
|
|
||||||
You can check out the compatibility list [here](https://github.com/Ryujinx/Ryujinx-Games-List/issues).
|
You can check out the compatibility list [here](https://github.com/Ryujinx/Ryujinx-Games-List/issues).
|
||||||
|
|
||||||
|
@@ -390,7 +390,7 @@ namespace Ryujinx.Graphics.Gpu.Image
|
|||||||
{
|
{
|
||||||
_views.Remove(texture);
|
_views.Remove(texture);
|
||||||
|
|
||||||
Group.RemoveView(texture);
|
Group.RemoveView(_views, texture);
|
||||||
|
|
||||||
texture._viewStorage = texture;
|
texture._viewStorage = texture;
|
||||||
|
|
||||||
|
@@ -88,9 +88,9 @@ namespace Ryujinx.Graphics.Gpu.Image
|
|||||||
private MultiRange TextureRange => Storage.Range;
|
private MultiRange TextureRange => Storage.Range;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The views list from the storage texture.
|
/// The views array from the storage texture.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private List<Texture> _views;
|
private Texture[] _views;
|
||||||
private TextureGroupHandle[] _handles;
|
private TextureGroupHandle[] _handles;
|
||||||
private bool[] _loadNeeded;
|
private bool[] _loadNeeded;
|
||||||
|
|
||||||
@@ -1074,7 +1074,7 @@ namespace Ryujinx.Graphics.Gpu.Image
|
|||||||
public void UpdateViews(List<Texture> views, Texture texture)
|
public void UpdateViews(List<Texture> views, Texture texture)
|
||||||
{
|
{
|
||||||
// This is saved to calculate overlapping views for each handle.
|
// This is saved to calculate overlapping views for each handle.
|
||||||
_views = views;
|
_views = views.ToArray();
|
||||||
|
|
||||||
bool layerViews = _hasLayerViews;
|
bool layerViews = _hasLayerViews;
|
||||||
bool mipViews = _hasMipViews;
|
bool mipViews = _hasMipViews;
|
||||||
@@ -1136,9 +1136,13 @@ namespace Ryujinx.Graphics.Gpu.Image
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Removes a view from the group, removing it from all overlap lists.
|
/// Removes a view from the group, removing it from all overlap lists.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
/// <param name="views">The views list of the storage texture</param>
|
||||||
/// <param name="view">View to remove from the group</param>
|
/// <param name="view">View to remove from the group</param>
|
||||||
public void RemoveView(Texture view)
|
public void RemoveView(List<Texture> views, Texture view)
|
||||||
{
|
{
|
||||||
|
// This is saved to calculate overlapping views for each handle.
|
||||||
|
_views = views.ToArray();
|
||||||
|
|
||||||
int offset = FindOffset(view);
|
int offset = FindOffset(view);
|
||||||
|
|
||||||
foreach (TextureGroupHandle handle in _handles)
|
foreach (TextureGroupHandle handle in _handles)
|
||||||
@@ -1605,9 +1609,11 @@ namespace Ryujinx.Graphics.Gpu.Image
|
|||||||
|
|
||||||
Storage.SignalModifiedDirty();
|
Storage.SignalModifiedDirty();
|
||||||
|
|
||||||
if (_views != null)
|
Texture[] views = _views;
|
||||||
|
|
||||||
|
if (views != null)
|
||||||
{
|
{
|
||||||
foreach (Texture texture in _views)
|
foreach (Texture texture in views)
|
||||||
{
|
{
|
||||||
texture.SignalModifiedDirty();
|
texture.SignalModifiedDirty();
|
||||||
}
|
}
|
||||||
|
@@ -121,7 +121,7 @@ namespace Ryujinx.Graphics.Gpu.Image
|
|||||||
public TextureGroupHandle(TextureGroup group,
|
public TextureGroupHandle(TextureGroup group,
|
||||||
int offset,
|
int offset,
|
||||||
ulong size,
|
ulong size,
|
||||||
List<Texture> views,
|
IEnumerable<Texture> views,
|
||||||
int firstLayer,
|
int firstLayer,
|
||||||
int firstLevel,
|
int firstLevel,
|
||||||
int baseSlice,
|
int baseSlice,
|
||||||
@@ -201,8 +201,8 @@ namespace Ryujinx.Graphics.Gpu.Image
|
|||||||
/// Calculate a list of which views overlap this handle.
|
/// Calculate a list of which views overlap this handle.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="group">The parent texture group, used to find a view's base CPU VA offset</param>
|
/// <param name="group">The parent texture group, used to find a view's base CPU VA offset</param>
|
||||||
/// <param name="views">The list of views to search for overlaps</param>
|
/// <param name="views">The views to search for overlaps</param>
|
||||||
public void RecalculateOverlaps(TextureGroup group, List<Texture> views)
|
public void RecalculateOverlaps(TextureGroup group, IEnumerable<Texture> views)
|
||||||
{
|
{
|
||||||
// Overlaps can be accessed from the memory tracking signal handler, so access must be atomic.
|
// Overlaps can be accessed from the memory tracking signal handler, so access must be atomic.
|
||||||
lock (Overlaps)
|
lock (Overlaps)
|
||||||
|
@@ -81,6 +81,11 @@ namespace Ryujinx.Input.GTK3
|
|||||||
return _pressedKeys.Contains(nativeKey);
|
return _pressedKeys.Contains(nativeKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void Clear()
|
||||||
|
{
|
||||||
|
_pressedKeys.Clear();
|
||||||
|
}
|
||||||
|
|
||||||
public IGamepad GetGamepad(string id)
|
public IGamepad GetGamepad(string id)
|
||||||
{
|
{
|
||||||
if (!_keyboardIdentifers[0].Equals(id))
|
if (!_keyboardIdentifers[0].Equals(id))
|
||||||
|
@@ -107,6 +107,8 @@ namespace Ryujinx.UI.Applet
|
|||||||
swkbdDialog.SetInputLengthValidation(args.StringLengthMin, args.StringLengthMax);
|
swkbdDialog.SetInputLengthValidation(args.StringLengthMin, args.StringLengthMax);
|
||||||
swkbdDialog.SetInputValidation(args.KeyboardMode);
|
swkbdDialog.SetInputValidation(args.KeyboardMode);
|
||||||
|
|
||||||
|
((MainWindow)_parent).RendererWidget.NpadManager.BlockInputUpdates();
|
||||||
|
|
||||||
if (swkbdDialog.Run() == (int)ResponseType.Ok)
|
if (swkbdDialog.Run() == (int)ResponseType.Ok)
|
||||||
{
|
{
|
||||||
inputText = swkbdDialog.InputEntry.Text;
|
inputText = swkbdDialog.InputEntry.Text;
|
||||||
@@ -128,6 +130,7 @@ namespace Ryujinx.UI.Applet
|
|||||||
});
|
});
|
||||||
|
|
||||||
dialogCloseEvent.WaitOne();
|
dialogCloseEvent.WaitOne();
|
||||||
|
((MainWindow)_parent).RendererWidget.NpadManager.UnblockInputUpdates();
|
||||||
|
|
||||||
userText = error ? null : inputText;
|
userText = error ? null : inputText;
|
||||||
|
|
||||||
|
@@ -174,6 +174,11 @@ namespace Ryujinx.Input.HLE
|
|||||||
{
|
{
|
||||||
lock (_lock)
|
lock (_lock)
|
||||||
{
|
{
|
||||||
|
foreach (InputConfig inputConfig in _inputConfig)
|
||||||
|
{
|
||||||
|
_controllers[(int)inputConfig.PlayerIndex].GamepadDriver.Clear();
|
||||||
|
}
|
||||||
|
|
||||||
_blockInputUpdates = false;
|
_blockInputUpdates = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -33,5 +33,11 @@ namespace Ryujinx.Input
|
|||||||
/// <param name="id">The unique id of the gamepad</param>
|
/// <param name="id">The unique id of the gamepad</param>
|
||||||
/// <returns>An instance of <see cref="IGamepad"/> associated to the gamepad id given or null if not found</returns>
|
/// <returns>An instance of <see cref="IGamepad"/> associated to the gamepad id given or null if not found</returns>
|
||||||
IGamepad GetGamepad(string id);
|
IGamepad GetGamepad(string id);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Flush the internal state of the driver.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>Does nothing by default.</remarks>
|
||||||
|
void Clear() { }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,8 +1,10 @@
|
|||||||
using Avalonia;
|
using Avalonia;
|
||||||
using Avalonia.Controls.ApplicationLifetimes;
|
using Avalonia.Controls.ApplicationLifetimes;
|
||||||
using Avalonia.Markup.Xaml;
|
using Avalonia.Markup.Xaml;
|
||||||
|
using Avalonia.Platform;
|
||||||
using Avalonia.Styling;
|
using Avalonia.Styling;
|
||||||
using Avalonia.Threading;
|
using Avalonia.Threading;
|
||||||
|
using Ryujinx.Ava.Common;
|
||||||
using Ryujinx.Ava.Common.Locale;
|
using Ryujinx.Ava.Common.Locale;
|
||||||
using Ryujinx.Ava.UI.Helpers;
|
using Ryujinx.Ava.UI.Helpers;
|
||||||
using Ryujinx.Ava.UI.Windows;
|
using Ryujinx.Ava.UI.Windows;
|
||||||
@@ -84,7 +86,7 @@ namespace Ryujinx.Ava
|
|||||||
ApplyConfiguredTheme();
|
ApplyConfiguredTheme();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ApplyConfiguredTheme()
|
public void ApplyConfiguredTheme()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -92,13 +94,18 @@ namespace Ryujinx.Ava
|
|||||||
|
|
||||||
if (string.IsNullOrWhiteSpace(baseStyle))
|
if (string.IsNullOrWhiteSpace(baseStyle))
|
||||||
{
|
{
|
||||||
ConfigurationState.Instance.UI.BaseStyle.Value = "Dark";
|
ConfigurationState.Instance.UI.BaseStyle.Value = "Auto";
|
||||||
|
|
||||||
baseStyle = ConfigurationState.Instance.UI.BaseStyle;
|
baseStyle = ConfigurationState.Instance.UI.BaseStyle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ThemeVariant systemTheme = DetectSystemTheme();
|
||||||
|
|
||||||
|
ThemeManager.OnThemeChanged();
|
||||||
|
|
||||||
RequestedThemeVariant = baseStyle switch
|
RequestedThemeVariant = baseStyle switch
|
||||||
{
|
{
|
||||||
|
"Auto" => systemTheme,
|
||||||
"Light" => ThemeVariant.Light,
|
"Light" => ThemeVariant.Light,
|
||||||
"Dark" => ThemeVariant.Dark,
|
"Dark" => ThemeVariant.Dark,
|
||||||
_ => ThemeVariant.Default,
|
_ => ThemeVariant.Default,
|
||||||
@@ -111,5 +118,28 @@ namespace Ryujinx.Ava
|
|||||||
ShowRestartDialog();
|
ShowRestartDialog();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Converts a PlatformThemeVariant value to the corresponding ThemeVariant value.
|
||||||
|
/// </summary>
|
||||||
|
public static ThemeVariant ConvertThemeVariant(PlatformThemeVariant platformThemeVariant) =>
|
||||||
|
platformThemeVariant switch
|
||||||
|
{
|
||||||
|
PlatformThemeVariant.Dark => ThemeVariant.Dark,
|
||||||
|
PlatformThemeVariant.Light => ThemeVariant.Light,
|
||||||
|
_ => ThemeVariant.Default,
|
||||||
|
};
|
||||||
|
|
||||||
|
public static ThemeVariant DetectSystemTheme()
|
||||||
|
{
|
||||||
|
if (Application.Current is App app)
|
||||||
|
{
|
||||||
|
var colorValues = app.PlatformSettings.GetColorValues();
|
||||||
|
|
||||||
|
return ConvertThemeVariant(colorValues.ThemeVariant);
|
||||||
|
}
|
||||||
|
|
||||||
|
return ThemeVariant.Default;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -404,6 +404,7 @@
|
|||||||
"GameListContextMenuToggleFavorite": "Toggle Favorite",
|
"GameListContextMenuToggleFavorite": "Toggle Favorite",
|
||||||
"GameListContextMenuToggleFavoriteToolTip": "Toggle Favorite status of Game",
|
"GameListContextMenuToggleFavoriteToolTip": "Toggle Favorite status of Game",
|
||||||
"SettingsTabGeneralTheme": "Theme:",
|
"SettingsTabGeneralTheme": "Theme:",
|
||||||
|
"SettingsTabGeneralThemeAuto": "Auto",
|
||||||
"SettingsTabGeneralThemeDark": "Dark",
|
"SettingsTabGeneralThemeDark": "Dark",
|
||||||
"SettingsTabGeneralThemeLight": "Light",
|
"SettingsTabGeneralThemeLight": "Light",
|
||||||
"ControllerSettingsConfigureGeneral": "Configure",
|
"ControllerSettingsConfigureGeneral": "Configure",
|
||||||
|
14
src/Ryujinx/Common/ThemeManager.cs
Normal file
14
src/Ryujinx/Common/ThemeManager.cs
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
using System;
|
||||||
|
|
||||||
|
namespace Ryujinx.Ava.Common
|
||||||
|
{
|
||||||
|
public static class ThemeManager
|
||||||
|
{
|
||||||
|
public static event EventHandler ThemeChanged;
|
||||||
|
|
||||||
|
public static void OnThemeChanged()
|
||||||
|
{
|
||||||
|
ThemeChanged?.Invoke(null, EventArgs.Empty);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -195,7 +195,7 @@ namespace Ryujinx.Ava.Input
|
|||||||
|
|
||||||
public void Clear()
|
public void Clear()
|
||||||
{
|
{
|
||||||
_driver?.ResetKeys();
|
_driver?.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Dispose() { }
|
public void Dispose() { }
|
||||||
|
@@ -94,7 +94,7 @@ namespace Ryujinx.Ava.Input
|
|||||||
return _pressedKeys.Contains(nativeKey);
|
return _pressedKeys.Contains(nativeKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ResetKeys()
|
public void Clear()
|
||||||
{
|
{
|
||||||
_pressedKeys.Clear();
|
_pressedKeys.Clear();
|
||||||
}
|
}
|
||||||
|
@@ -122,6 +122,7 @@ namespace Ryujinx.Ava.UI.Applet
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
_parent.ViewModel.AppHost.NpadManager.BlockInputUpdates();
|
||||||
var response = await SwkbdAppletDialog.ShowInputDialog(LocaleManager.Instance[LocaleKeys.SoftwareKeyboard], args);
|
var response = await SwkbdAppletDialog.ShowInputDialog(LocaleManager.Instance[LocaleKeys.SoftwareKeyboard], args);
|
||||||
|
|
||||||
if (response.Result == UserResult.Ok)
|
if (response.Result == UserResult.Ok)
|
||||||
@@ -143,6 +144,7 @@ namespace Ryujinx.Ava.UI.Applet
|
|||||||
});
|
});
|
||||||
|
|
||||||
dialogCloseEvent.WaitOne();
|
dialogCloseEvent.WaitOne();
|
||||||
|
_parent.ViewModel.AppHost.NpadManager.UnblockInputUpdates();
|
||||||
|
|
||||||
userText = error ? null : inputText;
|
userText = error ? null : inputText;
|
||||||
|
|
||||||
|
@@ -1,6 +1,8 @@
|
|||||||
using Avalonia.Media.Imaging;
|
using Avalonia.Media.Imaging;
|
||||||
using Avalonia.Platform;
|
using Avalonia.Platform;
|
||||||
|
using Avalonia.Styling;
|
||||||
using Avalonia.Threading;
|
using Avalonia.Threading;
|
||||||
|
using Ryujinx.Ava.Common;
|
||||||
using Ryujinx.Ava.Common.Locale;
|
using Ryujinx.Ava.Common.Locale;
|
||||||
using Ryujinx.Common.Utilities;
|
using Ryujinx.Common.Utilities;
|
||||||
using Ryujinx.UI.Common.Configuration;
|
using Ryujinx.UI.Common.Configuration;
|
||||||
@@ -11,7 +13,7 @@ using System.Threading.Tasks;
|
|||||||
|
|
||||||
namespace Ryujinx.Ava.UI.ViewModels
|
namespace Ryujinx.Ava.UI.ViewModels
|
||||||
{
|
{
|
||||||
public class AboutWindowViewModel : BaseModel
|
public class AboutWindowViewModel : BaseModel, IDisposable
|
||||||
{
|
{
|
||||||
private Bitmap _githubLogo;
|
private Bitmap _githubLogo;
|
||||||
private Bitmap _discordLogo;
|
private Bitmap _discordLogo;
|
||||||
@@ -86,23 +88,39 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||||||
public AboutWindowViewModel()
|
public AboutWindowViewModel()
|
||||||
{
|
{
|
||||||
Version = Program.Version;
|
Version = Program.Version;
|
||||||
|
UpdateLogoTheme(ConfigurationState.Instance.UI.BaseStyle.Value);
|
||||||
if (ConfigurationState.Instance.UI.BaseStyle.Value == "Light")
|
|
||||||
{
|
|
||||||
GithubLogo = new Bitmap(AssetLoader.Open(new Uri("resm:Ryujinx.UI.Common.Resources.Logo_GitHub_Light.png?assembly=Ryujinx.UI.Common")));
|
|
||||||
DiscordLogo = new Bitmap(AssetLoader.Open(new Uri("resm:Ryujinx.UI.Common.Resources.Logo_Discord_Light.png?assembly=Ryujinx.UI.Common")));
|
|
||||||
PatreonLogo = new Bitmap(AssetLoader.Open(new Uri("resm:Ryujinx.UI.Common.Resources.Logo_Patreon_Light.png?assembly=Ryujinx.UI.Common")));
|
|
||||||
TwitterLogo = new Bitmap(AssetLoader.Open(new Uri("resm:Ryujinx.UI.Common.Resources.Logo_Twitter_Light.png?assembly=Ryujinx.UI.Common")));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
GithubLogo = new Bitmap(AssetLoader.Open(new Uri("resm:Ryujinx.UI.Common.Resources.Logo_GitHub_Dark.png?assembly=Ryujinx.UI.Common")));
|
|
||||||
DiscordLogo = new Bitmap(AssetLoader.Open(new Uri("resm:Ryujinx.UI.Common.Resources.Logo_Discord_Dark.png?assembly=Ryujinx.UI.Common")));
|
|
||||||
PatreonLogo = new Bitmap(AssetLoader.Open(new Uri("resm:Ryujinx.UI.Common.Resources.Logo_Patreon_Dark.png?assembly=Ryujinx.UI.Common")));
|
|
||||||
TwitterLogo = new Bitmap(AssetLoader.Open(new Uri("resm:Ryujinx.UI.Common.Resources.Logo_Twitter_Dark.png?assembly=Ryujinx.UI.Common")));
|
|
||||||
}
|
|
||||||
|
|
||||||
Dispatcher.UIThread.InvokeAsync(DownloadPatronsJson);
|
Dispatcher.UIThread.InvokeAsync(DownloadPatronsJson);
|
||||||
|
|
||||||
|
ThemeManager.ThemeChanged += ThemeManager_ThemeChanged;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ThemeManager_ThemeChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
Dispatcher.UIThread.Post(() => UpdateLogoTheme(ConfigurationState.Instance.UI.BaseStyle.Value));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void UpdateLogoTheme(string theme)
|
||||||
|
{
|
||||||
|
bool isDarkTheme = theme == "Dark" || (theme == "Auto" && App.DetectSystemTheme() == ThemeVariant.Dark);
|
||||||
|
|
||||||
|
string basePath = "resm:Ryujinx.UI.Common.Resources.";
|
||||||
|
string themeSuffix = isDarkTheme ? "Dark.png" : "Light.png";
|
||||||
|
|
||||||
|
GithubLogo = LoadBitmap($"{basePath}Logo_GitHub_{themeSuffix}?assembly=Ryujinx.UI.Common");
|
||||||
|
DiscordLogo = LoadBitmap($"{basePath}Logo_Discord_{themeSuffix}?assembly=Ryujinx.UI.Common");
|
||||||
|
PatreonLogo = LoadBitmap($"{basePath}Logo_Patreon_{themeSuffix}?assembly=Ryujinx.UI.Common");
|
||||||
|
TwitterLogo = LoadBitmap($"{basePath}Logo_Twitter_{themeSuffix}?assembly=Ryujinx.UI.Common");
|
||||||
|
}
|
||||||
|
|
||||||
|
private Bitmap LoadBitmap(string uri)
|
||||||
|
{
|
||||||
|
return new Bitmap(Avalonia.Platform.AssetLoader.Open(new Uri(uri)));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Dispose()
|
||||||
|
{
|
||||||
|
ThemeManager.ThemeChanged -= ThemeManager_ThemeChanged;
|
||||||
|
GC.SuppressFinalize(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task DownloadPatronsJson()
|
private async Task DownloadPatronsJson()
|
||||||
|
@@ -397,7 +397,13 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||||||
GameDirectories.Clear();
|
GameDirectories.Clear();
|
||||||
GameDirectories.AddRange(config.UI.GameDirs.Value);
|
GameDirectories.AddRange(config.UI.GameDirs.Value);
|
||||||
|
|
||||||
BaseStyleIndex = config.UI.BaseStyle == "Light" ? 0 : 1;
|
BaseStyleIndex = config.UI.BaseStyle.Value switch
|
||||||
|
{
|
||||||
|
"Auto" => 0,
|
||||||
|
"Light" => 1,
|
||||||
|
"Dark" => 2,
|
||||||
|
_ => 0
|
||||||
|
};
|
||||||
|
|
||||||
// Input
|
// Input
|
||||||
EnableDockedMode = config.System.EnableDockedMode;
|
EnableDockedMode = config.System.EnableDockedMode;
|
||||||
@@ -486,7 +492,13 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||||||
config.UI.GameDirs.Value = gameDirs;
|
config.UI.GameDirs.Value = gameDirs;
|
||||||
}
|
}
|
||||||
|
|
||||||
config.UI.BaseStyle.Value = BaseStyleIndex == 0 ? "Light" : "Dark";
|
config.UI.BaseStyle.Value = BaseStyleIndex switch
|
||||||
|
{
|
||||||
|
0 => "Auto",
|
||||||
|
1 => "Light",
|
||||||
|
2 => "Dark",
|
||||||
|
_ => "Auto"
|
||||||
|
};
|
||||||
|
|
||||||
// Input
|
// Input
|
||||||
config.System.EnableDockedMode.Value = EnableDockedMode;
|
config.System.EnableDockedMode.Value = EnableDockedMode;
|
||||||
|
@@ -65,6 +65,9 @@
|
|||||||
<ComboBox SelectedIndex="{Binding BaseStyleIndex}"
|
<ComboBox SelectedIndex="{Binding BaseStyleIndex}"
|
||||||
HorizontalContentAlignment="Left"
|
HorizontalContentAlignment="Left"
|
||||||
MinWidth="100">
|
MinWidth="100">
|
||||||
|
<ComboBoxItem>
|
||||||
|
<TextBlock Text="{locale:Locale SettingsTabGeneralThemeAuto}" />
|
||||||
|
</ComboBoxItem>
|
||||||
<ComboBoxItem>
|
<ComboBoxItem>
|
||||||
<TextBlock Text="{locale:Locale SettingsTabGeneralThemeLight}" />
|
<TextBlock Text="{locale:Locale SettingsTabGeneralThemeLight}" />
|
||||||
</ComboBoxItem>
|
</ComboBoxItem>
|
||||||
|
@@ -2,6 +2,7 @@ using Avalonia;
|
|||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Controls.Primitives;
|
using Avalonia.Controls.Primitives;
|
||||||
using Avalonia.Interactivity;
|
using Avalonia.Interactivity;
|
||||||
|
using Avalonia.Platform;
|
||||||
using Avalonia.Threading;
|
using Avalonia.Threading;
|
||||||
using FluentAvalonia.UI.Controls;
|
using FluentAvalonia.UI.Controls;
|
||||||
using Ryujinx.Ava.Common;
|
using Ryujinx.Ava.Common;
|
||||||
@@ -92,6 +93,29 @@ namespace Ryujinx.Ava.UI.Windows
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Event handler for detecting OS theme change when using "Follow OS theme" option
|
||||||
|
/// </summary>
|
||||||
|
private void OnPlatformColorValuesChanged(object sender, PlatformColorValues e)
|
||||||
|
{
|
||||||
|
if (Application.Current is App app)
|
||||||
|
{
|
||||||
|
app.ApplyConfiguredTheme();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnClosed(EventArgs e)
|
||||||
|
{
|
||||||
|
base.OnClosed(e);
|
||||||
|
if (PlatformSettings != null)
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Unsubscribe to the ColorValuesChanged event
|
||||||
|
/// </summary>
|
||||||
|
PlatformSettings.ColorValuesChanged -= OnPlatformColorValuesChanged;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
protected override void OnApplyTemplate(TemplateAppliedEventArgs e)
|
protected override void OnApplyTemplate(TemplateAppliedEventArgs e)
|
||||||
{
|
{
|
||||||
base.OnApplyTemplate(e);
|
base.OnApplyTemplate(e);
|
||||||
@@ -390,6 +414,11 @@ namespace Ryujinx.Ava.UI.Windows
|
|||||||
|
|
||||||
Initialize();
|
Initialize();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Subscribe to the ColorValuesChanged event
|
||||||
|
/// </summary>
|
||||||
|
PlatformSettings.ColorValuesChanged += OnPlatformColorValuesChanged;
|
||||||
|
|
||||||
ViewModel.Initialize(
|
ViewModel.Initialize(
|
||||||
ContentManager,
|
ContentManager,
|
||||||
StorageProvider,
|
StorageProvider,
|
||||||
|
Reference in New Issue
Block a user