fix: expose gamesListWidget from GameLibraryManager to fix gamepad navigation
All checks were successful
Code check / Check code (push) Successful in 3m29s
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:
@@ -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):
|
||||
|
@@ -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()
|
||||
|
@@ -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):
|
||||
|
Reference in New Issue
Block a user