Commit 2de1a7a0 authored by Devin Lin's avatar Devin Lin 🎨
Browse files

homescreens/halcyon: Fix app list margins resizing not working during screen rotation

parent 79e11698
Pipeline #227714 passed with stage
in 1 minute and 29 seconds
......@@ -22,17 +22,13 @@ MobileShell.GridView {
layer.enabled: true
readonly property int reservedSpaceForLabel: metrics.height
required property real effectiveContentWidth
readonly property real effectiveContentWidth: width - leftMargin - rightMargin
cellWidth: effectiveContentWidth / Math.min(Math.floor(effectiveContentWidth / (PlasmaCore.Units.iconSizes.huge + Kirigami.Units.largeSpacing * 2)), 8)
cellWidth: gridView.effectiveContentWidth / Math.min(Math.floor(gridView.effectiveContentWidth / (PlasmaCore.Units.iconSizes.huge + Kirigami.Units.largeSpacing * 2)), 8)
cellHeight: cellWidth + reservedSpaceForLabel
property int columns: Math.floor(effectiveContentWidth / cellWidth)
property int columns: Math.floor(gridView.effectiveContentWidth / cellWidth)
property int rows: Math.ceil(Halcyon.ApplicationListModel.count / columns)
cacheBuffer: Math.max(0, rows * cellHeight)
onWidthChanged: gridView.forceLayout()
function goToBeginning() {
goToBeginningAnim.restart();
......
......@@ -4,6 +4,7 @@
import QtQuick 2.12
import QtQuick.Controls 2.15 as QQC2
import QtQuick.Layouts 1.1
import QtQuick.Window 2.15
import org.kde.plasma.plasmoid 2.0
import org.kde.plasma.core 2.0 as PlasmaCore
......@@ -65,16 +66,14 @@ Item {
}
QQC2.ScrollView {
Layout.fillWidth: true
Layout.fillHeight: true
width: swipeView.width
height: swipeView.height
GridAppList {
id: gridAppList
property real horizontalMargin: Math.max(Kirigami.Units.largeSpacing, swipeView.width * 0.1 / 2)
property int horizontalMargin: Math.round(swipeView.width * 0.05)
interactive: root.interactive
effectiveContentWidth: swipeView.width - leftMargin - rightMargin
leftMargin: horizontalMargin
rightMargin: horizontalMargin
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment