完善阅读器主题与批注界面
This commit is contained in:
+4
-8
@@ -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
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user