folio: Fix folder view delegates using page view delegate dimensions

Fixes: https://invent.kde.org/plasma/plasma-mobile/-/issues/478
This commit is contained in:
Devin Lin 2026-01-13 22:47:29 -05:00
parent 5997f79b44
commit d91ae2e74f

View file

@ -265,13 +265,12 @@ Folio.DelegateTouchArea {
readonly property var delegateModel: model.delegate readonly property var delegateModel: model.delegate
readonly property int index: model.index readonly property int index: model.index
readonly property int folderCellSize: folio.HomeScreenState.folderPageContentWidth / folderBackground.gridLength readonly property int cellWidth: folio.HomeScreenState.folderPageContentWidth / folderBackground.gridLength
readonly property int cellWidth: folio.HomeScreenState.pageCellWidth readonly property int cellHeight: folio.HomeScreenState.folderPageContentHeight / folderBackground.gridLength
readonly property int cellHeight: folio.HomeScreenState.pageCellHeight
readonly property bool outsideView: { readonly property bool outsideView: {
const appPosition = x + (cellWidth - folderCellSize) / 2 + folio.HomeScreenState.folderViewX; const appPosition = x + folio.HomeScreenState.folderViewX;
return (appPosition <= -folderCellSize || appPosition >= folderBackground.width); return (appPosition <= 0 || appPosition >= folderBackground.width);
} }
readonly property var dragState: folio.HomeScreenState.dragState readonly property var dragState: folio.HomeScreenState.dragState
@ -288,11 +287,11 @@ Folio.DelegateTouchArea {
Behavior on pageValue { NumberAnimation { duration: Kirigami.Units.longDuration; easing.type: Easing.InOutQuad } } Behavior on pageValue { NumberAnimation { duration: Kirigami.Units.longDuration; easing.type: Easing.InOutQuad } }
// multiply the index values by the cell size to get the actual position // multiply the index values by the cell size to get the actual position
readonly property int positionColumn: folderCellSize * columnValue readonly property int columnPosition: cellWidth * columnValue
readonly property int positionRow: folderCellSize * rowValue readonly property int rowPosition: cellHeight * rowValue
x: (folderCellSize - cellWidth) / 2 + folderBackground.margin + pageValue * folderBackground.width + positionColumn x: folderBackground.margin + (pageValue * folderBackground.width) + columnPosition
y: (folderCellSize - cellHeight) / 2 + folderBackground.margin + positionRow y: folderBackground.margin + rowPosition
implicitWidth: cellWidth implicitWidth: cellWidth
implicitHeight: cellHeight implicitHeight: cellHeight