Focus on first item when a gamepad is connected

This commit is contained in:
Cameron Gutman
2019-05-19 11:08:23 -07:00
parent 65c21f3392
commit 4e4f04c174
4 changed files with 22 additions and 4 deletions

View File

@@ -28,6 +28,11 @@ Flickable {
// This enables Tab and BackTab based navigation rather than arrow keys.
// It is required to shift focus between controls on the settings page.
SdlGamepadKeyNavigation.setUiNavMode(true)
// Highlight the first item if a gamepad is connected
if (SdlGamepadKeyNavigation.getConnectedGamepads() > 0) {
resolutionComboBox.forceActiveFocus(Qt.TabFocus)
}
}
StackView.onDeactivating: {