mirror of
https://invent.kde.org/marcoa/a-la-karte.git
synced 2026-03-27 01:03:09 +00:00
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:
parent
53c098d54c
commit
f360ebe278
1 changed files with 10 additions and 0 deletions
|
|
@ -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 {
|
delegate: GameCard {
|
||||||
game: model.gameObject
|
game: model.gameObject
|
||||||
gridActive: grid.flickable ? grid.flickable.activeFocus : grid.activeFocus
|
gridActive: grid.flickable ? grid.flickable.activeFocus : grid.activeFocus
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue