mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 18:57:19 +02:00
[File Explorer Add-ons] Fix file preview pane flickering on file selection and resizing (#26660)
* Move color values to constant * Fix MonacoPreview flickering on file selection and resizing * Fix MarkdownPreview flickering on file selection and resizing * Fix SvgPreview flickering on file selection and resizing * Create Settings class and standardize background setting for MarkdownPreview * Replace ColorTranslator.FromHtml with Color.FromArgb for constant color settings * Use existing SetBackground * Remove duplicate GetTheme function * Update src/modules/previewpane/MarkdownPreviewHandler/Settings.cs
This commit is contained in:
@@ -83,6 +83,7 @@ namespace Microsoft.PowerToys.PreviewHandler.Markdown
|
||||
/// </summary>
|
||||
public MarkdownPreviewHandlerControl()
|
||||
{
|
||||
this.SetBackgroundColor(Settings.BackgroundColor);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -121,11 +122,12 @@ namespace Microsoft.PowerToys.PreviewHandler.Markdown
|
||||
_infoBarDisplayed = true;
|
||||
}
|
||||
|
||||
string markdownHTML = FilePreviewCommon.MarkdownHelper.MarkdownHtml(fileText, Common.UI.ThemeManager.GetWindowsBaseColor().ToLowerInvariant(), filePath, ImagesBlockedCallBack);
|
||||
string markdownHTML = FilePreviewCommon.MarkdownHelper.MarkdownHtml(fileText, Settings.GetTheme(), filePath, ImagesBlockedCallBack);
|
||||
|
||||
_browser = new WebView2()
|
||||
{
|
||||
Dock = DockStyle.Fill,
|
||||
DefaultBackgroundColor = Color.Transparent,
|
||||
};
|
||||
|
||||
var webView2Options = new CoreWebView2EnvironmentOptions("--block-new-web-contents");
|
||||
|
||||
Reference in New Issue
Block a user