From 394fd1d44c06446d94eca4e6a684a8bf9c6391d1 Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Sat, 7 Jun 2025 10:13:45 +0800 Subject: [PATCH] Support light/dark style --- Flow.Launcher/ReleaseNotesWindow.xaml.cs | 4 +- .../Resources/CustomControlTemplate.xaml | 399 ++++++++++++++++-- 2 files changed, 369 insertions(+), 34 deletions(-) diff --git a/Flow.Launcher/ReleaseNotesWindow.xaml.cs b/Flow.Launcher/ReleaseNotesWindow.xaml.cs index bf034c74f..c5130254a 100644 --- a/Flow.Launcher/ReleaseNotesWindow.xaml.cs +++ b/Flow.Launcher/ReleaseNotesWindow.xaml.cs @@ -10,7 +10,6 @@ using System.Windows; using System.Windows.Input; using System.Windows.Media; using Flow.Launcher.Infrastructure.Http; -using MdXaml; namespace Flow.Launcher { @@ -155,7 +154,6 @@ namespace Flow.Launcher private void MarkdownViewer_Loaded(object sender, RoutedEventArgs e) { - MarkdownViewer.MarkdownStyle = MarkdownStyle.GithubLike; RefreshMarkdownViewer(); } @@ -197,11 +195,13 @@ namespace Flow.Launcher { if (ModernWpf.ThemeManager.Current.ActualApplicationTheme == ModernWpf.ApplicationTheme.Light) { + MarkdownViewer.MarkdownStyle = (Style)Application.Current.Resources["DocumentStyleGithubLikeLight"]; MarkdownViewer.Foreground = Brushes.Black; MarkdownViewer.Background = Brushes.White; } else { + MarkdownViewer.MarkdownStyle = (Style)Application.Current.Resources["DocumentStyleGithubLikeDark"]; MarkdownViewer.Foreground = Brushes.White; MarkdownViewer.Background = Brushes.Black; } diff --git a/Flow.Launcher/Resources/CustomControlTemplate.xaml b/Flow.Launcher/Resources/CustomControlTemplate.xaml index cdaadd45a..6fd964867 100644 --- a/Flow.Launcher/Resources/CustomControlTemplate.xaml +++ b/Flow.Launcher/Resources/CustomControlTemplate.xaml @@ -2408,12 +2408,15 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +