From 4a9a5b2a978c4ea47275d82fdf41c973ff9d3b85 Mon Sep 17 00:00:00 2001 From: Marco Allegretti Date: Mon, 20 Apr 2026 11:39:58 +0200 Subject: [PATCH] Add empty state, gamepad task controls, and X: Close Show a PlaceholderMessage in the grid when no games are found, with context-aware text for empty library vs no search results. Map gamepad A to activate and X to close in RunningGamesView. Update the legend bar to show X: Close when running tasks are visible. --- .../folio/qml/gaming/GameCenterOverlay.qml | 26 +++++++++++++++++-- .../folio/qml/gaming/RunningGamesView.qml | 13 ++++++++++ 2 files changed, 37 insertions(+), 2 deletions(-) diff --git a/containments/homescreens/folio/qml/gaming/GameCenterOverlay.qml b/containments/homescreens/folio/qml/gaming/GameCenterOverlay.qml index 2cdbb28b..5c5c2637 100644 --- a/containments/homescreens/folio/qml/gaming/GameCenterOverlay.qml +++ b/containments/homescreens/folio/qml/gaming/GameCenterOverlay.qml @@ -100,10 +100,17 @@ Window { if (grid.activeFocus) grid.moveCurrentIndexRight() break case GamingShell.GamepadManager.ButtonA: - if (grid.activeFocus && grid.currentItem) { + if (runningGames.activeFocus) { + runningGames.activateCurrent() + } else if (grid.activeFocus && grid.currentItem) { root.launchGame(grid.currentIndex) } break + case GamingShell.GamepadManager.ButtonX: + if (runningGames.activeFocus) { + runningGames.closeCurrent() + } + break case GamingShell.GamepadManager.ButtonB: root.dismissRequested() break @@ -388,6 +395,19 @@ Window { highlightMoveDuration: 0 highlight: null + Kirigami.PlaceholderMessage { + anchors.centerIn: parent + width: parent.width - Kirigami.Units.gridUnit * 4 + visible: grid.count === 0 && !GamingShell.GameLauncherProvider.loading + icon.name: "games-none" + text: searchField.text.length > 0 + ? i18n("No games match your search") + : i18n("No games found") + explanation: searchField.text.length > 0 + ? "" + : i18n("Install games or check that they have the Game category in their .desktop file") + } + onActiveFocusChanged: { if (activeFocus && count > 0 && currentIndex < 0) { currentIndex = 0 @@ -567,7 +587,9 @@ Window { // Gamepad legend PC3.Label { - text: i18n("A: Select B: Back Y: Exit LB/RB: Filter ☰: Search") + text: runningGames.hasTasks + ? i18n("A: Select X: Close B: Back Y: Exit LB/RB: Filter ☰: Search") + : i18n("A: Select B: Back Y: Exit LB/RB: Filter ☰: Search") font.pointSize: Kirigami.Theme.defaultFont.pointSize * 0.75 opacity: 0.5 } diff --git a/containments/homescreens/folio/qml/gaming/RunningGamesView.qml b/containments/homescreens/folio/qml/gaming/RunningGamesView.qml index 97f1c113..608d080d 100644 --- a/containments/homescreens/folio/qml/gaming/RunningGamesView.qml +++ b/containments/homescreens/folio/qml/gaming/RunningGamesView.qml @@ -29,6 +29,19 @@ Item { taskList.forceActiveFocus() } + function activateCurrent() { + if (taskList.currentItem) { + taskList.currentItem.activate() + } + } + + function closeCurrent() { + if (taskList.currentItem) { + var idx = taskList.currentIndex + tasks.requestClose(tasks.makeModelIndex(idx)) + } + } + TaskManager.VirtualDesktopInfo { id: vdInfo } TaskManager.ActivityInfo { id: actInfo }