Skip to content

Commit 5d3fd85

Browse files
committed
Fix theme error in MediaInfoViewer plugin #1775
1 parent bbc20e5 commit 5d3fd85

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

  • QuickLook.Plugin/QuickLook.Plugin.MediaInfoViewer

‎QuickLook.Plugin/QuickLook.Plugin.MediaInfoViewer/Plugin.cs‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
using System.IO;
2525
using System.Linq;
2626
using System.Windows;
27+
using System.Windows.Controls;
2728
using System.Windows.Media;
2829

2930
namespace QuickLook.Plugin.MediaInfoViewer;
@@ -100,14 +101,15 @@ private void AssignHighlightingManager(TextViewerPanel tvp, ContextObject contex
100101
if (isDark)
101102
{
102103
context.Theme = Themes.Dark;
103-
tvp.Foreground = new BrushConverter().ConvertFromString("#FFEFEFEF") as SolidColorBrush;
104104
tvp.Background = Brushes.Transparent;
105+
tvp.SetResourceReference(TextBlock.ForegroundProperty, "WindowTextForeground");
105106
}
106107
else
107108
{
108109
context.Theme = Themes.Light;
109-
tvp.Foreground = new BrushConverter().ConvertFromString("#BBFAFAFA") as SolidColorBrush;
110-
tvp.Background = Brushes.Transparent;
110+
tvp.Background = OSThemeHelper.AppsUseDarkTheme()
111+
? new SolidColorBrush(Color.FromArgb(175, 255, 255, 255))
112+
: Brushes.Transparent;
111113
}
112114
}
113115
}

0 commit comments

Comments
 (0)