mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Update the text size using JavaScript so that the web page doesn't reload. Fixes #2641
This commit is contained in:
@@ -40,13 +40,7 @@ final class DetailWebViewController: NSViewController, WKUIDelegate {
|
||||
}
|
||||
}
|
||||
|
||||
private var articleTextSize = AppDefaults.shared.articleTextSize {
|
||||
didSet {
|
||||
if articleTextSize != oldValue {
|
||||
reloadHTML()
|
||||
}
|
||||
}
|
||||
}
|
||||
private var articleTextSize = AppDefaults.shared.articleTextSize
|
||||
|
||||
#if !MAC_APP_STORE
|
||||
private var webInspectorEnabled: Bool {
|
||||
@@ -146,7 +140,10 @@ final class DetailWebViewController: NSViewController, WKUIDelegate {
|
||||
}
|
||||
|
||||
@objc func userDefaultsDidChange(_ note: Notification) {
|
||||
self.articleTextSize = AppDefaults.shared.articleTextSize
|
||||
if articleTextSize != AppDefaults.shared.articleTextSize {
|
||||
articleTextSize = AppDefaults.shared.articleTextSize
|
||||
webView.evaluateJavaScript("updateTextSize(\"\(articleTextSize.cssClass)\");")
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: Media Functions
|
||||
|
||||
@@ -4,7 +4,26 @@ body {
|
||||
padding-left: 48px;
|
||||
padding-right: 48px;
|
||||
font-family: -apple-system;
|
||||
font-size: [[font-size]]px;
|
||||
}
|
||||
|
||||
.smallText {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.mediumText {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.largeText {
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.xlargeText {
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
.xxlargeText {
|
||||
font-size: 22px;
|
||||
}
|
||||
|
||||
:root {
|
||||
|
||||
Reference in New Issue
Block a user