mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +00:00
quicksettings: Limit to 5 rows maximum on one page
Any more than that, and it gets disorienting for long phones.
This commit is contained in:
parent
cf756bba6d
commit
f85df674f1
1 changed files with 2 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue