UI: Adapt accent color to the user's system.

https://amwx.github.io/FluentAvaloniaDocs/pages/FATheme/Accents#using-the-systems-accent-color
This commit is contained in:
Evan Husted 2024-12-07 06:22:46 -06:00
parent de00a71690
commit 06abba25c1
6 changed files with 9 additions and 43 deletions

View file

@ -17,13 +17,13 @@ namespace Ryujinx.Ava.Common.Markup
public virtual string Name => "Item";
public virtual Action<object, T?>? 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<object, object?>,
typeof(T));

View file

@ -6,17 +6,17 @@ namespace Ryujinx.Ava.Common.Markup
{
internal class IconExtension(string iconString) : BasicMarkupExtension<Icon>
{
protected override Icon GetValue() => new() { Value = iconString };
protected override Icon Value => new() { Value = iconString };
}
internal class SpinningIconExtension(string iconString) : BasicMarkupExtension<Icon>
{
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<string>
{
protected override string GetValue() => LocaleManager.Instance[key];
protected override string Value => LocaleManager.Instance[key];
protected override void ConfigureBindingExtension(CompiledBindingExtension bindingExtension)
=> bindingExtension.Source = LocaleManager.Instance;