Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions WebViewControl/GlobalSettings.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using Xilium.CefGlue.Common;

namespace WebViewControl {

public class GlobalSettings {

private Color backgroundColor = Color.White;
private bool persistCache;
private bool enableErrorLogOnly;
private bool osrEnabled = false;
Expand All @@ -25,6 +27,14 @@ public void AddCommandLineSwitch(string key, string value) {

public IEnumerable<KeyValuePair<string, string>> CommandLineSwitches => commandLineSwitches;

public Color BackgroundColor {
get => backgroundColor;
set {
EnsureNotLoaded(nameof(BackgroundColor));
backgroundColor = value;
}
}

public string CachePath {
get => cachePath;
set {
Expand Down
3 changes: 2 additions & 1 deletion WebViewControl/WebViewLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ public static void Initialize(GlobalSettings settings) {
CachePath = settings.CachePath, // enable cache for external resources to speedup loading
WindowlessRenderingEnabled = settings.OsrEnabled,
RemoteDebuggingPort = settings.GetRemoteDebuggingPort(),
UserAgent = settings.UserAgent
UserAgent = settings.UserAgent,
BackgroundColor = new CefColor((uint)settings.BackgroundColor.ToArgb())
};

var customSchemes = CustomSchemes.Select(s => new CustomScheme() {
Expand Down
Loading