improve library screen
Python CI / test (3.12) (push) Has been cancelled
Python CI / test (3.13) (push) Has been cancelled

This commit is contained in:
2025-11-10 14:31:19 +01:00
parent dd392d2e15
commit d6bdc2ce40
6 changed files with 82 additions and 5 deletions
+25
View File
@@ -326,6 +326,11 @@ class DReaderApplication:
"""
Handle touch events in library mode.
Supports:
- TAP: Select a book to read
- SWIPE_LEFT: Next page
- SWIPE_RIGHT: Previous page
Args:
event: Touch event
"""
@@ -341,6 +346,26 @@ class DReaderApplication:
else:
logger.debug("Tap did not hit a book")
elif event.gesture == GestureType.SWIPE_LEFT:
logger.debug("Library: swipe left (next page)")
if self.library.next_page():
logger.info(f"Library: moved to page {self.library.current_page + 1}/{self.library.get_total_pages()}")
# Re-render library with new page
self.library.create_library_table()
self.current_image = self.library.render_library()
else:
logger.debug("Library: already on last page")
elif event.gesture == GestureType.SWIPE_RIGHT:
logger.debug("Library: swipe right (previous page)")
if self.library.previous_page():
logger.info(f"Library: moved to page {self.library.current_page + 1}/{self.library.get_total_pages()}")
# Re-render library with new page
self.library.create_library_table()
self.current_image = self.library.render_library()
else:
logger.debug("Library: already on first page")
async def _handle_reading_touch(self, event: TouchEvent):
"""
Handle touch events in reading mode.