完善阅读器主题与批注界面

This commit is contained in:
shenlei
2026-07-13 13:01:14 +09:00
parent adc24d3f36
commit 6a0a1223b1
22 changed files with 133 additions and 189 deletions
@@ -4,12 +4,14 @@ final class RDEPUBNotePopupCoordinator {
static func present(
_ note: RDEPUBResolvedNote,
theme: RDEPUBReaderTheme,
from controller: UIViewController,
onReturnToSource: (() -> Void)? = nil,
onOpenNoteLocation: (() -> Void)? = nil
) {
let popup = RDEPUBNotePopupViewController(
note: note,
theme: theme,
onReturnToSource: onReturnToSource,
onOpenNoteLocation: onOpenNoteLocation
)
@@ -3,6 +3,7 @@ import UIKit
final class RDEPUBNotePopupViewController: UIViewController {
private let note: RDEPUBResolvedNote
private let theme: RDEPUBReaderTheme
private let onReturnToSource: (() -> Void)?
private let onOpenNoteLocation: (() -> Void)?
@@ -11,10 +12,12 @@ final class RDEPUBNotePopupViewController: UIViewController {
init(
note: RDEPUBResolvedNote,
theme: RDEPUBReaderTheme,
onReturnToSource: (() -> Void)? = nil,
onOpenNoteLocation: (() -> Void)? = nil
) {
self.note = note
self.theme = theme
self.onReturnToSource = onReturnToSource
self.onOpenNoteLocation = onOpenNoteLocation
super.init(nibName: nil, bundle: nil)
@@ -28,7 +31,7 @@ final class RDEPUBNotePopupViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = .systemBackground
view.backgroundColor = theme.toolBackgroundColor
navigationItem.rightBarButtonItem = UIBarButtonItem(
barButtonSystemItem: .done,
target: self,
@@ -83,8 +86,8 @@ final class RDEPUBNotePopupViewController: UIViewController {
var configuration = UIButton.Configuration.filled()
configuration.cornerStyle = .medium
configuration.title = title
configuration.baseBackgroundColor = .secondarySystemBackground
configuration.baseForegroundColor = .label
configuration.baseBackgroundColor = theme.toolControlTextColor.withAlphaComponent(0.10)
configuration.baseForegroundColor = theme.toolControlTextColor
button.configuration = configuration
if title == "返回原文" {
button.accessibilityIdentifier = "epub.reader.note.return"
@@ -103,7 +106,7 @@ final class RDEPUBNotePopupViewController: UIViewController {
<style>
body {
font: -apple-system-body;
color: #1f1f1f;
color: \(theme.themeTextColorCSS);
line-height: 1.55;
}
a { color: #3b6ea8; }