Revert "Revert "[File Explorer Add-ons] Fix file preview pane flickering on f… (#27093)" (#27122)

This reverts commit 217f3f9ff3.
This commit is contained in:
Stefan Markovic
2023-06-30 18:44:12 +02:00
committed by GitHub
parent 03a5a4200e
commit 2dcaa526cb
14 changed files with 101 additions and 13 deletions

View File

@@ -77,6 +77,11 @@ namespace Microsoft.PowerToys.PreviewHandler.Monaco
/// </summary>
private string _base64FileCode;
public MonacoPreviewHandlerControl()
{
this.SetBackground();
}
[STAThread]
public override void DoPreview<T>(T dataSource)
{
@@ -95,14 +100,12 @@ namespace Microsoft.PowerToys.PreviewHandler.Monaco
base.DoPreview(dataSource);
// Sets background color
SetBackground();
// Starts loading screen
InitializeLoadingScreen();
// New webview2 element
_webView = new WebView2();
_webView.DefaultBackgroundColor = Color.Transparent;
// Checks if dataSource is a string
if (!(dataSource is string filePath))

View File

@@ -86,7 +86,7 @@ namespace Microsoft.PowerToys.PreviewHandler.Monaco
{
if (GetTheme() == "dark")
{
return System.Drawing.ColorTranslator.FromHtml("#1e1e1e");
return Color.FromArgb(30, 30, 30); // #1e1e1e
}
else
{