From 2ca06eeae76f43ccc07a3d88d324cdf9273414ca Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Fri, 5 Mar 2021 12:45:15 -0600 Subject: [PATCH] Remove containing box for web view. Fixes #2848 --- .../Detail/DetailWebViewController.swift | 12 +----- .../Contents.json | 38 ------------------- 2 files changed, 1 insertion(+), 49 deletions(-) delete mode 100644 Mac/Resources/Assets.xcassets/webviewBackgroundColor.colorset/Contents.json diff --git a/Mac/MainWindow/Detail/DetailWebViewController.swift b/Mac/MainWindow/Detail/DetailWebViewController.swift index 843fabd44..857a34b1b 100644 --- a/Mac/MainWindow/Detail/DetailWebViewController.swift +++ b/Mac/MainWindow/Detail/DetailWebViewController.swift @@ -63,16 +63,6 @@ final class DetailWebViewController: NSViewController, WKUIDelegate { } override func loadView() { - // Wrap the webview in a box configured with the same background color that the web view uses - let box = NSBox(frame: .zero) - box.boxType = .custom - box.isTransparent = true - box.titlePosition = .noTitle - box.contentViewMargins = .zero - box.fillColor = NSColor(named: "webviewBackgroundColor")! - - view = box - let preferences = WKPreferences() preferences.minimumFontSize = 12.0 preferences.javaScriptCanOpenWindowsAutomatically = false @@ -96,7 +86,7 @@ final class DetailWebViewController: NSViewController, WKUIDelegate { webView.customUserAgent = userAgent } - box.addSubview(webView) + view = webView // Use the safe area layout guides if they are available. if #available(OSX 11.0, *) { diff --git a/Mac/Resources/Assets.xcassets/webviewBackgroundColor.colorset/Contents.json b/Mac/Resources/Assets.xcassets/webviewBackgroundColor.colorset/Contents.json deleted file mode 100644 index c488d1243..000000000 --- a/Mac/Resources/Assets.xcassets/webviewBackgroundColor.colorset/Contents.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "info" : { - "version" : 1, - "author" : "xcode" - }, - "colors" : [ - { - "idiom" : "universal", - "color" : { - "color-space" : "srgb", - "components" : { - "red" : "1.000", - "alpha" : "1.000", - "blue" : "1.000", - "green" : "1.000" - } - } - }, - { - "idiom" : "universal", - "appearances" : [ - { - "appearance" : "luminosity", - "value" : "dark" - } - ], - "color" : { - "color-space" : "display-p3", - "components" : { - "red" : "0.176", - "alpha" : "1.000", - "blue" : "0.176", - "green" : "0.176" - } - } - } - ] -} \ No newline at end of file