fix: expose gamesListWidget from GameLibraryManager to fix gamepad navigation
All checks were successful
Code check / Check code (push) Successful in 3m29s

Signed-off-by: Boris Yumankulov <boria138@altlinux.org>
This commit is contained in:
2025-10-06 13:20:05 +05:00
parent 65b43c1572
commit 8fd44c575b
3 changed files with 5 additions and 0 deletions

View File

@@ -35,6 +35,7 @@ class MainWindowProtocol(Protocol):
_last_card_width: int
current_hovered_card: GameCard | None
current_focused_card: GameCard | None
gamesListWidget: QWidget | None
class GameLibraryManager:
def __init__(self, main_window: MainWindowProtocol, theme, context_menu_manager: ContextMenuManager | None):

View File

@@ -597,6 +597,9 @@ class InputManager(QObject):
def handle_dpad_slot(self, code: int, value: int, current_time: float) -> None:
if not self._gamepad_handling_enabled:
return
if not hasattr(self._parent, 'gamesListWidget') or self._parent.gamesListWidget is None:
logger.error("gamesListWidget not available yet, skipping D-pad navigation")
return
try:
app = QApplication.instance()

View File

@@ -769,6 +769,7 @@ class MainWindow(QMainWindow):
def createInstalledTab(self):
self.gamesLibraryWidget = self.game_library_manager.create_games_library_widget()
self.stackedWidget.addWidget(self.gamesLibraryWidget)
self.gamesListWidget = self.game_library_manager.gamesListWidget
self.game_library_manager.update_game_grid()
def resizeEvent(self, event):