fix: update focused game when proxy model count changes

Covers async model load: if count goes 0→N after QML init and currentIndex stays 0, onCurrentIndexChanged never fires. onCountChanged ensures backdrop updates on first population.
This commit is contained in:
Marco Allegretti 2026-03-23 12:13:10 +01:00
parent 53c098d54c
commit f360ebe278

View file

@ -96,6 +96,16 @@ FocusScope {
})
}
Connections {
target: proxyModel
function onCountChanged() {
if (proxyModel.count > 0) {
let g = proxyModel.get(grid.currentIndex)
if (g) libraryRoot.gameFocused(g)
}
}
}
delegate: GameCard {
game: model.gameObject
gridActive: grid.flickable ? grid.flickable.activeFocus : grid.activeFocus