diff --git a/app/gui/AppView.qml b/app/gui/AppView.qml index f939dbfd..6ead3208 100644 --- a/app/gui/AppView.qml +++ b/app/gui/AppView.qml @@ -30,12 +30,16 @@ GridView { id: gamepadKeyNav } + Component.onCompleted: { + // Don't show any highlighted item until interacting with them. + // We do this here instead of onActivated to avoid losing the user's + // selection when backing out of a different page of the app. + currentIndex = -1 + } + StackView.onActivated: { appModel.computerLost.connect(computerLost) gamepadKeyNav.enable() - - // Don't show any highlighted item until interacting with them - currentIndex = -1 } StackView.onDeactivating: { diff --git a/app/gui/PcView.qml b/app/gui/PcView.qml index 61d1704d..de8bd0f4 100644 --- a/app/gui/PcView.qml +++ b/app/gui/PcView.qml @@ -32,14 +32,18 @@ GridView { id: gamepadKeyNav } + Component.onCompleted: { + // Don't show any highlighted item until interacting with them. + // We do this here instead of onActivated to avoid losing the user's + // selection when backing out of a different page of the app. + currentIndex = -1 + } + StackView.onActivated: { gamepadKeyNav.enable() // Setup signals on CM ComputerManager.computerAddCompleted.connect(addComplete) - - // Don't show any highlighted item until interacting with them - currentIndex = -1 } StackView.onDeactivating: {