From 0a4c669e8a43cd9572ec1619e9545faefede03ce Mon Sep 17 00:00:00 2001 From: Devin Lin Date: Sun, 13 Nov 2022 22:17:48 -0500 Subject: [PATCH] homescreens/halcyon: Improve gridview scrolling performance --- .../halcyon/package/contents/ui/GridAppDelegate.qml | 3 +-- .../halcyon/package/contents/ui/GridAppList.qml | 9 ++++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/containments/homescreens/halcyon/package/contents/ui/GridAppDelegate.qml b/containments/homescreens/halcyon/package/contents/ui/GridAppDelegate.qml index c06e2ecb..63329d19 100644 --- a/containments/homescreens/halcyon/package/contents/ui/GridAppDelegate.qml +++ b/containments/homescreens/halcyon/package/contents/ui/GridAppDelegate.qml @@ -127,8 +127,7 @@ MouseArea { } spacing: 0 - // Use Kirigami.Icon to have better icon dimension options - Kirigami.Icon { + PlasmaCore.IconItem { id: icon Kirigami.Theme.inherit: false diff --git a/containments/homescreens/halcyon/package/contents/ui/GridAppList.qml b/containments/homescreens/halcyon/package/contents/ui/GridAppList.qml index 6c1f2b11..0bf8efbd 100644 --- a/containments/homescreens/halcyon/package/contents/ui/GridAppList.qml +++ b/containments/homescreens/halcyon/package/contents/ui/GridAppList.qml @@ -19,16 +19,19 @@ import org.kde.phone.homescreen.halcyon 1.0 as Halcyon MobileShell.GridView { id: gridView - layer.enabled: true + cacheBuffer: cellHeight * 20 // 10 rows above and below reuseItems: true + // ensure items aren't visible out of bounds + layer.enabled: true + readonly property int reservedSpaceForLabel: metrics.height readonly property real effectiveContentWidth: width - leftMargin - rightMargin - cellWidth: gridView.effectiveContentWidth / Math.min(Math.floor(gridView.effectiveContentWidth / (PlasmaCore.Units.iconSizes.huge + Kirigami.Units.largeSpacing * 2)), 8) + cellWidth: gridView.effectiveContentWidth / Math.min(Math.floor(effectiveContentWidth / (PlasmaCore.Units.iconSizes.huge + Kirigami.Units.largeSpacing * 2)), 8) cellHeight: cellWidth + reservedSpaceForLabel - property int columns: Math.floor(gridView.effectiveContentWidth / cellWidth) + property int columns: Math.floor(effectiveContentWidth / cellWidth) property int rows: Math.ceil(Halcyon.ApplicationListModel.count / columns) function goToBeginning() {