From 9bf7b70d2bf605cd7ca7d4c2f41ef38e8b2115a9 Mon Sep 17 00:00:00 2001 From: Marco Allegretti Date: Sat, 18 Apr 2026 20:25:05 +0200 Subject: [PATCH] Fix homescreen includes, accessibility, and popup clamp Remove duplicate KService include in favouritesmodel.cpp. Add keyboard navigation and accessibility role to CategoryPanel tiles. Clamp the FavouritesBar thumbnail popup position to screen bounds so it does not overflow offscreen on edge items. --- .../homescreens/folio/favouritesmodel.cpp | 1 - .../homescreens/folio/qml/CategoryPanel.qml | 19 +++++++++++++++++++ .../homescreens/folio/qml/FavouritesBar.qml | 4 ++-- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/containments/homescreens/folio/favouritesmodel.cpp b/containments/homescreens/folio/favouritesmodel.cpp index e813e0c0..17736228 100644 --- a/containments/homescreens/folio/favouritesmodel.cpp +++ b/containments/homescreens/folio/favouritesmodel.cpp @@ -4,7 +4,6 @@ #include "favouritesmodel.h" #include "homescreenstate.h" -#include #include #include #include diff --git a/containments/homescreens/folio/qml/CategoryPanel.qml b/containments/homescreens/folio/qml/CategoryPanel.qml index 9ae3285e..c90f517f 100644 --- a/containments/homescreens/folio/qml/CategoryPanel.qml +++ b/containments/homescreens/folio/qml/CategoryPanel.qml @@ -179,7 +179,26 @@ Rectangle { anchors.fill: parent hoverEnabled: true cursorShape: Qt.PointingHandCursor + activeFocusOnTab: true onClicked: root.categorySelected(tile.catId) + + Keys.onPressed: (event) => { + if (event.key === Qt.Key_Return || event.key === Qt.Key_Enter || event.key === Qt.Key_Space) { + root.categorySelected(tile.catId); + event.accepted = true; + } + } + + Accessible.role: Accessible.Button + Accessible.name: tile.catName + + Rectangle { + anchors.fill: parent + color: "transparent" + border.color: Kirigami.Theme.highlightColor + border.width: tileArea.activeFocus ? 2 : 0 + radius: parent.parent.radius + } } } } diff --git a/containments/homescreens/folio/qml/FavouritesBar.qml b/containments/homescreens/folio/qml/FavouritesBar.qml index 0e361302..652d43de 100644 --- a/containments/homescreens/folio/qml/FavouritesBar.qml +++ b/containments/homescreens/folio/qml/FavouritesBar.qml @@ -642,12 +642,12 @@ MouseArea { x: { if (!targetDelegate) return 0 var delegateGlobal = targetDelegate.mapToGlobal(0, 0) - return Math.max(0, delegateGlobal.x + (targetDelegate.width - width) / 2) + return Math.max(0, Math.min(Screen.width - width, delegateGlobal.x + (targetDelegate.width - width) / 2)) } y: { if (!targetDelegate) return 0 var delegateGlobal = targetDelegate.mapToGlobal(0, 0) - return delegateGlobal.y - height - Kirigami.Units.smallSpacing + return Math.max(0, Math.min(Screen.height - height, delegateGlobal.y - height - Kirigami.Units.smallSpacing)) } onVisibleChanged: {