[Run] Switch to WPF UI theme manager (#30520)

* Switch to WPF UI theme manager

* fix

* add theme manager

* fix

* fix

* update error icon

* moved image initialization

* cleanup
This commit is contained in:
Davide Giacometti
2023-12-21 13:56:48 +01:00
committed by GitHub
parent e73e73fa6c
commit ae21b0dc09
12 changed files with 153 additions and 123 deletions

View File

@@ -24,6 +24,7 @@ using PowerLauncher.ViewModel;
using Wox.Infrastructure.UserSettings;
using Wox.Plugin;
using Wox.Plugin.Interfaces;
using Wpf.Ui.Appearance;
using CancellationToken = System.Threading.CancellationToken;
using Image = Wox.Infrastructure.Image;
using KeyEventArgs = System.Windows.Input.KeyEventArgs;
@@ -65,15 +66,7 @@ namespace PowerLauncher
WindowBackdropType = Wpf.Ui.Controls.WindowBackdropType.None;
}
// workaround for #30217
try
{
Wpf.Ui.Appearance.SystemThemeWatcher.Watch(this, WindowBackdropType);
}
catch (Exception ex)
{
Log.Exception("Exception in SystemThemeWatcher.Watch, issue 30217.", ex, GetType());
}
SystemThemeWatcher.Watch(this, WindowBackdropType);
_firstDeleteTimer.Elapsed += CheckForFirstDelete;
_firstDeleteTimer.Interval = 1000;
@@ -803,11 +796,7 @@ namespace PowerLauncher
{
if (disposing)
{
if (_firstDeleteTimer != null)
{
_firstDeleteTimer.Dispose();
}
_firstDeleteTimer?.Dispose();
_hwndSource?.Dispose();
}