mirror of
https://invent.kde.org/marcoa/a-la-karte.git
synced 2026-03-26 17:03:08 +00:00
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.
This commit is contained in:
parent
09cdba516b
commit
44f87d6f14
1 changed files with 7 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue