refinements
This commit is contained in:
+5
-26
@@ -51,7 +51,6 @@ from pyWebLayout.core.highlight import Highlight, HighlightColor, create_highlig
|
||||
|
||||
from .gesture import TouchEvent, GestureType, GestureResponse, ActionType
|
||||
from .state import OverlayState
|
||||
from .overlay import OverlayManager
|
||||
from .managers import DocumentManager, SettingsManager, HighlightCoordinator
|
||||
from .handlers import GestureRouter
|
||||
from .overlays import NavigationOverlay, SettingsOverlay, TOCOverlay
|
||||
@@ -130,17 +129,14 @@ class EbookReader:
|
||||
self.base_font_scale = 1.0
|
||||
self.font_scale_step = 0.1
|
||||
|
||||
# Overlay management (legacy - kept for backward compatibility)
|
||||
self.overlay_manager = OverlayManager(page_size=page_size)
|
||||
self.current_overlay_state = OverlayState.NONE
|
||||
|
||||
# Overlay sub-applications (NEW architecture)
|
||||
# Overlay sub-applications
|
||||
self._overlay_subapps = {
|
||||
OverlayState.NAVIGATION: NavigationOverlay(self),
|
||||
OverlayState.SETTINGS: SettingsOverlay(self),
|
||||
OverlayState.TOC: TOCOverlay(self),
|
||||
}
|
||||
self._active_overlay = None # Current active overlay sub-application
|
||||
self.current_overlay_state = OverlayState.NONE
|
||||
|
||||
def load_epub(self, epub_path: str) -> bool:
|
||||
"""
|
||||
@@ -1014,29 +1010,12 @@ class EbookReader:
|
||||
"""
|
||||
Open the bookmarks overlay.
|
||||
|
||||
This is a convenience method that opens the navigation overlay with the bookmarks tab active.
|
||||
|
||||
Returns:
|
||||
Composited image with bookmarks overlay on top of current page, or None if no book loaded
|
||||
"""
|
||||
if not self.is_loaded():
|
||||
return None
|
||||
|
||||
# Get current page as base
|
||||
base_page = self.get_current_page(include_highlights=False)
|
||||
if not base_page:
|
||||
return None
|
||||
|
||||
# Get bookmarks
|
||||
bookmark_names = self.list_saved_positions()
|
||||
bookmarks = [
|
||||
{"name": name, "position": f"Saved position"}
|
||||
for name in bookmark_names
|
||||
]
|
||||
|
||||
# Open overlay and get composited image
|
||||
result = self.overlay_manager.open_bookmarks_overlay(bookmarks, base_page)
|
||||
self.current_overlay_state = OverlayState.BOOKMARKS
|
||||
|
||||
return result
|
||||
return self.open_navigation_overlay(active_tab="bookmarks")
|
||||
|
||||
def open_navigation_overlay(self, active_tab: str = "contents") -> Optional[Image.Image]:
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user