mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-09 04:37:30 +02:00
[Peek]Force white background on html after WebView2 update (#29995)
This commit is contained in:
@@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using Microsoft.UI;
|
||||||
using Microsoft.UI.Xaml;
|
using Microsoft.UI.Xaml;
|
||||||
using Microsoft.UI.Xaml.Controls;
|
using Microsoft.UI.Xaml.Controls;
|
||||||
using Microsoft.Web.WebView2.Core;
|
using Microsoft.Web.WebView2.Core;
|
||||||
@@ -135,7 +136,8 @@ namespace Peek.FilePreviewer.Controls
|
|||||||
// Storing the original background color so it can be reset later for specific file types like HTML.
|
// Storing the original background color so it can be reset later for specific file types like HTML.
|
||||||
if (!_originalBackgroundColor.HasValue)
|
if (!_originalBackgroundColor.HasValue)
|
||||||
{
|
{
|
||||||
_originalBackgroundColor = PreviewBrowser.DefaultBackgroundColor;
|
// HACK: We used to store PreviewBrowser.DefaultBackgroundColor here, but WebView started returning transparent when running without a debugger attached. We want html files to be seen as in the browser, which has white as a default background color.
|
||||||
|
_originalBackgroundColor = Colors.White;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Setting the background color to transparent when initially loading the WebView2 component.
|
// Setting the background color to transparent when initially loading the WebView2 component.
|
||||||
|
|||||||
Reference in New Issue
Block a user