mirror of
https://github.com/rmcrackan/Libation.git
synced 2026-10-22 21:55:03 -04:00
Fix theme not being applied when changed by the system (#1368)
This commit is contained in:
1 parent
683c984246
commit
ec32ff77b2
1 file changed
+5
-1
@@ -230,7 +230,8 @@ namespace LibationAvalonia
|
||||
private static void ShowMainWindow(IClassicDesktopStyleApplicationLifetime desktop)
|
||||
{
|
||||
Configuration.Instance.PropertyChanged += ThemeVariant_PropertyChanged;
|
||||
OpenAndApplyTheme(Configuration.Instance.GetString(propertyName: nameof(ThemeVariant)));
|
||||
Current.ActualThemeVariantChanged += OnActualThemeVariantChanged;
|
||||
OnActualThemeVariantChanged(Current, EventArgs.Empty);
|
||||
|
||||
var mainWindow = new MainWindow();
|
||||
desktop.MainWindow = MainWindow = mainWindow;
|
||||
@@ -243,6 +244,9 @@ namespace LibationAvalonia
|
||||
private static void ThemeVariant_PropertyChanged(object sender, PropertyChangedEventArgsEx e)
|
||||
=> OpenAndApplyTheme(e.NewValue as string);
|
||||
|
||||
private static void OnActualThemeVariantChanged(object? sender, EventArgs e)
|
||||
=> OpenAndApplyTheme(Configuration.Instance.GetString(propertyName: nameof(ThemeVariant)));
|
||||
|
||||
private static void OpenAndApplyTheme(string? themeVariant)
|
||||
{
|
||||
using var themePersister = ChardonnayThemePersister.Create();
|
||||
|
||||
Reference in new issue
Block a user