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

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
@@ -46,9 +46,6 @@ final class RDEPUBReaderChromeCoordinator: NSObject, UIAdaptivePresentationContr
toolView.onShowHighlights = { [weak self] in
self?.context.runtime?.presentHighlightsManager()
}
toolView.onAddHighlight = { [weak self] in
self?.context.runtime?.presentAnnotationCreation()
}
toolView.onShowSettings = { [weak self] in
self?.presentSettings()
}
@@ -68,7 +65,6 @@ final class RDEPUBReaderChromeCoordinator: NSObject, UIAdaptivePresentationContr
canToggleBookmark: controller.currentBookIdentifier != nil,
hasBookmarkAtCurrentLocation: hasBookmarkAtCurrentLocation(),
canShowBookmarks: !controller.activeBookmarks.isEmpty,
canAddHighlight: controller.configuration.allowsHighlights && context.selectionState.hasSelection,
canShowHighlights: controller.configuration.allowsHighlights && !controller.activeHighlights.isEmpty,
showsTableOfContents: controller.configuration.showsTableOfContents,
allowsHighlights: controller.configuration.allowsHighlights,
@@ -93,7 +89,6 @@ final class RDEPUBReaderChromeCoordinator: NSObject, UIAdaptivePresentationContr
showsSettingsPanel: state.showsSettingsPanel
)
controller.bottomToolView.setBookmarksEnabled(state.canShowBookmarks)
controller.bottomToolView.setAddHighlightEnabled(state.canAddHighlight)
controller.bottomToolView.setHighlightsEnabled(state.canShowHighlights)
}
@@ -261,11 +256,12 @@ private final class RDEPUBReaderSettingsPresentationController: UIPresentationCo
let bounds = containerView.bounds
let isLandscape = bounds.width > bounds.height
if isLandscape {
let safeBounds = bounds.inset(by: containerView.safeAreaInsets)
let width = min(390, max(300, bounds.width * 0.32))
let height = min(340, bounds.height - 32)
let height = min(340, safeBounds.height - 32)
return CGRect(
x: bounds.maxX - width - 16,
y: bounds.midY - height / 2,
x: safeBounds.maxX - width - 16,
y: safeBounds.midY - height / 2,
width: width,
height: height
)