diff --git a/apple/OmnivoreKit/Sources/App/MacMenuCommands.swift b/apple/OmnivoreKit/Sources/App/MacMenuCommands.swift index a17f1f192..4cc36fa9b 100644 --- a/apple/OmnivoreKit/Sources/App/MacMenuCommands.swift +++ b/apple/OmnivoreKit/Sources/App/MacMenuCommands.swift @@ -15,70 +15,70 @@ import Views public var fontSizeButtons: some View { Group { - Button( - action: { - storedFontSize = min(storedFontSize + 2, 28) - NSNotification.readerSettingsChanged() - }, - label: { Text("Increase Reader Font Size") } - ) - .keyboardShortcut("+") - Button( action: { storedFontSize = max(storedFontSize - 2, 10) NSNotification.readerSettingsChanged() }, - label: { Text("Decrease Reader Font Size") + label: { Text("Decrease Font Size") } ) .keyboardShortcut("-") + + Button( + action: { + storedFontSize = min(storedFontSize + 2, 28) + NSNotification.readerSettingsChanged() + }, + label: { Text("Increase Font Size") } + ) + .keyboardShortcut("+") } } public var marginSizeButtons: some View { Group { - Button( - action: { - storedMaxWidthPercentage = max(storedMaxWidthPercentage - 10, 40) - NSNotification.readerSettingsChanged() - }, - label: { Text("Increase Reader Margin") - } - ) - .keyboardShortcut("]") - Button( action: { storedMaxWidthPercentage = min(storedMaxWidthPercentage + 10, 100) NSNotification.readerSettingsChanged() }, - label: { Text("Decrease Reader Margin") + label: { Text("Decrease Margin") } ) .keyboardShortcut("[") + + Button( + action: { + storedMaxWidthPercentage = max(storedMaxWidthPercentage - 10, 40) + NSNotification.readerSettingsChanged() + }, + label: { Text("Increase Margin") + } + ) + .keyboardShortcut("]") } } public var lineSpacingButtons: some View { Group { - Button( - action: { - storedLineSpacing = min(storedLineSpacing + 25, 300) - NSNotification.readerSettingsChanged() - }, - label: { Text("Increase Reader Line Spacing") } - ) - .keyboardShortcut("l") - Button( action: { storedLineSpacing = max(storedLineSpacing - 25, 100) NSNotification.readerSettingsChanged() }, - label: { Text("Decrease Reader Line Spacing") } + label: { Text("Decrease Line Spacing") } ) .keyboardShortcut("k") + + Button( + action: { + storedLineSpacing = min(storedLineSpacing + 25, 300) + NSNotification.readerSettingsChanged() + }, + label: { Text("Increase Line Spacing") } + ) + .keyboardShortcut("l") } } @@ -91,7 +91,7 @@ import Views } public var body: some Commands { - CommandMenu("Reader Settings") { + CommandMenu("Reader Display") { fontSizeButtons Divider() diff --git a/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReader.swift b/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReader.swift index c80d23d53..52ddc2ef7 100644 --- a/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReader.swift +++ b/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReader.swift @@ -81,8 +81,8 @@ struct WebReader: PlatformViewRepresentable { (webView as? OmnivoreWebView)?.dispatchEvent(.saveAnnotation(annotation: annotation)) } - if readerSettingsChangedTransactionID != context.coordinator.previousReaderSettingsChangedTransactionID { - context.coordinator.previousReaderSettingsChangedTransactionID = readerSettingsChangedTransactionID + if readerSettingsChangedTransactionID != context.coordinator.previousReaderSettingsChangedUUID { + context.coordinator.previousReaderSettingsChangedUUID = readerSettingsChangedTransactionID (webView as? OmnivoreWebView)?.updateFontFamily() (webView as? OmnivoreWebView)?.updateFontSize() (webView as? OmnivoreWebView)?.updateTextContrast() diff --git a/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReaderCoordinator.swift b/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReaderCoordinator.swift index dc539a946..acaaafd18 100644 --- a/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReaderCoordinator.swift +++ b/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReaderCoordinator.swift @@ -15,7 +15,7 @@ final class WebReaderCoordinator: NSObject { var linkHandler: (URL) -> Void = { _ in } var needsReload = false var lastSavedAnnotationID: UUID? - var previousReaderSettingsChangedTransactionID: UUID? + var previousReaderSettingsChangedUUID: UUID? var previousShowNavBarActionID: UUID? var previousShareActionID: UUID? var updateNavBarVisibilityRatio: (Double) -> Void = { _ in }