fix: correct library hint labels and wire Y/Enter to direct launch

A/Space (confirm) opens the detail view, not launches → label was 'Play', now 'Details'.
Y/Enter (details) was unhandled → wire onDetailsPressed + Keys.onReturnPressed/EnterPressed to launchFocused(), label was 'Details', now 'Play'.
Matches SteamOS/Kodi pattern: primary button = info, secondary = launch.
This commit is contained in:
Marco Allegretti 2026-03-23 12:10:15 +01:00
parent 44f87d6f14
commit aa0b5ca799
2 changed files with 8 additions and 4 deletions

View file

@ -110,8 +110,8 @@ FocusScope {
} }
} }
Keys.onReturnPressed: libraryRoot.selectFocused() Keys.onReturnPressed: libraryRoot.launchFocused()
Keys.onEnterPressed: libraryRoot.selectFocused() Keys.onEnterPressed: libraryRoot.launchFocused()
Keys.onSpacePressed: libraryRoot.selectFocused() Keys.onSpacePressed: libraryRoot.selectFocused()
QQC2.BusyIndicator { QQC2.BusyIndicator {
@ -126,6 +126,10 @@ FocusScope {
if (!grid.flickable || !grid.flickable.activeFocus) return if (!grid.flickable || !grid.flickable.activeFocus) return
libraryRoot.selectFocused() libraryRoot.selectFocused()
} }
function onDetailsPressed() {
if (!grid.flickable || !grid.flickable.activeFocus) return
libraryRoot.launchFocused()
}
function onNavigateUp() { function onNavigateUp() {
if (!grid.flickable || !grid.flickable.activeFocus) return if (!grid.flickable || !grid.flickable.activeFocus) return
let cols = Math.max(1, Math.floor(grid.width / grid.cellWidth)) let cols = Math.max(1, Math.floor(grid.width / grid.cellWidth))

View file

@ -178,9 +178,9 @@ RowLayout {
if (root.context === "library") { if (root.context === "library") {
switch (action) { switch (action) {
case "navigate": return (useGamepadHints || keyboardLabel("navigate") !== "") ? i18n("Navigate") : "" case "navigate": return (useGamepadHints || keyboardLabel("navigate") !== "") ? i18n("Navigate") : ""
case "confirm": return i18n("Play") case "confirm": return i18n("Details")
case "back": return "" case "back": return ""
case "details": return i18n("Details") case "details": return i18n("Play")
case "search": return i18n("Search") case "search": return i18n("Search")
case "lb": return i18n("Prev Source") case "lb": return i18n("Prev Source")
case "rb": return i18n("Next Source") case "rb": return i18n("Next Source")