Set default background color for SVG panel

This commit is contained in:
ema
2025-08-05 01:11:37 +08:00
parent b0dceffa94
commit fd1004e6d3
2 changed files with 5 additions and 3 deletions

View File

@@ -103,9 +103,7 @@ public partial class ImagePanel : UserControl, INotifyPropertyChanged, IDisposab
ContextObject = context;
Meta = meta;
var s = meta.GetSize();
//_minZoomFactor = Math.Min(200d / s.Height, 400d / s.Width);
//_maxZoomFactor = Math.Min(9000d / s.Height, 9000d / s.Width);
_ = meta.GetSize();
ShowMeta();
Theme = ContextObject.Theme;

View File

@@ -22,6 +22,7 @@ using QuickLook.Plugin.HtmlViewer;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Reflection;
@@ -67,6 +68,9 @@ public class SvgImagePanel : WebpagePanel, IWebImagePanel
{
UserDataFolder = Path.Combine(SettingHelper.LocalDataPath, @"WebView2_Data\"),
},
// Prevent white flash in dark mode
DefaultBackgroundColor = OSThemeHelper.AppsUseDarkTheme() ? Color.FromArgb(255, 32, 32, 32) : Color.White,
};
_webView.CoreWebView2InitializationCompleted += WebView_CoreWebView2InitializationCompleted;
Content = _webView;