mirror of
https://github.com/rmcrackan/Libation.git
synced 2026-09-08 11:47:57 -04:00
Add support for custom themes in chardonnay
This commit is contained in:
1 parent
a37eb383cd
commit
b34970bd47
26 files changed
+719
-280
No files matched your search
@@ -45,7 +45,6 @@ namespace LibationAvalonia.ViewModels.Settings
|
||||
config.CreationTime = CreationTime.Value;
|
||||
config.LastWriteTime = LastWriteTime.Value;
|
||||
config.LogLevel = LoggingLevel;
|
||||
Configuration.Instance.SetString(ThemeVariant, nameof(ThemeVariant));
|
||||
}
|
||||
|
||||
private static float scaleFactorToLinearRange(float scaleFactor)
|
||||
@@ -95,20 +94,7 @@ namespace LibationAvalonia.ViewModels.Settings
|
||||
public string ThemeVariant
|
||||
{
|
||||
get => themeVariant;
|
||||
set
|
||||
{
|
||||
var changed = !value.Equals(themeVariant);
|
||||
this.RaiseAndSetIfChanged(ref themeVariant, value);
|
||||
|
||||
if (changed && App.Current is Avalonia.Application app)
|
||||
app.RequestedThemeVariant = themeVariant switch
|
||||
{
|
||||
nameof(Avalonia.Styling.ThemeVariant.Dark) => Avalonia.Styling.ThemeVariant.Dark,
|
||||
nameof(Avalonia.Styling.ThemeVariant.Light) => Avalonia.Styling.ThemeVariant.Light,
|
||||
// "System"
|
||||
_ => Avalonia.Styling.ThemeVariant.Default
|
||||
};
|
||||
}
|
||||
set => this.RaiseAndSetIfChanged(ref themeVariant, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user