quicksettings: Fix brightness slider alignment, and forced row count

This commit is contained in:
Devin Lin 2022-06-27 23:47:51 -04:00
parent c4806c6fb5
commit 3a0a744051

View file

@ -43,8 +43,14 @@ Item {
readonly property MobileShell.QuickSettingsModel quickSettingsModel: MobileShell.QuickSettingsModel {}
readonly property int rowCount: Math.floor(Window.height * 65/100 / rowHeight)
readonly property int columnCount: Math.floor(width/columnWidth)
readonly property int rowCount: {
let totalRows = quickSettingsCount / columnCount;
let isPortrait = MobileShell.Shell.orientation === MobileShell.Shell.Portrait;
let targetRows = Math.floor(Window.height * (isPortrait ? 0.65 : 0.8) / rowHeight);
return Math.min(totalRows, targetRows);
}
readonly property int pageSize: rowCount * columnCount
readonly property int quickSettingsCount: quickSettingsModel.count