From 06abba25c1f63737e5bccbbabbc71a6ade33c366 Mon Sep 17 00:00:00 2001 From: Evan Husted Date: Sat, 7 Dec 2024 06:22:46 -0600 Subject: [PATCH] UI: Adapt accent color to the user's system. https://amwx.github.io/FluentAvaloniaDocs/pages/FATheme/Accents#using-the-systems-accent-color --- src/Ryujinx/App.axaml | 2 +- src/Ryujinx/Assets/Styles/Themes.xaml | 36 +------------------ .../Common/Markup/BasicMarkupExtension.cs | 4 +-- src/Ryujinx/Common/Markup/MarkupExtensions.cs | 6 ++-- .../UI/Controls/ApplicationGridView.axaml | 2 +- .../UI/Controls/ApplicationListView.axaml | 2 +- 6 files changed, 9 insertions(+), 43 deletions(-) diff --git a/src/Ryujinx/App.axaml b/src/Ryujinx/App.axaml index 5a603509c..5c96f97f2 100644 --- a/src/Ryujinx/App.axaml +++ b/src/Ryujinx/App.axaml @@ -11,7 +11,7 @@ - + diff --git a/src/Ryujinx/Assets/Styles/Themes.xaml b/src/Ryujinx/Assets/Styles/Themes.xaml index 056eba228..46e298035 100644 --- a/src/Ryujinx/Assets/Styles/Themes.xaml +++ b/src/Ryujinx/Assets/Styles/Themes.xaml @@ -4,18 +4,6 @@ - - - #FF00C3E3 - #FF00C3E3 - #FF00C3E3 - #FF00C3E3 - #FF00C3E3 - #FF00C3E3 - #FF00C3E3 - #FFe8e8e8 #FF00FABB #FFF0F0F0 #FFd6d6d6 @@ -26,6 +14,7 @@ #b3ffffff #80cccccc #A0000000 + #fffcd12a #FF2EEAC9 #FFFF4554 #6483F5 @@ -33,18 +22,6 @@ - - - #FF00C3E3 - #FF00C3E3 - #FF00C3E3 - #FF00C3E3 - #FF00C3E3 - #FF00C3E3 - #FF00C3E3 - #FFe8e8e8 #FF00FABB #FFF0F0F0 #FFd6d6d6 @@ -59,18 +36,7 @@ - - #008AA8 - #FF00C3E3 - #FF99b000 - #FF006d7d - #FF00525E - #FF00dbff - #FF19dfff - #FF33e3ff #FF00FABB #FF2D2D2D #FF505050 diff --git a/src/Ryujinx/Common/Markup/BasicMarkupExtension.cs b/src/Ryujinx/Common/Markup/BasicMarkupExtension.cs index 67c016562..b1b7361a6 100644 --- a/src/Ryujinx/Common/Markup/BasicMarkupExtension.cs +++ b/src/Ryujinx/Common/Markup/BasicMarkupExtension.cs @@ -17,13 +17,13 @@ namespace Ryujinx.Ava.Common.Markup public virtual string Name => "Item"; public virtual Action? Setter => null; - protected abstract T? GetValue(); + protected abstract T? Value { get; } protected virtual void ConfigureBindingExtension(CompiledBindingExtension _) { } private ClrPropertyInfo PropertyInfo => new(Name, - _ => GetValue(), + _ => Value, Setter as Action, typeof(T)); diff --git a/src/Ryujinx/Common/Markup/MarkupExtensions.cs b/src/Ryujinx/Common/Markup/MarkupExtensions.cs index a804792c7..cae6d8c2c 100644 --- a/src/Ryujinx/Common/Markup/MarkupExtensions.cs +++ b/src/Ryujinx/Common/Markup/MarkupExtensions.cs @@ -6,17 +6,17 @@ namespace Ryujinx.Ava.Common.Markup { internal class IconExtension(string iconString) : BasicMarkupExtension { - protected override Icon GetValue() => new() { Value = iconString }; + protected override Icon Value => new() { Value = iconString }; } internal class SpinningIconExtension(string iconString) : BasicMarkupExtension { - protected override Icon GetValue() => new() { Value = iconString, Animation = IconAnimation.Spin }; + protected override Icon Value => new() { Value = iconString, Animation = IconAnimation.Spin }; } internal class LocaleExtension(LocaleKeys key) : BasicMarkupExtension { - protected override string GetValue() => LocaleManager.Instance[key]; + protected override string Value => LocaleManager.Instance[key]; protected override void ConfigureBindingExtension(CompiledBindingExtension bindingExtension) => bindingExtension.Source = LocaleManager.Instance; diff --git a/src/Ryujinx/UI/Controls/ApplicationGridView.axaml b/src/Ryujinx/UI/Controls/ApplicationGridView.axaml index 98a1c004b..3bcb468ae 100644 --- a/src/Ryujinx/UI/Controls/ApplicationGridView.axaml +++ b/src/Ryujinx/UI/Controls/ApplicationGridView.axaml @@ -91,7 +91,7 @@ HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="16" - Foreground="{DynamicResource SystemAccentColor}" + Foreground="{DynamicResource FavoriteApplicationIconColor}" IsVisible="{Binding Favorite}" Symbol="StarFilled" /> diff --git a/src/Ryujinx/UI/Controls/ApplicationListView.axaml b/src/Ryujinx/UI/Controls/ApplicationListView.axaml index 0daa77ac4..8a72ebfbf 100644 --- a/src/Ryujinx/UI/Controls/ApplicationListView.axaml +++ b/src/Ryujinx/UI/Controls/ApplicationListView.axaml @@ -146,7 +146,7 @@ HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="16" - Foreground="{DynamicResource SystemAccentColor}" + Foreground="{DynamicResource FavoriteApplicationIconColor}" IsVisible="{Binding Favorite}" Symbol="StarFilled" />