Make minor cleanups.

This commit is contained in:
Brent Simmons 2017-09-23 13:59:19 -07:00
parent d3593683df
commit 8c0c8db824
4 changed files with 4 additions and 8 deletions

View File

@ -20,13 +20,10 @@ final class AppDefaults {
static let shared = AppDefaults() static let shared = AppDefaults()
private struct Key { private struct Key {
static let firstRunDate = "firstRunDate" static let firstRunDate = "firstRunDate"
static let sidebarFontSize = "sidebarFontSize" static let sidebarFontSize = "sidebarFontSize"
static let timelineFontSize = "timelineFontSize" static let timelineFontSize = "timelineFontSize"
static let detailFontSize = "detailFontSize" static let detailFontSize = "detailFontSize"
static let openInBrowserInBackground = "openInBrowserInBackground" static let openInBrowserInBackground = "openInBrowserInBackground"
} }

View File

@ -21,9 +21,9 @@ private let nnwStyleSuffix = ".nnwstyle"
private let cssStyleSuffix = ".css" private let cssStyleSuffix = ".css"
private let styleSuffixes = [styleSuffix, nnwStyleSuffix, cssStyleSuffix]; private let styleSuffixes = [styleSuffix, nnwStyleSuffix, cssStyleSuffix];
public final class ArticleStylesManager { final class ArticleStylesManager {
static let sharedInstance = ArticleStylesManager() static let shared = ArticleStylesManager()
private let folderPath = RSDataSubfolder(nil, stylesFolderName)! private let folderPath = RSDataSubfolder(nil, stylesFolderName)!
var currentStyleName: String { var currentStyleName: String {

View File

@ -14,8 +14,7 @@ import RSWeb
func openInBrowser(_ urlString: String) { func openInBrowser(_ urlString: String) {
// Opens according to prefs. // Opens according to prefs.
let openInBackground = UserDefaults.standard.bool(forKey: OpenInBrowserInBackgroundKey) openInBrowser(urlString, inBackground: AppDefaults.shared.openInBrowserInBackground)
openInBrowser(urlString, inBackground: openInBackground)
} }
func openInBrowser(_ urlString: String, inBackground: Bool) { func openInBrowser(_ urlString: String, inBackground: Bool) {

View File

@ -72,7 +72,7 @@ class DetailViewController: NSViewController, WKNavigationDelegate, WKUIDelegate
private func reloadHTML() { private func reloadHTML() {
if let article = article { if let article = article {
let articleRenderer = ArticleRenderer(article: article, style: ArticleStylesManager.sharedInstance.currentStyle) let articleRenderer = ArticleRenderer(article: article, style: ArticleStylesManager.shared.currentStyle)
webview.loadHTMLString(articleRenderer.html, baseURL: articleRenderer.baseURL) webview.loadHTMLString(articleRenderer.html, baseURL: articleRenderer.baseURL)
} }
else { else {