Skip to content

Commit d25b7b3

Browse files
committed
Fix theme error in some theme-changable plugin #1507
1 parent a887ca3 commit d25b7b3

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

QuickLook/ViewerWindow.Properties.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
using System.Runtime.CompilerServices;
2424
using System.Windows;
2525
using System.Windows.Input;
26+
using Wpf.Ui.Appearance;
27+
using Wpf.Ui.Violeta.Appearance;
2628

2729
namespace QuickLook;
2830

@@ -105,14 +107,24 @@ public void SwitchTheme(Themes theme)
105107
if (isDark)
106108
{
107109
CurrentTheme = Themes.Dark;
110+
111+
// Update theme for QuickLook controls
108112
if (!Resources.MergedDictionaries.Contains(_darkDict))
109113
Resources.MergedDictionaries.Add(_darkDict);
114+
115+
// Update theme for WPF-UI controls
116+
ThemeManager.Apply(ApplicationTheme.Dark);
110117
}
111118
else
112119
{
113120
CurrentTheme = Themes.Light;
121+
122+
// Update theme for QuickLook controls
114123
if (Resources.MergedDictionaries.Contains(_darkDict))
115124
Resources.MergedDictionaries.Remove(_darkDict);
125+
126+
// Update theme for WPF-UI controls
127+
ThemeManager.Apply(ApplicationTheme.Light);
116128
}
117129
}
118130
}

0 commit comments

Comments
 (0)