From f85df674f1ac864028a263430ec000f0aff11eff Mon Sep 17 00:00:00 2001 From: Devin Lin Date: Fri, 11 Nov 2022 21:29:05 -0500 Subject: [PATCH] quicksettings: Limit to 5 rows maximum on one page Any more than that, and it gets disorienting for long phones. --- .../qml/actiondrawer/quicksettings/QuickSettings.qml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettings.qml b/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettings.qml index c81356c3..dd0ea2fc 100644 --- a/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettings.qml +++ b/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettings.qml @@ -47,8 +47,9 @@ Item { readonly property int rowCount: { let totalRows = Math.ceil(quickSettingsCount / columnCount); let isPortrait = MobileShell.Shell.orientation === MobileShell.Shell.Portrait; + let maxRows = 5; // more than 5 is just disorienting let targetRows = Math.floor(Window.height * (isPortrait ? 0.65 : 0.8) / rowHeight); - return Math.min(totalRows, targetRows); + return Math.min(maxRows, Math.min(totalRows, targetRows)); } readonly property int pageSize: rowCount * columnCount