mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-06-28 06:46:24 +02:00
Add the "Auto" theme option in setting (#6611)
* Add "Follow OS theme" option * Update App.axaml.cs * Add "Follow OS theme" option * Update App.axaml.cs * Remove `this` * Remove annotation for nullable reference * Change into switch expression to make it concise * Change comments to XML docs * Update en_US.json * Fix icons in About dialog do not response to "auto" theme The theme icons seemingly use Dark variant event when the OS theme is light. In addition, I added ThemeManager common to make it accessible for both App and AboutWindow * Newline at the end * newline moment * Update ThemeManager.cs * bait to switch to lf * change to lf * temp. revert * Add back ThemeManager.cs common, pls pass the format check * I found the mistake: should have put `ThemeManager.OnThemeChanged();` in try block Finally solve the formatting check * test formatting * Update App.axaml.cs * Ok i seem to forget to add version lol * Fix info CA1816
This commit is contained in:
parent
075575200d
commit
2b6cc4b353
7 changed files with 128 additions and 21 deletions
|
@ -397,7 +397,13 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||
GameDirectories.Clear();
|
||||
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
|
||||
EnableDockedMode = config.System.EnableDockedMode;
|
||||
|
@ -486,7 +492,13 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||
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
|
||||
config.System.EnableDockedMode.Value = EnableDockedMode;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue