Test appplication for offdevice testing
This commit is contained in:
@@ -90,20 +90,30 @@ class SettingsOverlay(OverlaySubApplication):
|
||||
Returns:
|
||||
GestureResponse with appropriate action
|
||||
"""
|
||||
import logging
|
||||
logger = logging.getLogger(__name__)
|
||||
logger.info(f"[SETTINGS_OVERLAY] Handling tap at ({x}, {y})")
|
||||
logger.info(f"[SETTINGS_OVERLAY] Panel offset: {self._overlay_panel_offset}, Panel size: {self._panel_size}")
|
||||
|
||||
# Query the overlay to see what was tapped
|
||||
query_result = self.query_overlay_pixel(x, y)
|
||||
|
||||
# If query failed (tap outside overlay), close it
|
||||
if not query_result:
|
||||
logger.info(f"[SETTINGS_OVERLAY] Query result: {query_result}")
|
||||
|
||||
# If query failed (tap outside overlay panel), close it
|
||||
if query_result is None:
|
||||
logger.info(f"[SETTINGS_OVERLAY] Tap outside overlay panel, closing")
|
||||
return GestureResponse(ActionType.OVERLAY_CLOSED, {})
|
||||
|
||||
# Check if tapped on a settings control link
|
||||
if query_result.get("is_interactive") and query_result.get("link_target"):
|
||||
link_target = query_result["link_target"]
|
||||
logger.info(f"[SETTINGS_OVERLAY] Found interactive link: {link_target}")
|
||||
|
||||
# Parse "setting:action" format
|
||||
if link_target.startswith("setting:"):
|
||||
action = link_target.split(":", 1)[1]
|
||||
logger.info(f"[SETTINGS_OVERLAY] Applying setting change: {action}")
|
||||
return self._apply_setting_change(action)
|
||||
|
||||
# Parse "action:command" format for other actions
|
||||
@@ -111,10 +121,12 @@ class SettingsOverlay(OverlaySubApplication):
|
||||
action = link_target.split(":", 1)[1]
|
||||
|
||||
if action == "back_to_library":
|
||||
logger.info(f"[SETTINGS_OVERLAY] Back to library clicked")
|
||||
return GestureResponse(ActionType.BACK_TO_LIBRARY, {})
|
||||
|
||||
# Not a setting control, close overlay
|
||||
return GestureResponse(ActionType.OVERLAY_CLOSED, {})
|
||||
# Tap inside overlay but not on interactive element - keep overlay open
|
||||
logger.info(f"[SETTINGS_OVERLAY] Tap on non-interactive area inside overlay, ignoring")
|
||||
return GestureResponse(ActionType.NONE, {})
|
||||
|
||||
def refresh(self, updated_base_page: Image.Image,
|
||||
font_scale: float,
|
||||
|
||||
Reference in New Issue
Block a user