From 44f87d6f14c277521887524807a5d04084c6fafa Mon Sep 17 00:00:00 2001 From: Marco Allegretti Date: Mon, 23 Mar 2026 12:05:28 +0100 Subject: [PATCH] fix: backdrop never renders on startup when currentIndex stays at 0 onCurrentIndexChanged does not fire if the index was already 0 when the model populated. Use Component.onCompleted + callLater to emit gameFocused for the initial item. --- src/qml/LibraryView.qml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/qml/LibraryView.qml b/src/qml/LibraryView.qml index 2eb0b4b..f706177 100644 --- a/src/qml/LibraryView.qml +++ b/src/qml/LibraryView.qml @@ -89,6 +89,13 @@ FocusScope { if (g) libraryRoot.gameFocused(g) } + Component.onCompleted: { + Qt.callLater(function() { + let g = proxyModel.get(currentIndex) + if (g) libraryRoot.gameFocused(g) + }) + } + delegate: GameCard { game: model.gameObject gridActive: grid.flickable ? grid.flickable.activeFocus : grid.activeFocus