mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Follow theme change
This commit is contained in:
parent
1ef8d65dce
commit
1f61d934f8
2 changed files with 26 additions and 0 deletions
|
|
@ -11,6 +11,7 @@
|
|||
Title="{DynamicResource releaseNotes}"
|
||||
Width="700"
|
||||
Background="{DynamicResource PopuBGColor}"
|
||||
Closed="Window_Closed"
|
||||
Foreground="{DynamicResource PopupTextColor}"
|
||||
Loaded="Window_Loaded"
|
||||
ResizeMode="CanResize"
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ using System.Text.RegularExpressions;
|
|||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using Flow.Launcher.Infrastructure.Http;
|
||||
using MdXaml;
|
||||
|
||||
|
|
@ -18,6 +19,7 @@ namespace Flow.Launcher
|
|||
public ReleaseNotesWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
ModernWpf.ThemeManager.Current.ActualApplicationThemeChanged += ThemeManager_ActualApplicationThemeChanged;
|
||||
}
|
||||
|
||||
#region Window Events
|
||||
|
|
@ -25,6 +27,7 @@ namespace Flow.Launcher
|
|||
private void Window_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
RefreshMaximizeRestoreButton();
|
||||
ThemeManager_ActualApplicationThemeChanged(null, null);
|
||||
}
|
||||
|
||||
private void OnCloseExecuted(object sender, ExecutedRoutedEventArgs e)
|
||||
|
|
@ -182,5 +185,27 @@ namespace Flow.Launcher
|
|||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void Window_Closed(object sender, EventArgs e)
|
||||
{
|
||||
ModernWpf.ThemeManager.Current.ActualApplicationThemeChanged -= ThemeManager_ActualApplicationThemeChanged;
|
||||
}
|
||||
|
||||
private void ThemeManager_ActualApplicationThemeChanged(ModernWpf.ThemeManager sender, object args)
|
||||
{
|
||||
Application.Current.Dispatcher.Invoke(() =>
|
||||
{
|
||||
if (ModernWpf.ThemeManager.Current.ActualApplicationTheme == ModernWpf.ApplicationTheme.Light)
|
||||
{
|
||||
MarkdownViewer.Foreground = Brushes.Black;
|
||||
MarkdownViewer.Background = Brushes.White;
|
||||
}
|
||||
else
|
||||
{
|
||||
MarkdownViewer.Foreground = Brushes.White;
|
||||
MarkdownViewer.Background = Brushes.Black;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue